提交 e69f18f0 编写于 作者: M Martin K. Petersen 提交者: Jens Axboe

block: Ensure we only enable integrity metadata for reads and writes

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: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 0bc69973
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册