Skip to content

Commit 4474635

Browse files
committed
afs: Don't get epoch from a server because it may be ambiguous
Don't get the epoch from a server, particularly one that we're looking up by UUID, as UUIDs may be ambiguous and may map to more than one server - so we can't draw any conclusions from it. Reported-by: Jeffrey Altman <jaltman@auristor.com> Signed-off-by: David Howells <dhowells@redhat.com>
1 parent e49c7b2 commit 4474635

2 files changed

Lines changed: 2 additions & 54 deletions

File tree

‎fs/afs/cmservice.c‎

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ bool afs_cm_incoming_call(struct afs_call *call)
118118
{
119119
_enter("{%u, CB.OP %u}", call->service_id, call->operation_ID);
120120

121-
call->epoch = rxrpc_kernel_get_epoch(call->net->socket, call->rxcall);
122-
123121
switch (call->operation_ID) {
124122
case CBCallBack:
125123
call->type = &afs_SRXCBCallBack;
@@ -149,49 +147,6 @@ bool afs_cm_incoming_call(struct afs_call *call)
149147
}
150148
}
151149

152-
/*
153-
* Record a probe to the cache manager from a server.
154-
*/
155-
static int afs_record_cm_probe(struct afs_call *call, struct afs_server *server)
156-
{
157-
_enter("");
158-
159-
if (test_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags) &&
160-
!afs_is_probing_server(server)) {
161-
if (server->cm_epoch == call->epoch)
162-
return 0;
163-
164-
if (!server->probe.said_rebooted) {
165-
pr_notice("kAFS: FS rebooted %pU\n", &server->uuid);
166-
server->probe.said_rebooted = true;
167-
}
168-
}
169-
170-
spin_lock(&server->probe_lock);
171-
172-
if (!test_and_set_bit(AFS_SERVER_FL_HAVE_EPOCH, &server->flags)) {
173-
server->cm_epoch = call->epoch;
174-
server->probe.cm_epoch = call->epoch;
175-
goto out;
176-
}
177-
178-
if (server->probe.cm_probed &&
179-
call->epoch != server->probe.cm_epoch &&
180-
!server->probe.said_inconsistent) {
181-
pr_notice("kAFS: FS endpoints inconsistent %pU\n",
182-
&server->uuid);
183-
server->probe.said_inconsistent = true;
184-
}
185-
186-
if (!server->probe.cm_probed || call->epoch == server->cm_epoch)
187-
server->probe.cm_epoch = server->cm_epoch;
188-
189-
out:
190-
server->probe.cm_probed = true;
191-
spin_unlock(&server->probe_lock);
192-
return 0;
193-
}
194-
195150
/*
196151
* Find the server record by peer address and record a probe to the cache
197152
* manager from a server.
@@ -210,7 +165,7 @@ static int afs_find_cm_server_by_peer(struct afs_call *call)
210165
}
211166

212167
call->server = server;
213-
return afs_record_cm_probe(call, server);
168+
return 0;
214169
}
215170

216171
/*
@@ -231,7 +186,7 @@ static int afs_find_cm_server_by_uuid(struct afs_call *call,
231186
}
232187

233188
call->server = server;
234-
return afs_record_cm_probe(call, server);
189+
return 0;
235190
}
236191

237192
/*

‎fs/afs/internal.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ struct afs_call {
124124
spinlock_t state_lock;
125125
int error; /* error code */
126126
u32 abort_code; /* Remote abort ID or 0 */
127-
u32 epoch;
128127
unsigned int max_lifespan; /* Maximum lifespan to set if not 0 */
129128
unsigned request_size; /* size of request data */
130129
unsigned reply_max; /* maximum size of reply */
@@ -491,12 +490,10 @@ struct afs_server {
491490
#define AFS_SERVER_FL_MAY_HAVE_CB 8 /* May have callbacks on this fileserver */
492491
#define AFS_SERVER_FL_IS_YFS 9 /* Server is YFS not AFS */
493492
#define AFS_SERVER_FL_NO_RM2 10 /* Fileserver doesn't support YFS.RemoveFile2 */
494-
#define AFS_SERVER_FL_HAVE_EPOCH 11 /* ->epoch is valid */
495493
#define AFS_SERVER_FL_NEEDS_UPDATE 12 /* Fileserver address list is out of date */
496494
atomic_t ref; /* Object refcount */
497495
atomic_t active; /* Active user count */
498496
u32 addr_version; /* Address list version */
499-
u32 cm_epoch; /* Server RxRPC epoch */
500497
unsigned int debug_id; /* Debugging ID for traces */
501498

502499
/* file service access */
@@ -515,15 +512,11 @@ struct afs_server {
515512
struct {
516513
unsigned int rtt; /* RTT as ktime/64 */
517514
u32 abort_code;
518-
u32 cm_epoch;
519515
short error;
520516
bool responded:1;
521517
bool is_yfs:1;
522518
bool not_yfs:1;
523519
bool local_failure:1;
524-
bool cm_probed:1;
525-
bool said_rebooted:1;
526-
bool said_inconsistent:1;
527520
} probe;
528521
};
529522

0 commit comments

Comments
 (0)