Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+2 -1
+2 -1
fs/ext4/super.c
··· 3925 3925 * root first: it may be modified in the journal! 3926 3926 */ 3927 3927 if (!test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb)) { 3928 - if (ext4_load_journal(sb, es, journal_devnum)) 3928 + err = ext4_load_journal(sb, es, journal_devnum); 3929 + if (err) 3929 3930 goto failed_mount3a; 3930 3931 } else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) && 3931 3932 ext4_has_feature_journal_needs_recovery(sb)) {