From: Chuck Lever Date: Mon, 24 Sep 2007 15:29:31 +0000 (-0400) Subject: umount.nfs: umount doesn't recognize a busy file system X-Git-Tag: nfs-utils-1-1-1~42 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=e227ac0348431eecc1ddadf5d1907c8348741519;p=nfs-utils.git umount.nfs: umount doesn't recognize a busy file system umount.nfs shouldn't remove a busy file system from /etc/mtab, and should report and return an error. I also added an extra "goto" to make the flow of control more clear, and to reduce the chance that a future change in this logic will break it. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c index 4311473..e7f37ef 100644 --- a/utils/mount/nfsumount.c +++ b/utils/mount/nfsumount.c @@ -102,10 +102,14 @@ static int del_mtab(const char *spec, const char *node) } else res = umount (node); - if (res < 0 && remount && errno == EBUSY && spec) { - res = try_remount(spec, node); - if (!res) + if (res < 0) { + if (remount && errno == EBUSY && spec) { + res = try_remount(spec, node); + if (res) + goto writemtab; return 0; + } else + umnt_err = errno; } if (res >= 0) {