Commit b382cfe8 authored by Qu Wenruo's avatar Qu Wenruo Committed by David Sterba

btrfs: Do chunk level check for degraded remount

Just the same for mount time check, use btrfs_check_rw_degradable() to
check if we are OK to be remounted rw.
Signed-off-by: default avatarQu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4330e183
...@@ -1781,8 +1781,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) ...@@ -1781,8 +1781,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
goto restore; goto restore;
} }
if (fs_info->fs_devices->missing_devices > if (!btrfs_check_rw_degradable(fs_info)) {
fs_info->num_tolerated_disk_barrier_failures) {
btrfs_warn(fs_info, btrfs_warn(fs_info,
"too many missing devices, writeable remount is not allowed"); "too many missing devices, writeable remount is not allowed");
ret = -EACCES; ret = -EACCES;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment