public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] scsi: target: remove unnecessary null checking for bio allocation
@ 2025-02-02  9:02 Kohei Enju
  2025-02-02 13:56 ` [PATCH] " Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Kohei Enju @ 2025-02-02  9:02 UTC (permalink / raw)
  To: linux-scsi, target-devel, linux-kernel
  Cc: Martin K . Petersen, Kohei Enju, Kohei Enju

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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: target: remove unnecessary null checking for bio allocation
  2025-02-02  9:02 [PATCH v1] scsi: target: remove unnecessary null checking for bio allocation Kohei Enju
@ 2025-02-02 13:56 ` Markus Elfring
  2025-02-02 14:30   ` Kohei Enju
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2025-02-02 13:56 UTC (permalink / raw)
  To: Kohei Enju, linux-scsi, target-devel, Martin K. Petersen; +Cc: Kohei Enju, LKML

> 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

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13#n94


Can a blank line be also omitted together with the mentioned compound statement?

Regards,
Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: target: remove unnecessary null checking for bio allocation
  2025-02-02 13:56 ` [PATCH] " Markus Elfring
@ 2025-02-02 14:30   ` Kohei Enju
  0 siblings, 0 replies; 3+ messages in thread
From: Kohei Enju @ 2025-02-02 14:30 UTC (permalink / raw)
  To: markus.elfring
  Cc: enjuk, kohei.enju, linux-kernel, linux-scsi, martin.petersen,
	target-devel

> > 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
> 
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13#n94

Thanks. I'll modify the commit message into imperative mood.

> Can a blank line be also omitted together with the mentioned compound statement?

Sure, I think so. 
I'll submit a v2 patch with the modified commit message and without the blank line.

Regards,
Kohei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-02 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-02  9:02 [PATCH v1] scsi: target: remove unnecessary null checking for bio allocation Kohei Enju
2025-02-02 13:56 ` [PATCH] " Markus Elfring
2025-02-02 14:30   ` Kohei Enju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox