LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* race condition in umount/statfs
@ 2008-10-16 16:30 Cyril Hrubis
  0 siblings, 0 replies; only message in thread
From: Cyril Hrubis @ 2008-10-16 16:30 UTC (permalink / raw)
  To: linux-kernel

Hi,
I've found that when umount command calls umount2() the process stays in
umount2() call till caches are flushed but entry in /etc/mtab is removed
after umount returns from umount2(). When df is invoked in the meantime,
it just returns statfs() for path from mtab, but as the filesystem
is not mounted in kernel anymore, you get statistics for another
filesystem instead (most likely /).

Example:  mount a usb flashdisk, copy some files there and then umount.
Cache flush on my machines is about 10 seconds.

As an fix I could call statfs() on parent directory and compare f_fsid, but
the manual says its set to zero on NFS and some systems.

--
metan

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-16 16:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-16 16:30 race condition in umount/statfs Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).