diff options
author | Theodore Ts'o <tytso@mit.edu> | 2023-04-28 05:49:34 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-04-28 19:56:40 +0300 |
commit | 3b50d5018ed06a647bb26c44bb5ae74e59c903c7 (patch) | |
tree | e68138a6c019f8183b8ef9d19e25666ea68c4e75 /fs/ext4/super.c | |
parent | d5e72c4e3256335d6fb75c2e321144f93141f4f5 (diff) | |
download | linux-3b50d5018ed06a647bb26c44bb5ae74e59c903c7.tar.xz |
ext4: reflect error codes from ext4_multi_mount_protect() to its callers
This will allow more fine-grained errno codes to be returned by the
mount system call.
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 8ed6450effaa..c8ae6b7e8615 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5328,9 +5328,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) ext4_has_feature_orphan_present(sb) || ext4_has_feature_journal_needs_recovery(sb)); - if (ext4_has_feature_mmp(sb) && !sb_rdonly(sb)) - if (ext4_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block))) + if (ext4_has_feature_mmp(sb) && !sb_rdonly(sb)) { + err = ext4_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block)); + if (err) goto failed_mount3a; + } /* * The first inode we look at is the journal inode. Don't try @@ -6565,12 +6567,12 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb) goto restore_opts; sb->s_flags &= ~SB_RDONLY; - if (ext4_has_feature_mmp(sb)) - if (ext4_multi_mount_protect(sb, - le64_to_cpu(es->s_mmp_block))) { - err = -EROFS; + if (ext4_has_feature_mmp(sb)) { + err = ext4_multi_mount_protect(sb, + le64_to_cpu(es->s_mmp_block)); + if (err) goto restore_opts; - } + } #ifdef CONFIG_QUOTA enable_quota = 1; #endif |