diff --git a/Base/usr/share/man/man2/mount.md b/Base/usr/share/man/man2/mount.md index 3ece948f60..26b4c26710 100644 --- a/Base/usr/share/man/man2/mount.md +++ b/Base/usr/share/man/man2/mount.md @@ -90,6 +90,8 @@ launch the initial userspace process. 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`) All of the usual path resolution errors may also occur. diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp index 5376563530..30df65543b 100644 --- a/Kernel/Syscalls/mount.cpp +++ b/Kernel/Syscalls/mount.cpp @@ -91,6 +91,8 @@ int Process::sys$mount(Userspace user_params) if (fs_type == "ext2" || fs_type == "Ext2FS") { if (description.is_null()) return -EBADF; + if (!description->file().is_block_device()) + return -ENOTBLK; if (!description->file().is_seekable()) { dbgln("mount: this is not a seekable file"); return -ENODEV;