ext4: return EROFS if device is r/o and journal replay is needed

am: 6ad4196f19

Change-Id: Id2fea1964520c451afc4bfd2d903526bff0ff090
This commit is contained in:
Theodore Ts'o 2017-03-12 08:18:46 +00:00 committed by android-build-merger
commit 666ec57cb1

View file

@ -3748,7 +3748,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
* root first: it may be modified in the journal!
*/
if (!test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb)) {
if (ext4_load_journal(sb, es, journal_devnum))
err = ext4_load_journal(sb, es, journal_devnum);
if (err)
goto failed_mount3a;
} else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
ext4_has_feature_journal_needs_recovery(sb)) {