]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
afs: Fix afs_fs_fetch_data() to subtract transferred from len
authorDavid Howells <dhowells@redhat.com>
Thu, 23 Jul 2026 11:34:47 +0000 (12:34 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 28 Jul 2026 07:20:44 +0000 (09:20 +0200)
Fix afs_fs_fetch_data() to subtract subreq->transferred from subreq->len
rather than adding it.

Fixes: f28fc2010d62 ("afs: Eliminate afs_read")
Link: https://sashiko.dev/#/patchset/20260713081022.2186481-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260723113452.566619-3-dhowells@redhat.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/afs/fsclient.c

index 626e1d37b91550429df2815da1d957eaa68f301f..1a3f186a6a113d5a18e1cf76e2792719def249ea 100644 (file)
@@ -487,7 +487,7 @@ void afs_fs_fetch_data(struct afs_operation *op)
        bp[2] = htonl(vp->fid.vnode);
        bp[3] = htonl(vp->fid.unique);
        bp[4] = htonl(lower_32_bits(subreq->start + subreq->transferred));
-       bp[5] = htonl(lower_32_bits(subreq->len   + subreq->transferred));
+       bp[5] = htonl(lower_32_bits(subreq->len   - subreq->transferred));
 
        call->fid = vp->fid;
        trace_afs_make_fs_call(call, &vp->fid);