Skip to content

Commit

Permalink
block: Ensure we only enable integrity metadata for reads and writes
Browse files Browse the repository at this point in the history
We'd occasionally attempt to generate protection information for flushes
and other requests with a zero payload. Make sure we only attempt to
enable integrity for reads and writes.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Martin K. Petersen authored and Jens Axboe committed Apr 9, 2014
1 parent 0bc6997 commit e69f18f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/bio-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ static int bdev_integrity_enabled(struct block_device *bdev, int rw)
*/
int bio_integrity_enabled(struct bio *bio)
{
if (!bio_is_rw(bio))
return 0;

/* Already protected? */
if (bio_integrity(bio))
return 0;
Expand Down

0 comments on commit e69f18f

Please sign in to comment.