aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2003-09-08 16:23:21 +0000
committerIan Dowse <iedowse@FreeBSD.org>2003-09-08 16:23:21 +0000
commitffe40c80ea0e580db9390ed94c1fcdfff29e2082 (patch)
tree42b140e8967958d7bc2fea81e82e3032b39e11f9 /sys/kern/vfs_mount.c
parent322f54189b0240595974360101eef916c19864ea (diff)
downloadsrc-ffe40c80ea0e580db9390ed94c1fcdfff29e2082.tar.gz
src-ffe40c80ea0e580db9390ed94c1fcdfff29e2082.zip
In the !MNT_BYFSID case, return EINVAL from unmount(2) when the
specified directory is not found in the mount list. Before the MNT_BYFSID changes, unmount(2) used to return ENOENT for a nonexistent path and EINVAL for a non-mountpoint, but we can no longer distinguish between these cases. Of the two error codes, EINVAL was more likely to occur in practice, and it was the only one of the two that was documented. Update the manual page to match the current behaviour. Suggested by: tjr Reviewed by: tjr
Notes
Notes: svn path=/head/; revision=119885
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 7d166f02f45d..efc78745bbbf 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1255,8 +1255,15 @@ unmount(td, uap)
mtx_unlock(&mountlist_mtx);
}
free(pathbuf, M_TEMP);
- if (mp == NULL)
- return (ENOENT);
+ if (mp == NULL) {
+ /*
+ * Previously we returned ENOENT for a nonexistent path and
+ * EINVAL for a non-mountpoint. We cannot tell these apart
+ * now, so in the !MNT_BYFSID case return the more likely
+ * EINVAL for compatibility.
+ */
+ return ((uap->flags & MNT_BYFSID) ? ENOENT : EINVAL);
+ }
/*
* Only root, or the user that did the original mount is