From: Gou Hao <gouhao@uniontech.com>
To: song@kernel.org, linux-raid@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, gouhaojake@163.com
Subject: [PATCH] md/raid1: remove unnecessary null checking
Date: Thu, 14 Dec 2023 23:14:58 +0800 [thread overview]
Message-ID: <20231214151458.28970-1-gouhao@uniontech.com> (raw)
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 <gouhao@uniontech.com>
---
drivers/md/raid1.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 35d12948e0a9..e77dc95d4a75 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1126,8 +1126,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)) {
--
2.34.1
next reply other threads:[~2023-12-14 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 15:14 Gou Hao [this message]
2023-12-15 23:31 ` Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231214151458.28970-1-gouhao@uniontech.com \
--to=gouhao@uniontech.com \
--cc=gouhaojake@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®