diff mbox series

[6/8] afs: Fix the setting of the server responding flag

Message ID 20240923150756.902363-7-dhowells@redhat.com (mailing list archive)
State New
Headers show
Series netfs, afs, cifs: Miscellaneous fixes/changes | expand

Commit Message

David Howells Sept. 23, 2024, 3:07 p.m. UTC
In afs_wait_for_operation(), we set transcribe the call responded flag to
the server record that we used after doing the fileserver iteration loop -
but it's possible to exit the loop having had a response from the server
that we've discarded (e.g. it returned an abort or we started receiving
data, but the call didn't complete).

This means that op->server might be NULL, but we don't check that before
attempting to set the server flag.

Fixes: 98f9fda2057b ("afs: Fold the afs_addr_cursor struct in")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
---
 fs/afs/fs_operation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian Brauner Sept. 27, 2024, 8:07 a.m. UTC | #1
On Mon, 23 Sep 2024 16:07:50 +0100, David Howells wrote:
> In afs_wait_for_operation(), we set transcribe the call responded flag to
> the server record that we used after doing the fileserver iteration loop -
> but it's possible to exit the loop having had a response from the server
> that we've discarded (e.g. it returned an abort or we started receiving
> data, but the call didn't complete).
> 
> This means that op->server might be NULL, but we don't check that before
> attempting to set the server flag.
> 
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[6/8] afs: Fix the setting of the server responding flag
      https://git.kernel.org/vfs/vfs/c/830c1b2c1c28
diff mbox series

Patch

diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c
index 3546b087e791..428721bbe4f6 100644
--- a/fs/afs/fs_operation.c
+++ b/fs/afs/fs_operation.c
@@ -201,7 +201,7 @@  void afs_wait_for_operation(struct afs_operation *op)
 		}
 	}
 
-	if (op->call_responded)
+	if (op->call_responded && op->server)
 		set_bit(AFS_SERVER_FL_RESPONDING, &op->server->flags);
 
 	if (!afs_op_error(op)) {