[PATCH] block: Trivial fix for blk_integrity_rq()

From: Martin K. Petersen
Date: Wed Jul 16 2008 - 16:10:29 EST

Fail integrity check gracefully when request does not have a bio
attached (BLOCK_PC).

Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>


PS. Jens is out for a couple of weeks. Hence the direct submission.

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -985,6 +985,9 @@ static inline int bdev_integrity_enabled

static inline int blk_integrity_rq(struct request *rq)
+ if (rq->bio == NULL)
+ return 0;
return bio_integrity(rq->bio);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/