@@ -1662,11 +1662,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
goto restore;
}
- if (fs_info->fs_devices->missing_devices >
- fs_info->num_tolerated_disk_barrier_failures &&
- !(*flags & MS_RDONLY)) {
+ ret = btrfs_check_degradable(fs_info, *flags);
+ if (ret < 0) {
+ btrfs_err(fs_info,
+ "degraded writable remount failed %d", ret);
+ goto restore;
+ } else if (ret > 0 && !btrfs_test_opt(root, DEGRADED)) {
btrfs_warn(fs_info,
- "too many missing devices, writeable remount is not allowed");
+ "some device missing, but still degraded mountable, please remount with -o degraded option");
ret = -EACCES;
goto restore;
}