Skip to content

Commit 97d8e8e

Browse files
dhowellsbrauner
authored andcommitted
netfs: Fix ref leak on inserted extra subreq in write retry
The write-retry algorithm will insert extra subrequests into the list if it can't get sufficient capacity to split the range that needs to be retried into the sequence of subrequests it currently has (for instance, if the cifs credit pool has fewer credits available than it did when the range was originally divided). However, the allocator furnishes each new subreq with 2 refs and then another is added for resubmission, causing one to be leaked. Fix this by replacing the ref-getting line with a neutral trace line. Fixes: 288ace2 ("netfs: New writeback implementation") Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/[email protected] Tested-by: Steve French <[email protected]> Reviewed-by: Paulo Alcantara <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 09623e3 commit 97d8e8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/netfs/write_retry.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static void netfs_retry_write_stream(struct netfs_io_request *wreq,
153153
trace_netfs_sreq_ref(wreq->debug_id, subreq->debug_index,
154154
refcount_read(&subreq->ref),
155155
netfs_sreq_trace_new);
156-
netfs_get_subrequest(subreq, netfs_sreq_trace_get_resubmit);
156+
trace_netfs_sreq(subreq, netfs_sreq_trace_split);
157157

158158
list_add(&subreq->rreq_link, &to->rreq_link);
159159
to = list_next_entry(to, rreq_link);

0 commit comments

Comments
 (0)