summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-02-05 01:26:48 -0500
committerBen Hutchings <ben@decadent.org.uk>2017-06-05 21:17:03 +0100
commitdb3f208f65d29d8195913aad3edfd7d48f22d6fb (patch)
tree594fb3ab506d21da02fa44f1d1fa7d273b31d405 /fs
parent5093d3749646a6baf634a7f8b681ce4cd29e0525 (diff)
downloadlinux-stable-db3f208f65d29d8195913aad3edfd7d48f22d6fb.tar.gz
linux-stable-db3f208f65d29d8195913aad3edfd7d48f22d6fb.tar.bz2
linux-stable-db3f208f65d29d8195913aad3edfd7d48f22d6fb.zip
ext4: return EROFS if device is r/o and journal replay is needed
commit 4753d8a24d4588657bc0a4cd66d4e282dff15c8c upstream. 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> [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 36ac0cddb9e8..a0f65266fca4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4038,7 +4038,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
*/
if (!test_opt(sb, NOLOAD) &&
EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
- if (ext4_load_journal(sb, es, journal_devnum))
+ err = ext4_load_journal(sb, es, journal_devnum);
+ if (err)
goto failed_mount3;
} else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER)) {