mirror of
https://github.com/torvalds/linux.git
synced 2026-09-11 20:13:02 +02:00
netfs: Fix subreq ref leak
Fix a subrequest ref leak in netfs_unbuffered_write() in the event that
subreq->io_iter ends up zero length during preparation.
Fixes: a0b4c7a491 ("netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence")
Link: https://sashiko.dev/#/patchset/20260824120224.504575-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260827134304.2075713-6-dhowells@redhat.com
Acked-by: Paulo Alcantara <pc@manguebit.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
parent
741416a800
commit
3c30087e27
|
|
@ -121,8 +121,14 @@ static int netfs_unbuffered_write(struct netfs_io_request *wreq)
|
|||
}
|
||||
|
||||
iov_iter_truncate(&subreq->io_iter, wreq->len - wreq->transferred);
|
||||
if (!iov_iter_count(&subreq->io_iter))
|
||||
if (!iov_iter_count(&subreq->io_iter)) {
|
||||
pr_warn("netfs: Unexpected zero-length iterator R=%08x\n",
|
||||
wreq->debug_id);
|
||||
__set_bit(NETFS_SREQ_FAILED, &subreq->flags);
|
||||
netfs_write_subrequest_terminated(subreq, -EIO);
|
||||
wreq->error = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
subreq->len = netfs_limit_iter(&subreq->io_iter, 0,
|
||||
stream->sreq_max_len,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user