On Thu, Aug 22, 2024 at 5:45 AM Stefan Monnier <monn...@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

Reply via email to