]> git.baikalelectronics.ru Git - kernel.git/commitdiff
afs: Fix to actually set AFS_SERVER_FL_HAVE_EPOCH
authorDavid Howells <dhowells@redhat.com>
Fri, 24 Apr 2020 10:21:14 +0000 (11:21 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 24 Apr 2020 15:32:49 +0000 (16:32 +0100)
AFS keeps track of the epoch value from the rxrpc protocol to note (a) when
a fileserver appears to have restarted and (b) when different endpoints of
a fileserver do not appear to be associated with the same fileserver
(ie. all probes back from a fileserver from all of its interfaces should
carry the same epoch).

However, the AFS_SERVER_FL_HAVE_EPOCH flag that indicates that we've
received the server's epoch is never set, though it is used.

Fix this to set the flag when we first receive an epoch value from a probe
sent to the filesystem client from the fileserver.

Fixes: cacf55ead0eb ("afs: Probe multiple fileservers simultaneously")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/cmservice.c

index 6765949b3aab61cedc3167852c4fb1d1c3199bd1..380ad5ace7cfd54c09463a5e44e5c63c9c21b7ec 100644 (file)
@@ -169,7 +169,7 @@ static int afs_record_cm_probe(struct afs_call *call, struct afs_server *server)
 
        spin_lock(&server->probe_lock);
 
-       if (!test_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
+       if (!test_and_set_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
                server->cm_epoch = call->epoch;
                server->probe.cm_epoch = call->epoch;
                goto out;