]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cifs: Fix missing credit release on failure in cifs_issue_read()
authorDavid Howells <dhowells@redhat.com>
Thu, 2 Jul 2026 08:25:00 +0000 (09:25 +0100)
committerSteve French <stfrench@microsoft.com>
Thu, 2 Jul 2026 14:16:03 +0000 (09:16 -0500)
Fix missing release of credits in the failure path in cifs_issue_read()
lest retrying the subreq just overwrites the credits value.

Fixes: 69c3c023af25 ("cifs: Implement netfslib hooks")
Link: https://sashiko.dev/#/patchset/20260608145432.681865-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/file.c

index 8b25d6c9ec5e9eb2cfda42552b81328c3911b118..5a25635bc62a951018c601690b0cc294ceb47601 100644 (file)
@@ -241,6 +241,7 @@ static void cifs_issue_read(struct netfs_io_subrequest *subreq)
        return;
 
 failed:
+       add_credits_and_wake_if(rdata->server, &rdata->credits, 0);
        subreq->error = rc;
        netfs_read_subreq_terminated(subreq);
 }