From: Keith Busch A failed integrity mapping holds a dio reference, so we need to go through the full bio ending in case there were previously submitted bio's in the sequence. Fixes: 2729a60bbfb92 ("block: don't silently ignore metadata for sync read/write") Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch --- block/fops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/fops.c b/block/fops.c index 0827bb884d473..0098a90a956e1 100644 --- a/block/fops.c +++ b/block/fops.c @@ -238,8 +238,10 @@ static ssize_t __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, } if (iocb->ki_flags & IOCB_HAS_METADATA) { ret = bio_integrity_map_iter(bio, iocb->private); - if (unlikely(ret)) - goto fail; + if (unlikely(ret)) { + bio_endio_status(bio, errno_to_blk_status(ret)); + break; + } } if (is_read) { -- 2.53.0-Meta