From: Gou Hao Date: Thu, 14 Dec 2023 15:14:58 +0000 (+0800) Subject: md/raid1: remove unnecessary null checking X-Git-Tag: v6.8-rc1~121^2~32^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af140f806ae2679f9dba48ea0f5811da83854eb6;p=thirdparty%2Flinux.git md/raid1: remove unnecessary null checking If %__GFP_DIRECT_RECLAIM is set then bio_alloc_bioset will always be able to allocate a bio. See comment of bio_alloc_bioset. Signed-off-by: Gou Hao Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231214151458.28970-1-gouhao@uniontech.com --- diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 9348f17095120..19c9bf0060ae6 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1124,8 +1124,6 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio, behind_bio = bio_alloc_bioset(NULL, vcnt, 0, GFP_NOIO, &r1_bio->mddev->bio_set); - if (!behind_bio) - return; /* discard op, we don't support writezero/writesame yet */ if (!bio_has_data(bio)) {