Skip to content

Commit 42e3917

Browse files
tonanli66-codegregkh
authored andcommitted
afs: handle CB.InitCallBackState3 requests without a server record
commit f3cf725 upstream. The cache manager callback path now attaches the server record to an incoming call through the rxrpc peer's app data. That association is not guaranteed to exist for every callback request, and most callback handlers already tolerate that case. Make CB.InitCallBackState3 follow the same pattern by checking whether a server record was attached before using it. If the peer is not mapped to a server record, trace the request and ignore it, matching the existing behaviour for other unmatched callback requests. This keeps the callback handler consistent with the rest of the cache manager service and avoids depending on peer state that may not be available for a given request. Fixes: 40e8b52 ("afs: Use the per-peer app data provided by rxrpc") Cc: stable@kernel.org Reported-by: Yuan Tan <yuantan098@gmail.com> Reported-by: Yifan Wu <yifanwucs@gmail.com> Reported-by: Juefei Pu <tomapufckgml@gmail.com> Reported-by: Xin Liu <bird@lzu.edu.cn> Signed-off-by: Nan Li <tonanli66@gmail.com> Signed-off-by: Ren Wei <n05ec@lzu.edu.cn> Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260622090856.2746629-2-dhowells@redhat.com cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bd18d2c commit 42e3917

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fs/afs/cmservice.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
369369
return 0;
370370
}
371371

372+
if (!call->server) {
373+
trace_afs_cm_no_server_u(call, call->request);
374+
return 0;
375+
}
376+
372377
if (memcmp(call->request, &call->server->_uuid, sizeof(call->server->_uuid)) != 0) {
373378
pr_notice("Callback UUID does not match fileserver UUID\n");
374379
trace_afs_cm_no_server_u(call, call->request);

0 commit comments

Comments
 (0)