diff options
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 67783e03d121..53c3501fa4ca 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "dev-replace.h" | 28 | #include "dev-replace.h" |
29 | #include "check-integrity.h" | 29 | #include "check-integrity.h" |
30 | #include "rcu-string.h" | 30 | #include "rcu-string.h" |
31 | #include "raid56.h" | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * This is only the first step towards a full-features scrub. It reads all | 34 | * This is only the first step towards a full-features scrub. It reads all |
@@ -2254,6 +2255,13 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, | |||
2254 | struct btrfs_device *extent_dev; | 2255 | struct btrfs_device *extent_dev; |
2255 | int extent_mirror_num; | 2256 | int extent_mirror_num; |
2256 | 2257 | ||
2258 | if (map->type & (BTRFS_BLOCK_GROUP_RAID5 | | ||
2259 | BTRFS_BLOCK_GROUP_RAID6)) { | ||
2260 | if (num >= nr_data_stripes(map)) { | ||
2261 | return 0; | ||
2262 | } | ||
2263 | } | ||
2264 | |||
2257 | nstripes = length; | 2265 | nstripes = length; |
2258 | offset = 0; | 2266 | offset = 0; |
2259 | do_div(nstripes, map->stripe_len); | 2267 | do_div(nstripes, map->stripe_len); |
@@ -2708,7 +2716,7 @@ static noinline_for_stack int scrub_supers(struct scrub_ctx *sctx, | |||
2708 | int ret; | 2716 | int ret; |
2709 | struct btrfs_root *root = sctx->dev_root; | 2717 | struct btrfs_root *root = sctx->dev_root; |
2710 | 2718 | ||
2711 | if (root->fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) | 2719 | if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) |
2712 | return -EIO; | 2720 | return -EIO; |
2713 | 2721 | ||
2714 | gen = root->fs_info->last_trans_committed; | 2722 | gen = root->fs_info->last_trans_committed; |