Skip to contentSkip to conversation

umount.nfs: umount doesn't recognize a busy file system

PATCH In review Chuck Lever 1 participant 1 message Sep 24, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 13/14 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.

---

 utils/mount/nfsumount.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
utils/mount/nfsumount.c +7 -3
index 4311473..e7f37ef 100644
@@ -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) {

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs