diff options
author | 2023-04-27 22:49:34 -0400 | |
---|---|---|
committer | 2023-04-28 12:56:40 -0400 | |
commit | 3b50d5018ed06a647bb26c44bb5ae74e59c903c7 (patch) | |
tree | e68138a6c019f8183b8ef9d19e25666ea68c4e75 /fs/ext4/super.c | |
parent | ext4: fix lost error code reporting in __ext4_fill_super() (diff) | |
download | wireguard-linux-3b50d5018ed06a647bb26c44bb5ae74e59c903c7.tar.xz wireguard-linux-3b50d5018ed06a647bb26c44bb5ae74e59c903c7.zip |
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 '')
-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 |