1 ext4: return EROFS if device is r/o and journal replay is needed
3 If the file system requires journal recovery, and the device is
4 read-ony, return EROFS to the mount system call. This allows xfstests
7 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 Cc: stable@vger.kernel.org
10 fs/ext4/super.c | 3 ++-
11 1 file changed, 2 insertions(+), 1 deletion(-)
13 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
14 index 3fef82e79131..514e5fc59893 100644
17 @@ -3925,7 +3925,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
18 * root first: it may be modified in the journal!
20 if (!test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb)) {
21 - if (ext4_load_journal(sb, es, journal_devnum))
22 + err = ext4_load_journal(sb, es, journal_devnum);
25 } else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
26 ext4_has_feature_journal_needs_recovery(sb)) {