summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2008-07-16 16:09:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-16 14:51:41 -0700
commitd442cc44c0db56e84ef6aa244a88427d2efe06cd (patch)
tree4358ff09af75c2e102f75eb08a9b55b446db6a07
parent8df1b049bc86495a40e421abc8b9cf1dda32f0d9 (diff)
downloadop-kernel-dev-d442cc44c0db56e84ef6aa244a88427d2efe06cd.zip
op-kernel-dev-d442cc44c0db56e84ef6aa244a88427d2efe06cd.tar.gz
block: Trivial fix for blk_integrity_rq()
Fail integrity check gracefully when request does not have a bio attached (BLOCK_PC). Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/blkdev.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 32a441b..88d6808 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -985,6 +985,9 @@ static inline int bdev_integrity_enabled(struct block_device *bdev, int rw)
static inline int blk_integrity_rq(struct request *rq)
{
+ if (rq->bio == NULL)
+ return 0;
+
return bio_integrity(rq->bio);
}
OpenPOWER on IntegriCloud