PATCH] Do not limit RAID1 and DUP transfer length to one stripe
The 65k stripe length should be ignored as the stripes are physically contiguous on disk so transfers can span stripes.
--- fs/btrfs/volumes.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
fs/btrfs/volumes.c +3 -3
@@ -2697,13 +2697,13 @@ again:/* stripe_offset is the offset of this block in its stripe*/ stripe_offset = offset - stripe_offset; -if (map->type & (BTRFS_BLOCK_GROUP_RAID0 |BTRFS_BLOCK_GROUP_RAID1 | -BTRFS_BLOCK_GROUP_RAID10 | -BTRFS_BLOCK_GROUP_DUP )) { +if (map->type & (BTRFS_BLOCK_GROUP_RAID0 | +BTRFS_BLOCK_GROUP_RAID10 )) {/* we limit the length of each bio to what fits in a stripe */ *length =min_t (u64, em->len - offset, map->stripe_len - stripe_offset); }else { +/* RAID1, DUP, and simple disk stripes are all contiguous */ *length = em->len - offset; }
Signature · 1 line
1.5.6.3
Quoted 19 lines · jim owens
The 65k stripe length should be ignored as the stripes are physically contiguous on disk so transfers can span stripes.
Signed-off-by jim owens <[email protected]>--- fs/btrfs/volumes.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)fs/btrfs/volumes.c +0
-2@@ -2697,13 +2697,13 @@ again:/* stripe_offset is the offset of this block in its stripe*/ stripe_offset = offset - stripe_offset; - if (map->type & (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 | - BTRFS_BLOCK_GROUP_RAID10 |
fs/btrfs/volumes.c again: · line 2708
Quoted 10 lines
fs/btrfs/volumes.c +3
-1- BTRFS_BLOCK_GROUP_DUP)) { +if (map->type & (BTRFS_BLOCK_GROUP_RAID0 | +BTRFS_BLOCK_GROUP_RAID10 )) {/* we limit the length of each bio to what fits in a stripe */ *length =min_t (u64, em->len - offset, map->stripe_len - stripe_offset); }else { +/* RAID1, DUP, and simple disk stripes are all contiguous */ *length = em->len - offset; }
We do need to make sure the bio doesn't try to span a chunk. The mapping code can't handle that.
-chris
Quoted 10 lines · Chris Mason
fs/btrfs/volumes.c again: · line 2708
Quoted 6 lines · jim owens
The 65k stripe length should be ignored as the stripes are physically contiguous on disk so transfers can span stripes.
fs/btrfs/volumes.c +1
-0+/* RAID1, DUP, and simple disk stripes are all contiguous */ *length = em->len - offset; }We do need to make sure the bio doesn't try to span a chunk. The mapping code can't handle that.
I don't understand what code can't handle it, the em is limited to a chunk so em->start to em->start + em->len will be reachable as a single physical disk region for raid1 and dup... right?