提交 00d01bc1 编写于 作者: A Arne Jansen 提交者: Chris Mason

btrfs scrub: don't coalesce pages that are logically discontiguous

scrub_page collects several pages into one bio as long as they are physically
contiguous. As we only save one logical address for the whole bio, don't
collect pages that are physically contiguous but logically discontiguous.
Signed-off-by: NArne Jansen <sensille@gmx.net>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 c309df07
...@@ -631,7 +631,8 @@ static int scrub_page(struct scrub_dev *sdev, u64 logical, u64 len, ...@@ -631,7 +631,8 @@ static int scrub_page(struct scrub_dev *sdev, u64 logical, u64 len,
if (sbio->count == 0) { if (sbio->count == 0) {
sbio->physical = physical; sbio->physical = physical;
sbio->logical = logical; sbio->logical = logical;
} else if (sbio->physical + sbio->count * PAGE_SIZE != physical) { } else if (sbio->physical + sbio->count * PAGE_SIZE != physical ||
sbio->logical + sbio->count * PAGE_SIZE != logical) {
scrub_submit(sdev); scrub_submit(sdev);
goto again; goto again;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册