1
0
Fork 0

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

If the file system requires journal recovery, and the device is
read-ony, return EROFS to the mount system call.  This allows xfstests
generic/050 to pass.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
hifive-unleashed-5.1
Theodore Ts'o 2017-02-05 01:26:48 -05:00
parent 97abd7d4b5
commit 4753d8a24d
1 changed files with 2 additions and 1 deletions

View File

@ -3925,7 +3925,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)) {