[PATCH] init/do_mounts.c: treat EROFS like EACCES

From: Philippe De Muyter
Date: Wed Jun 18 2014 - 12:22:14 EST


some combinations of filesystem and block device (at least vfat on mmc)
yield -EROFS instead of -EACCES when the device is read-only. Retry
mounting with MS_RDONLY set, just like for the EACCES case, instead of
failing directly.

Signed-off-by: Philippe De Muyter <phdm@xxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
init/do_mounts.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 82f2288..af7b9b8 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -394,6 +394,7 @@ retry:
case 0:
goto out;
case -EACCES:
+ case -EROFS:
flags |= MS_RDONLY;
goto retry;
case -EINVAL:
--
1.7.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/