From 90343eeaeb878238b34f276b0620743ccbf45922 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 30 Jan 2021 13:50:53 +0100 Subject: [PATCH] Revert "Kernel: Return -ENOTDIR for non-directory mount target" This reverts commit b7b09470ca7f08f42b0f3a6701192adbdf198870. Mounting a file on top of a file is a valid thing we support. --- Base/usr/share/man/man2/mount.md | 1 - Kernel/Syscalls/mount.cpp | 3 --- 2 files changed, 4 deletions(-) diff --git a/Base/usr/share/man/man2/mount.md b/Base/usr/share/man/man2/mount.md index 26b4c26710..63904326e1 100644 --- a/Base/usr/share/man/man2/mount.md +++ b/Base/usr/share/man/man2/mount.md @@ -89,7 +89,6 @@ launch the initial userspace process. * `EBADF`: If the `source_fd` is not valid, and either `fs_type` specifies a file-backed filesystem (and not a pseudo filesystem), or `MS_BIND` is specified in flags. -* `ENOTDIR`: If `target` is not a directory. * `ENOTBLK`: If the `source_fd` is not a block device, but one is required (i.e. when `fs_type` is `Ext2FS`) diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp index 30df65543b..fd265ca20f 100644 --- a/Kernel/Syscalls/mount.cpp +++ b/Kernel/Syscalls/mount.cpp @@ -67,9 +67,6 @@ int Process::sys$mount(Userspace user_params) auto& target_custody = custody_or_error.value(); - if (!target_custody->inode().is_directory()) - return -ENOTDIR; - if (params.flags & MS_REMOUNT) { // We're not creating a new mount, we're updating an existing one! return VFS::the().remount(target_custody, params.flags & ~MS_REMOUNT);