Re: data corruption: revalidating a (removable) hdd/flash on re-insert

Kay Sievers
2008-11-05T00:30:10Z

On Tue, Nov 4, 2008 at 22:22, Michael Tokarev <mjt@tls.msk.ru> wrote:

> So for me, it's easy to deal with (not perfect but it works; it'd be
> even better if i will be able to wait for umount using inotify, to
> only wake when really needed),

If I understand it right, what you are looking for, you could sleep in
poll() of /proc/mounts, and will be woken up with POLLERR if anything
in your mount tree changes. Then you check the state of your usb
device and possibly invalidate it.

Kay