From c2ceff19e9d81dfb188c2b6c53400d421bfbf39f Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 25 Mar 2016 22:22:51 +0000 Subject: [PATCH] syscall_fs3: correct EROFS handling for devices on a read-only fs With this you can now boot up into a shell with r/o root so once we fix up the native fsck to do fuzix and fit in the memory space you'll be able to rescue the root fs natively --- Kernel/syscall_fs3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel/syscall_fs3.c b/Kernel/syscall_fs3.c index 06a2b9f1..5fccbebc 100644 --- a/Kernel/syscall_fs3.c +++ b/Kernel/syscall_fs3.c @@ -86,7 +86,9 @@ arg_t _open(void) udata.u_error = EISDIR; goto cantopen; } - if (ino->c_flags & CRDONLY) { + /* Special case - devices on a read only file system may + be opened read/write */ + if (!isdevice(ino) && (ino->c_flags & CRDONLY)) { udata.u_error = EROFS; goto cantopen; } -- 2.34.1