Commit 02c67a3b authored by Li Nan's avatar Li Nan Committed by Song Liu

md: remove redundant check in fix_read_error()

In fix_read_error(), 'success' will be checked immediately after assigning
it, if it is set to 1 then the loop will break. Checking it again in
condition of loop is redundant. Clean it up.
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
Reviewed-by: default avatarYu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20230623173236.2513554-3-linan666@huaweicloud.comSigned-off-by: default avatarSong Liu <song@kernel.org>
parent 605eeda6
...@@ -2301,7 +2301,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, ...@@ -2301,7 +2301,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
d++; d++;
if (d == conf->raid_disks * 2) if (d == conf->raid_disks * 2)
d = 0; d = 0;
} while (!success && d != read_disk); } while (d != read_disk);
if (!success) { if (!success) {
/* Cannot read from anywhere - mark it bad */ /* Cannot read from anywhere - mark it bad */
......
...@@ -2783,7 +2783,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 ...@@ -2783,7 +2783,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
sl++; sl++;
if (sl == conf->copies) if (sl == conf->copies)
sl = 0; sl = 0;
} while (!success && sl != slot); } while (sl != slot);
rcu_read_unlock(); rcu_read_unlock();
if (!success) { if (!success) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment