syscall_fs3: correct EROFS handling for devices on a read-only fs
authorAlan Cox <alan@linux.intel.com>
Fri, 25 Mar 2016 22:22:51 +0000 (22:22 +0000)
committerAlan Cox <alan@linux.intel.com>
Fri, 25 Mar 2016 22:22:51 +0000 (22:22 +0000)
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

index 06a2b9f..5fccbeb 100644 (file)
@@ -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;
                }