diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c index 0b0c40af..4c6ad64f 100644 --- a/kernel-shared/extent-tree.c +++ b/kernel-shared/extent-tree.c @@ -3308,7 +3308,7 @@ out: static u64 get_dev_extent_len(struct map_lookup *map) { - int div; + int div = 1; switch (map->type & BTRFS_BLOCK_GROUP_PROFILE_MASK) { case 0: /* Single */ @@ -3316,7 +3316,7 @@ static u64 get_dev_extent_len(struct map_lookup *map) case BTRFS_BLOCK_GROUP_RAID1: case BTRFS_BLOCK_GROUP_RAID1C3: case BTRFS_BLOCK_GROUP_RAID1C4: - div = 1; + /* The default value can already handle it. */ break; case BTRFS_BLOCK_GROUP_RAID5: case BTRFS_BLOCK_GROUP_RAID6: diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c index 65147d06..1e2c8895 100644 --- a/kernel-shared/volumes.c +++ b/kernel-shared/volumes.c @@ -2758,6 +2758,7 @@ u64 btrfs_stripe_length(struct btrfs_fs_info *fs_info, BTRFS_BLOCK_GROUP_PROFILE_MASK; chunk_len = btrfs_chunk_length(leaf, chunk); + stripe_len = chunk_len; switch (profile) { case 0: /* Single profile */ @@ -2765,7 +2766,7 @@ u64 btrfs_stripe_length(struct btrfs_fs_info *fs_info, case BTRFS_BLOCK_GROUP_RAID1C3: case BTRFS_BLOCK_GROUP_RAID1C4: case BTRFS_BLOCK_GROUP_DUP: - stripe_len = chunk_len; + /* The default value is already fine. */ break; case BTRFS_BLOCK_GROUP_RAID0: stripe_len = chunk_len / num_stripes;