summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-02-05 01:26:48 -0500
committerTheodore Ts'o <tytso@mit.edu>2017-02-05 01:26:48 -0500
commit4753d8a24d4588657bc0a4cd66d4e282dff15c8c (patch)
treee6547b0b73d596218a8368bd95ec6f93e75d8396 /fs/ext4
parent97abd7d4b5d9c48ec15c425485f054e1c15e591b (diff)
downloadlinux-4753d8a24d4588657bc0a4cd66d4e282dff15c8c.tar.gz
linux-4753d8a24d4588657bc0a4cd66d4e282dff15c8c.tar.bz2
linux-4753d8a24d4588657bc0a4cd66d4e282dff15c8c.zip
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
Diffstat (limited to 'fs/ext4')
-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 3fef82e79131..514e5fc59893 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -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)) {