Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #272462

Re: wait until swapoff is *actually* finished (it returns too early)?

From Mike Castle <dalgoda+debian@gmail.com>
Newsgroups linux.debian.user
Subject Re: wait until swapoff is *actually* finished (it returns too early)?
Date 2024-08-22 17:50 +0200
Message-ID <Jeieu-6OGL-23@gated-at.bofh.it> (permalink)
References <JdGVz-6qT2-1@gated-at.bofh.it> <JdU2t-6zom-11@gated-at.bofh.it> <Je0Uh-6DJp-1@gated-at.bofh.it> <Jefqh-6MWk-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 22, 2024 at 5:45 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> How 'bout checking the success of `cryptdisks_stop`?

Does cryptdisks have the ability to display what is in use at the
moment?  Maybe polling that before executing the stop?

I suspect that the race is that, when the the swapoff() syscall
returns, the kernel has indeed moved all of the content off, so that
part is fine... but it has not yet released whatever kind of resources
is has on the backing store (akin to an open file handle).  Or the
cryptdisks stack itself hasn't fully processed the notification.

Ideally the stop command would have a flag that says 'wait for any
pending changes to happen', but short of that, some sort of status
than can be polled with a sleep between it might be a bit more formal.

You could then control the timeout by looping no more than N times,
then failing a bit more gracefully than it is now.

mrc

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

wait until swapoff is *actually* finished (it returns too early)? Thorsten Glaser <tg@debian.org> - 2024-08-21 02:00 +0200
  Re: wait until swapoff is *actually* finished (it returns too early)? Roberto C. Sánchez <roberto@debian.org> - 2024-08-21 02:10 +0200
    Re: wait until swapoff is *actually* finished (it returns too early)? Greg Wooledge <greg@wooledge.org> - 2024-08-21 02:20 +0200
      Re: wait until swapoff is *actually* finished (it returns too early)? Erwan David <erwan@rail.eu.org> - 2024-08-21 08:50 +0200
        Re: wait until swapoff is *actually* finished (it returns too early)? Greg Wooledge <greg@wooledge.org> - 2024-08-21 13:40 +0200
          Re: wait until swapoff is *actually* finished (it returns too early)? Alain D D Williams <addw@phcomp.co.uk> - 2024-08-21 14:20 +0200
        Re: wait until swapoff is *actually* finished (it returns too early)? Alain D D Williams <addw@phcomp.co.uk> - 2024-08-21 13:50 +0200
      Re: wait until swapoff is *actually* finished (it returns too early)? Roberto C. Sánchez <roberto@debian.org> - 2024-08-21 13:50 +0200
  Re: wait until swapoff is *actually* finished (it returns too early)? Stefan Monnier <monnier@iro.umontreal.ca> - 2024-08-21 15:40 +0200
  Re: wait until swapoff is *actually* finished (it returns too early)? Franco Martelli <martellif67@gmail.com> - 2024-08-21 16:00 +0200
    Re: wait until swapoff is *actually* finished (it returns too early)? Thorsten Glaser <tg@debian.org> - 2024-08-21 23:20 +0200
      Re: wait until swapoff is *actually* finished (it returns too early)? Stefan Monnier <monnier@iro.umontreal.ca> - 2024-08-22 14:50 +0200
        Re: wait until swapoff is *actually* finished (it returns too early)? Mike Castle <dalgoda+debian@gmail.com> - 2024-08-22 17:50 +0200
          Re: wait until swapoff is *actually* finished (it returns too early)? Thorsten Glaser <tg@debian.org> - 2024-08-22 19:30 +0200
            Re: wait until swapoff is *actually* finished (it returns too early)? <tomas@tuxteam.de> - 2024-08-22 21:40 +0200
              Re: wait until swapoff is *actually* finished (it returns too early)? Mike Castle <dalgoda+debian@gmail.com> - 2024-08-23 05:40 +0200
            Re: wait until swapoff is *actually* finished (it returns too early)? Mike Castle <dalgoda+debian@gmail.com> - 2024-08-23 04:50 +0200
              Re: wait until swapoff is *actually* finished (it returns too early)? Thorsten Glaser <tg@debian.org> - 2024-08-23 05:20 +0200
  Re: wait until swapoff is *actually* finished (it returns too early)? Pierre-Elliott Bécue <peb@debian.org> - 2024-08-23 13:10 +0200
    Re: wait until swapoff is *actually* finished (it returns too early)? Thorsten Glaser <tg@debian.org> - 2024-08-23 22:20 +0200

csiph-web