mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 04:23:03 +02:00
block: fix dio leak on metadata mapping error
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: 2729a60bbf ("block: don't silently ignore metadata for sync read/write")
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Link: https://patch.msgid.link/20260720201057.1862857-3-kbusch@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
75ae18ca94
commit
702a2a9f3d
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user