]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md/raid1: Add check for missing source disk in process_checks()
authorMeir Elisha <meir.elisha@volumez.com>
Tue, 8 Apr 2025 14:38:08 +0000 (17:38 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:47:08 +0000 (07:47 +0200)
commitfc9629651badb6d05fb8b1a6552c3f326acd7d04
tree6d024b354b84b1bd3d6730b15f301478be90bfb3
parent61b36bdc70cae4dbd08e643b35fc91e6ecd5fc4c
md/raid1: Add check for missing source disk in process_checks()

[ Upstream commit b7c178d9e57c8fd4238ff77263b877f6f16182ba ]

During recovery/check operations, the process_checks function loops
through available disks to find a 'primary' source with successfully
read data.

If no suitable source disk is found after checking all possibilities,
the 'primary' index will reach conf->raid_disks * 2. Add an explicit
check for this condition after the loop. If no source disk was found,
print an error message and return early to prevent further processing
without a valid primary source.

Link: https://lore.kernel.org/linux-raid/20250408143808.1026534-1-meir.elisha@volumez.com
Signed-off-by: Meir Elisha <meir.elisha@volumez.com>
Suggested-and-reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/raid1.c