From: Qu Wenruo Date: Thu, 9 Mar 2017 01:34:38 +0000 (+0800) Subject: btrfs: Do chunk level check for degraded remount X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b382cfe889da5d39aeceb79e261f862c3a53eafb;p=openwrt%2Fstaging%2Fblogic.git 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: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 2351794fbc44..e4c268c250f5 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1781,8 +1781,7 @@ 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) { + if (!btrfs_check_rw_degradable(fs_info)) { btrfs_warn(fs_info, "too many missing devices, writeable remount is not allowed"); ret = -EACCES;