summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-09-24 11:29:31 -0400
committerNeil Brown <neilb@suse.de>2007-09-25 11:50:16 +1000
commite227ac0348431eecc1ddadf5d1907c8348741519 (patch)
treeac0feab203d8657ee28b3f9dc07e327dd31ad1ca
parente90a21266b0bed721d6df4468cf85f06d578fc8e (diff)
downloadnfs-utils-e227ac0348431eecc1ddadf5d1907c8348741519.tar.gz
nfs-utils-e227ac0348431eecc1ddadf5d1907c8348741519.tar.xz
nfs-utils-e227ac0348431eecc1ddadf5d1907c8348741519.zip
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 <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r--utils/mount/nfsumount.c10
1 files changed, 7 insertions, 3 deletions
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) {