[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230627034127.4000994-2-linan666@huaweicloud.com>
Date: Tue, 27 Jun 2023 11:41:26 +0800
From: linan666@...weicloud.com
To: song@...nel.org
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
linan122@...wei.com, yukuai3@...wei.com, yi.zhang@...wei.com,
houtao1@...wei.com, yangerkun@...wei.com
Subject: [PATCH 1/2] md/raid10: a simple cleanup for fix_recovery_read_error
From: Li Nan <linan122@...wei.com>
There is no need to use a new variable 'rdev2' for write device since
'rdev' is not used again later. Use 'rdev' directly. Assigning return
value to 'ok' is also unnecessary. Clean it up.
Signed-off-by: Li Nan <linan122@...wei.com>
---
drivers/md/raid10.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 4fcfcb350d2b..5105273f60e9 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2590,10 +2590,9 @@ static void fix_recovery_read_error(struct r10bio *r10_bio)
if (rdev != conf->mirrors[dw].rdev) {
/* need bad block on destination too */
- struct md_rdev *rdev2 = conf->mirrors[dw].rdev;
+ rdev = conf->mirrors[dw].rdev;
addr = r10_bio->devs[1].addr + sect;
- ok = rdev_set_badblocks(rdev2, addr, s, 0);
- if (!ok) {
+ if (!rdev_set_badblocks(rdev, addr, s, 0)) {
/* just abort the recovery */
pr_notice("md/raid10:%s: recovery aborted due to read error\n",
mdname(mddev));
--
2.39.2
Powered by blists - more mailing lists