]> git.hungrycats.org Git - linux/commit
md/raid10: improve code of mrdev in raid10_sync_request
authorLi Nan <linan122@huawei.com>
Sat, 27 May 2023 07:22:16 +0000 (15:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Nov 2024 14:07:21 +0000 (15:07 +0100)
commit9478355c63099f1fb0b0674d74a402933c0d8f7f
tree7ec57904fd0d7dee1e6d31bf47f46b08762810ac
parentd4b003f7203eba1f6195383480665655e3c6c074
md/raid10: improve code of mrdev in raid10_sync_request

commit 59f8f0b54c8ffb4521f6bbd1cb6f4dfa5022e75e upstream.

'need_recover' and 'mrdev' are equivalent in raid10_sync_request(), and
inc mrdev->nr_pending is unreasonable if don't need recovery. Replace
'need_recover' with 'mrdev', and only inc nr_pending when needed.

Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230527072218.2365857-3-linan666@huaweicloud.com
Cc: Hagar Gamal Halim <hagarhem@amazon.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid10.c