Skip to content

Commit

Permalink
block: Trivial fix for blk_integrity_rq()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin K. Petersen authored and Linus Torvalds committed Jul 16, 2008
1 parent 8df1b04 commit d442cc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d442cc4

Please sign in to comment.