mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Kernel: Return -ENOTBLK for non-block device Ext2FS mount source
When mounting an Ext2FS, a block device source is required. All other filesystem types are unaffected, as most of them ignore the source file descriptor anyway. Fixes #5153.
This commit is contained in:
committed by
Andreas Kling
parent
b7b09470ca
commit
dbbc378fb2
@@ -90,6 +90,8 @@ launch the initial userspace process.
|
|||||||
file-backed filesystem (and not a pseudo filesystem), or `MS_BIND` is
|
file-backed filesystem (and not a pseudo filesystem), or `MS_BIND` is
|
||||||
specified in flags.
|
specified in flags.
|
||||||
* `ENOTDIR`: If `target` is not a directory.
|
* `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.
|
All of the usual path resolution errors may also occur.
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ int Process::sys$mount(Userspace<const Syscall::SC_mount_params*> user_params)
|
|||||||
if (fs_type == "ext2" || fs_type == "Ext2FS") {
|
if (fs_type == "ext2" || fs_type == "Ext2FS") {
|
||||||
if (description.is_null())
|
if (description.is_null())
|
||||||
return -EBADF;
|
return -EBADF;
|
||||||
|
if (!description->file().is_block_device())
|
||||||
|
return -ENOTBLK;
|
||||||
if (!description->file().is_seekable()) {
|
if (!description->file().is_seekable()) {
|
||||||
dbgln("mount: this is not a seekable file");
|
dbgln("mount: this is not a seekable file");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|||||||
Reference in New Issue
Block a user