[PATCH v2 23/35] ubifs: set/clear MS_RDONLY properly in ubifs_remount

Dongsheng Yang yangds.fnst at cn.fujitsu.com
Wed Jul 29 22:48:19 PDT 2015


We need to set or clear MS_RDONLY in remounting.

Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
---
 fs/ubifs/super.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 9fdfd69..6ed35e2 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1953,6 +1953,7 @@ static int ubifs_remount_rw(struct ubifs_info *c)
 		 */
 		err = dbg_check_space_info(c);
 	}
+	c->vfs_sb->s_flags &= ~MS_RDONLY;
 
 	mutex_unlock(&c->umount_mutex);
 	return err;
@@ -2019,6 +2020,7 @@ static void ubifs_remount_ro(struct ubifs_info *c)
 	err = dbg_check_space_info(c);
 	if (err)
 		ubifs_ro_mode(c, err);
+	c->vfs_sb->s_flags |= MS_RDONLY;
 	mutex_unlock(&c->umount_mutex);
 }
 
-- 
1.8.4.2




More information about the linux-mtd mailing list