diff options
author | Theodore Ts'o <tytso@mit.edu> | 2017-02-05 09:26:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-12 08:37:27 +0300 |
commit | 6ad4196f1952ffb8e5cac931b5825997c8a39e75 (patch) | |
tree | 56d2b2a045b1d66182343e42b11024a009aa5756 /fs | |
parent | 9a79248c083d502958a7c833bcaa8879fbe09682 (diff) | |
download | linux-6ad4196f1952ffb8e5cac931b5825997c8a39e75.tar.xz |
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/super.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 2f7b74e07fb0..6fe8e30eeb99 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -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)) { |