Re: [PATCH] retry force umount (was Re: NFS and umount -f)

From: Daniel McNeil
Date: Wed Jun 23 2004 - 19:24:14 EST


On Wed, 2004-06-23 at 16:47, viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
wrote:
> On Wed, Jun 23, 2004 at 04:42:55PM -0700, Daniel McNeil wrote:
> > This works for me on 2.6.7 as well. However, I would get EBUSY back
> > if processes were hung doing nfs operations to the downed server.
> > The processes would get unstuck and get EIO, but the umount would
> > still fail. Doing a 2nd umount -f with no processes waiting for
> > the server would succeed. This patch retries force umounts in
> > the kernel an extra time after giving them time to wake up and
> > get out of the kernel. It doesn't seem quite right to fail
> > a bunch of nfs operations and leave the file system mounted.
>
> Is there any reason to do that in the kernel? What, umount(8) can't do the
> same?

One reason to do it in the kernel is for consistency at the syscall
layer -- before the syscall it was mounted and after it is unmounted.
The umount syscall can return after causing nfs operations to fail
for processes waiting for a down server with the file system still
mounted.

You're right though, having umount(8) retry the force umount from
user-space might be good enough. Ideally, force umount should
always succeed and retrying once inside the kernel doesn't guarantee
that.

Daniel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/