summaryrefslogtreecommitdiffstats
path: root/sbin/umount
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2003-11-16 16:48:18 +0000
committeriedowse <iedowse@FreeBSD.org>2003-11-16 16:48:18 +0000
commit82b3c3937bee0cd8348a634a02b3068a92bb76a5 (patch)
tree40fb55a2c01df8e5a9174243c7184fcc7d1ca469 /sbin/umount
parent1ff7b74aca76aa6e8a8f85fb31796776e830cb87 (diff)
downloadFreeBSD-src-82b3c3937bee0cd8348a634a02b3068a92bb76a5.zip
FreeBSD-src-82b3c3937bee0cd8348a634a02b3068a92bb76a5.tar.gz
If the unmount by file system ID fails, don't warn before retrying
a non-fsid unmount if the file system ID is all zeros. This is a temporary workaround for warnings that occur in the vfs.usermount=1 case because non-root users get a zeroed filesystem ID. I have a more complete fix in the works, but I won't get it done for 5.2.
Diffstat (limited to 'sbin/umount')
-rw-r--r--sbin/umount/umount.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c
index 6b3ad28..4c2b824 100644
--- a/sbin/umount/umount.c
+++ b/sbin/umount/umount.c
@@ -359,7 +359,10 @@ umountfs(struct statfs *sfs)
snprintf(fsidbuf, sizeof(fsidbuf), "FSID:%d:%d", sfs->f_fsid.val[0],
sfs->f_fsid.val[1]);
if (unmount(fsidbuf, fflag | MNT_BYFSID) != 0) {
- warn("unmount of %s failed", sfs->f_mntonname);
+ /* XXX, non-root users get a zero fsid, so don't warn. */
+ if (errno != ENOENT || sfs->f_fsid.val[0] != 0 ||
+ sfs->f_fsid.val[1] != 0)
+ warn("unmount of %s failed", sfs->f_mntonname);
if (errno != ENOENT)
return (1);
/* Compatability for old kernels. */
OpenPOWER on IntegriCloud