From: Kohei Enju <enjuk@amazon.com>
To: <linux-scsi@vger.kernel.org>, <target-devel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
Kohei Enju <kohei.enju@gmail.com>, Kohei Enju <enjuk@amazon.com>
Subject: [PATCH v1] scsi: target: remove unnecessary null checking for bio allocation
Date: Sun, 2 Feb 2025 18:02:08 +0900 [thread overview]
Message-ID: <20250202090208.26890-1-enjuk@amazon.com> (raw)
When __GFP_DIRECT_RECLAIM (included in GFP_NOIO) is specified,
bio_alloc_bioset() never fails to allocate a bio. For more details, see
the comment in bio_alloc_bioset() in block/bio.c
Signed-off-by: Kohei Enju <enjuk@amazon.com>
---
drivers/target/target_core_iblock.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index c8dc92a7d63e..9ef23eea55e7 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -369,10 +369,6 @@ static struct bio *iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num,
*/
bio = bio_alloc_bioset(ib_dev->ibd_bd, bio_max_segs(sg_num), opf,
GFP_NOIO, &ib_dev->ibd_bio_set);
- if (!bio) {
- pr_err("Unable to allocate memory for bio\n");
- return NULL;
- }
bio->bi_private = cmd;
bio->bi_end_io = &iblock_bio_done;
--
2.39.5 (Apple Git-154)
next reply other threads:[~2025-02-02 9:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-02 9:02 Kohei Enju [this message]
2025-02-02 13:56 ` [PATCH] scsi: target: remove unnecessary null checking for bio allocation Markus Elfring
2025-02-02 14:30 ` Kohei Enju
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=20250202090208.26890-1-enjuk@amazon.com \
--to=enjuk@amazon.com \
--cc=kohei.enju@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.