* [PATCH] block: Ensure we only enable integrity metadata for reads and writes
@ 2014-04-09 2:59 Martin K. Petersen
0 siblings, 0 replies; only message in thread
From: Martin K. Petersen @ 2014-04-09 2:59 UTC (permalink / raw)
To: axboe; +Cc: linux-scsi, Martin K. Petersen
From: "Martin K. Petersen" <martin.petersen@oracle.com>
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>
---
fs/bio-integrity.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 183f1ae74675..812920dbf5f9 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-09 2:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 2:59 [PATCH] block: Ensure we only enable integrity metadata for reads and writes Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).