svn commit: r222466 - head/sbin/umount

Rick Macklem rmacklem at uoguelph.ca
Mon May 30 13:58:51 UTC 2011


> On Mon, May 30, 2011 at 01:48:53PM +0100, Robert Watson wrote:
> > On Sun, 29 May 2011, Rick Macklem wrote:
> >
> > > Modify the umount(8) command so that it doesn't do
> > > a sync(2) syscall before unmount(2) for the "-f" case.
> > > This avoids a forced dismount from getting stuck for
> > > an NFS mountpoint in sync() when the server is not
> > > responsive. With this commit, forced dismounts should
> > > normally work for the NFS clients, but can take up to
> > > about 1minute to complete.
> >
> > I'm actually a bit confused about why umount(8) calls sync(2) at
> > all:
> > surely it's the responsibility of the file system, rather than the
> > userland
> > tool, to ensure consistency subject to file system configuration and
> > unmount-time flags?
> This call is from the same department as triple-sync before reboot,
> IMO.
Hehe. I'm so old, I do two syncs, as required by 6th Edition.:-)

I assumed the sync() was meant to be an optimization (given the comment
for it) in the sense that it would get the writes of dirty blocks started
"right away". However, given the short period of time from the the sync(2)
call to the unmount(2) call, I'm not convinced it makes a significant
difference. (I thought of just getting rid of it, but figured it was
harmless for the non "-f" case and might matter for a buggy fs that doesn't
get the unmount(2) quite right. ie. Same argument as doing the triple-sync,
just to be sure.)

rick


More information about the svn-src-all mailing list