Skip to content

Commit 9b8ae7b

Browse files
GuoqingJiang-Linuxliu-song-6
authored andcommitted
md/raid1: rename print_msg with r1bio_existed
The caller of raid1_read_request could pass NULL or a valid pointer for "struct r1bio *r1_bio", so it actually means whether r1_bio is existed or not. Signed-off-by: Guoqing Jiang <jiangguoqing@kylinos.cn> Signed-off-by: Song Liu <song@kernel.org>
1 parent 1147f58 commit 9b8ae7b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/md/raid1.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
12101210
const unsigned long do_sync = (bio->bi_opf & REQ_SYNC);
12111211
int max_sectors;
12121212
int rdisk;
1213-
bool print_msg = !!r1_bio;
1213+
bool r1bio_existed = !!r1_bio;
12141214
char b[BDEVNAME_SIZE];
12151215

12161216
/*
@@ -1220,7 +1220,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
12201220
*/
12211221
gfp_t gfp = r1_bio ? (GFP_NOIO | __GFP_HIGH) : GFP_NOIO;
12221222

1223-
if (print_msg) {
1223+
if (r1bio_existed) {
12241224
/* Need to get the block device name carefully */
12251225
struct md_rdev *rdev;
12261226
rcu_read_lock();
@@ -1252,7 +1252,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
12521252

12531253
if (rdisk < 0) {
12541254
/* couldn't find anywhere to read from */
1255-
if (print_msg) {
1255+
if (r1bio_existed) {
12561256
pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n",
12571257
mdname(mddev),
12581258
b,
@@ -1263,7 +1263,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
12631263
}
12641264
mirror = conf->mirrors + rdisk;
12651265

1266-
if (print_msg)
1266+
if (r1bio_existed)
12671267
pr_info_ratelimited("md/raid1:%s: redirecting sector %llu to other mirror: %s\n",
12681268
mdname(mddev),
12691269
(unsigned long long)r1_bio->sector,

0 commit comments

Comments
 (0)