diff options
author | Guoqing Jiang <jgq516@gmail.com> | 2021-05-25 11:46:20 +0200 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2021-06-15 07:32:06 +0200 |
commit | 9b8ae7b938235229ccb112c4e887ff1bcc232836 (patch) | |
tree | 4efed0c9fdc6b6f19cf507f5726f161faf88da27 /drivers/md | |
parent | md/raid5: avoid redundant bio clone in raid5_read_one_chunk (diff) | |
download | linux-9b8ae7b938235229ccb112c4e887ff1bcc232836.tar.xz linux-9b8ae7b938235229ccb112c4e887ff1bcc232836.zip |
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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ced076ba560e..696da6b8b7ed 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1210,7 +1210,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, const unsigned long do_sync = (bio->bi_opf & REQ_SYNC); int max_sectors; int rdisk; - bool print_msg = !!r1_bio; + bool r1bio_existed = !!r1_bio; char b[BDEVNAME_SIZE]; /* @@ -1220,7 +1220,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, */ gfp_t gfp = r1_bio ? (GFP_NOIO | __GFP_HIGH) : GFP_NOIO; - if (print_msg) { + if (r1bio_existed) { /* Need to get the block device name carefully */ struct md_rdev *rdev; rcu_read_lock(); @@ -1252,7 +1252,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, if (rdisk < 0) { /* couldn't find anywhere to read from */ - if (print_msg) { + if (r1bio_existed) { pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n", mdname(mddev), b, @@ -1263,7 +1263,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, } mirror = conf->mirrors + rdisk; - if (print_msg) + if (r1bio_existed) pr_info_ratelimited("md/raid1:%s: redirecting sector %llu to other mirror: %s\n", mdname(mddev), (unsigned long long)r1_bio->sector, |