From 82b3c3937bee0cd8348a634a02b3068a92bb76a5 Mon Sep 17 00:00:00 2001 From: iedowse Date: Sun, 16 Nov 2003 16:48:18 +0000 Subject: 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. --- sbin/umount/umount.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sbin/umount') 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. */ -- cgit v1.1