]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
On "umount --lazy", don't tell the server we have unmounted.
authorNeil Brown <neilb@suse.de>
Fri, 16 Mar 2007 05:50:11 +0000 (16:50 +1100)
committerNeil Brown <neilb@suse.de>
Fri, 16 Mar 2007 05:50:11 +0000 (16:50 +1100)
Because, ofcourse, we haven't.
When we do finally let-go of the mount, the server won't get told,
but the same would happen on a crash, and the server just has to cope.

utils/mount/nfsumount.c

index 077219d6ae87e223669492c642e55bfc9d481b5e..4208ade291d1c63898f5b374df568f10c4ac9243 100644 (file)
@@ -324,16 +324,17 @@ int nfsumount(int argc, char *argv[])
        if (!mc && verbose)
                printf(_("Could not find %s in mtab\n"), spec);
 
+       ret = 0;
        if (mc) {
-               ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
+               if (!lazy)
+                       ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
                if(ret)
                        ret = del_mtab(mc->m.mnt_fsname, mc->m.mnt_dir);
-       } else {
-               if (*spec != '/')
+       } else if (*spec != '/') {
+               if (!lazy)
                        ret = _nfsumount(spec, "tcp,v3");
-               else
-                       ret = del_mtab(NULL, spec);
-       }
+       } else
+               ret = del_mtab(NULL, spec);
 
        return(ret);
 }