summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2017-06-27 05:28:40 -0400
committerDavid Sterba <dsterba@suse.com>2017-08-16 10:12:02 -0400
commitd10b82fe29cf3730ab7c1a487f0f62f10af5d301 (patch)
tree64e360bdd559b99f0402ac3369f3545a9e8e7a7e /fs/btrfs/disk-io.c
parentb382cfe889da5d39aeceb79e261f862c3a53eafb (diff)
btrfs: Allow barrier_all_devices to do chunk level device check
The last user of num_tolerated_disk_barrier_failures is barrier_all_devices(). But it can be easily changed to the new per-chunk degradable check framework. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 78fc7f5ab773..552098e1b65b 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3519,20 +3519,10 @@ static blk_status_t wait_dev_flush(struct btrfs_device *device)
3519 return bio->bi_status; 3519 return bio->bi_status;
3520} 3520}
3521 3521
3522static int check_barrier_error(struct btrfs_fs_devices *fsdevs) 3522static int check_barrier_error(struct btrfs_fs_info *fs_info)
3523{ 3523{
3524 int dev_flush_error = 0; 3524 if (!btrfs_check_rw_degradable(fs_info))
3525 struct btrfs_device *dev;
3526
3527 list_for_each_entry_rcu(dev, &fsdevs->devices, dev_list) {
3528 if (!dev->bdev || dev->last_flush_error)
3529 dev_flush_error++;
3530 }
3531
3532 if (dev_flush_error >
3533 fsdevs->fs_info->num_tolerated_disk_barrier_failures)
3534 return -EIO; 3525 return -EIO;
3535
3536 return 0; 3526 return 0;
3537} 3527}
3538 3528
@@ -3587,7 +3577,7 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
3587 * to arrive at the volume status. So error checking 3577 * to arrive at the volume status. So error checking
3588 * is being pushed to a separate loop. 3578 * is being pushed to a separate loop.
3589 */ 3579 */
3590 return check_barrier_error(info->fs_devices); 3580 return check_barrier_error(info);
3591 } 3581 }
3592 return 0; 3582 return 0;
3593} 3583}