block: Dedicated error code fixups
diff mbox

Message ID 20170613150733.9245-1-bart.vanassche@sandisk.com
State New
Headers show

Commit Message

Bart Van Assche June 13, 2017, 3:07 p.m. UTC
This patch fixes two sparse warnings introduced by the "dedicated
error codes for the block layer V3" patch series. These changes
have not been tested.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
---
 block/bio.c    | 4 ++--
 block/t10-pi.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Martin K. Petersen June 13, 2017, 3:09 p.m. UTC | #1
Bart,

> This patch fixes two sparse warnings introduced by the "dedicated
> error codes for the block layer V3" patch series. These changes
> have not been tested.

LGTM.
Christoph Hellwig June 16, 2017, 3:45 p.m. UTC | #2
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Jens Axboe June 16, 2017, 3:47 p.m. UTC | #3
On 06/13/2017 09:07 AM, Bart Van Assche wrote:
> This patch fixes two sparse warnings introduced by the "dedicated
> error codes for the block layer V3" patch series. These changes
> have not been tested.

Added, thanks Bart.

Patch
diff mbox

diff --git a/block/bio.c b/block/bio.c
index 7a5c8ed27f42..0e36ca5407b5 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1817,8 +1817,8 @@  void bio_endio(struct bio *bio)
 	}
 
 	if (bio->bi_bdev && bio_flagged(bio, BIO_TRACE_COMPLETION)) {
-		trace_block_bio_complete(bdev_get_queue(bio->bi_bdev),
-					 bio, bio->bi_status);
+		trace_block_bio_complete(bdev_get_queue(bio->bi_bdev), bio,
+					 blk_status_to_errno(bio->bi_status));
 		bio_clear_flag(bio, BIO_TRACE_COMPLETION);
 	}
 
diff --git a/block/t10-pi.c b/block/t10-pi.c
index 350b3cbcf9e5..3416dadf7b15 100644
--- a/block/t10-pi.c
+++ b/block/t10-pi.c
@@ -91,7 +91,7 @@  static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter,
 				       "(rcvd %u)\n", iter->disk_name,
 				       (unsigned long long)
 				       iter->seed, be32_to_cpu(pi->ref_tag));
-				return -EILSEQ;
+				return BLK_STS_PROTECTION;
 			}
 			break;
 		case 3: