From: Miklos S. <mi...@sz...> - 2007-11-12 13:22:42
|
> it seems that mtab_needs_update function will judge the /etc/mtab, and > just exits if the file is a symlink. I don't know what the function means. > Now I have to use umount directly if I want to umount it. Right. And that's buggy, since the filesystem still needs to be umounted, even if the mtab does not need modification. This patch against 2.7.1 should fix it. Thanks, Miklos Index: lib/mount_util.c =================================================================== RCS file: /cvsroot/fuse/fuse/lib/mount_util.c,v retrieving revision 1.8 diff -u -r1.8 mount_util.c --- lib/mount_util.c 16 Oct 2007 15:12:08 -0000 1.8 +++ lib/mount_util.c 12 Nov 2007 13:16:45 -0000 @@ -17,6 +17,7 @@ #include <mntent.h> #include <sys/stat.h> #include <sys/wait.h> +#include <sys/mount.h> static int mtab_needs_update(const char *mnt) { @@ -91,8 +92,13 @@ int res; int status; - if (!mtab_needs_update(mnt)) - return 0; + if (!mtab_needs_update(mnt)) { + res = umount2(mnt, lazy ? 2 : 0); + if (res == -1) + fprintf(stderr, "%s: failed to unmount %s: %s\n", progname, + mnt, strerror(errno)); + return res; + } res = fork(); if (res == -1) { |