Skip to contentSkip to conversation

jffs2: check if partition is marked RO on remount

PATCH New Sebastian Siewior 1 participant 1 message Mar 6, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jffs2: check if partition is marked RO on remount

and if it is, don't tell userspace that write is possible.

---
 fs/jffs2/fs.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/jffs2/fs.c +3 -0
index e26ea78..a9f474f 100644
@@ -374,6 +374,9 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
 	if (c->flags & JFFS2_SB_FLAG_RO && !(sb->s_flags & MS_RDONLY))
 		return -EROFS;
 
+	if (!(c->mtd->flags & MTD_WRITEABLE))
+		return -EROFS;
+
 	/* We stop if it was running, then restart if it needs to.
 	   This also catches the case where it was stopped and this
 	   is just a remount to restart it.
Signature · 1 line
1.5.3.5