public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: cleanup bio_integrity_prep
       [not found] <CGME20230725051839epcms2p8e4d20ad6c51326ad032e8406f59d0aaa@epcms2p8>
@ 2023-07-25  5:18 ` Jinyoung Choi
  2023-07-26  0:50   ` Martin K. Petersen
  2023-07-26  2:31   ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Jinyoung Choi @ 2023-07-25  5:18 UTC (permalink / raw)
  To: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
  Cc: hch@lst.de, martin.petersen@oracle.com

If a problem occurs in the process of creating an integrity payload, the
status of bio is always BLK_STS_RESOURCE.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com>
---
 block/bio-integrity.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 8f0af7ac8573..045553a164e0 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -199,7 +199,6 @@ bool bio_integrity_prep(struct bio *bio)
 	unsigned long start, end;
 	unsigned int len, nr_pages;
 	unsigned int bytes, offset, i;
-	blk_status_t status;
 
 	if (!bi)
 		return true;
@@ -227,7 +226,6 @@ bool bio_integrity_prep(struct bio *bio)
 	/* Allocate kernel buffer for protection data */
 	len = bio_integrity_bytes(bi, bio_sectors(bio));
 	buf = kmalloc(len, GFP_NOIO);
-	status = BLK_STS_RESOURCE;
 	if (unlikely(buf == NULL)) {
 		printk(KERN_ERR "could not allocate integrity buffer\n");
 		goto err_end_io;
@@ -242,7 +240,6 @@ bool bio_integrity_prep(struct bio *bio)
 	if (IS_ERR(bip)) {
 		printk(KERN_ERR "could not allocate data integrity bioset\n");
 		kfree(buf);
-		status = BLK_STS_RESOURCE;
 		goto err_end_io;
 	}
 
@@ -270,7 +267,6 @@ bool bio_integrity_prep(struct bio *bio)
 
 		if (ret == 0) {
 			printk(KERN_ERR "could not attach integrity payload\n");
-			status = BLK_STS_RESOURCE;
 			goto err_end_io;
 		}
 
@@ -292,7 +288,7 @@ bool bio_integrity_prep(struct bio *bio)
 	return true;
 
 err_end_io:
-	bio->bi_status = status;
+	bio->bi_status = BLK_STS_RESOURCE;
 	bio_endio(bio);
 	return false;
 
-- 
2.34.1

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

* Re: [PATCH] block: cleanup bio_integrity_prep
  2023-07-25  5:18 ` [PATCH] block: cleanup bio_integrity_prep Jinyoung Choi
@ 2023-07-26  0:50   ` Martin K. Petersen
  2023-07-26  2:31   ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-07-26  0:50 UTC (permalink / raw)
  To: Jinyoung Choi
  Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, hch@lst.de,
	martin.petersen@oracle.com


Jinyoung,

> If a problem occurs in the process of creating an integrity payload,
> the status of bio is always BLK_STS_RESOURCE.

Looks fine.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] block: cleanup bio_integrity_prep
  2023-07-25  5:18 ` [PATCH] block: cleanup bio_integrity_prep Jinyoung Choi
  2023-07-26  0:50   ` Martin K. Petersen
@ 2023-07-26  2:31   ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2023-07-26  2:31 UTC (permalink / raw)
  To: linux-block, linux-kernel, Jinyoung Choi; +Cc: hch, martin.petersen


On Tue, 25 Jul 2023 14:18:39 +0900, Jinyoung Choi wrote:
> If a problem occurs in the process of creating an integrity payload, the
> status of bio is always BLK_STS_RESOURCE.
> 
> 

Applied, thanks!

[1/1] block: cleanup bio_integrity_prep
      commit: 51d74ec9b62f5813767a60226acaf943e26e7d7a

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2023-07-26  2:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20230725051839epcms2p8e4d20ad6c51326ad032e8406f59d0aaa@epcms2p8>
2023-07-25  5:18 ` [PATCH] block: cleanup bio_integrity_prep Jinyoung Choi
2023-07-26  0:50   ` Martin K. Petersen
2023-07-26  2:31   ` Jens Axboe

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