]> git.ipfire.org Git - thirdparty/linux.git/commit
md/raid1: fix the comparing region of interval tree
authorXiao Ni <xni@redhat.com>
Thu, 5 Mar 2026 01:18:33 +0000 (09:18 +0800)
committerYu Kuai <yukuai@fnnas.com>
Sun, 22 Mar 2026 18:15:10 +0000 (02:15 +0800)
commitde3544d2e5ea99064498de3c21ba490155864657
tree94acaa6378dfb70cbee9d489621c88322df12c6f
parent52e4324935be917f8f3267354b3cc06bb8ffcec1
md/raid1: fix the comparing region of interval tree

Interval tree uses [start, end] as a region which stores in the tree.
In raid1, it uses the wrong end value. For example:
bio(A,B) is too big and needs to be split to bio1(A,C-1), bio2(C,B).
The region of bio1 is [A,C] and the region of bio2 is [C,B]. So bio1 and
bio2 overlap which is not right.

Fix this problem by using right end value of the region.

Fixes: d0d2d8ba0494 ("md/raid1: introduce wait_for_serialization")
Signed-off-by: Xiao Ni <xni@redhat.com>
Link: https://lore.kernel.org/linux-raid/20260305011839.5118-2-xni@redhat.com/
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
drivers/md/raid1.c