diff options
-rw-r--r-- | fs/btrfs/volumes.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 8a3d2594b80..3f292cf693a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -4061,16 +4061,18 @@ static void btrfs_end_bio(struct bio *bio, int err) | |||
4061 | 4061 | ||
4062 | BUG_ON(stripe_index >= bbio->num_stripes); | 4062 | BUG_ON(stripe_index >= bbio->num_stripes); |
4063 | dev = bbio->stripes[stripe_index].dev; | 4063 | dev = bbio->stripes[stripe_index].dev; |
4064 | if (bio->bi_rw & WRITE) | 4064 | if (dev->bdev) { |
4065 | btrfs_dev_stat_inc(dev, | 4065 | if (bio->bi_rw & WRITE) |
4066 | BTRFS_DEV_STAT_WRITE_ERRS); | 4066 | btrfs_dev_stat_inc(dev, |
4067 | else | 4067 | BTRFS_DEV_STAT_WRITE_ERRS); |
4068 | btrfs_dev_stat_inc(dev, | 4068 | else |
4069 | BTRFS_DEV_STAT_READ_ERRS); | 4069 | btrfs_dev_stat_inc(dev, |
4070 | if ((bio->bi_rw & WRITE_FLUSH) == WRITE_FLUSH) | 4070 | BTRFS_DEV_STAT_READ_ERRS); |
4071 | btrfs_dev_stat_inc(dev, | 4071 | if ((bio->bi_rw & WRITE_FLUSH) == WRITE_FLUSH) |
4072 | BTRFS_DEV_STAT_FLUSH_ERRS); | 4072 | btrfs_dev_stat_inc(dev, |
4073 | btrfs_dev_stat_print_on_error(dev); | 4073 | BTRFS_DEV_STAT_FLUSH_ERRS); |
4074 | btrfs_dev_stat_print_on_error(dev); | ||
4075 | } | ||
4074 | } | 4076 | } |
4075 | } | 4077 | } |
4076 | 4078 | ||