diff options
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r-- | sys/kern/vfs_mount.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 7d166f0..efc7874 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 |