@@ -138,49 +138,6 @@ bool afs_cm_incoming_call(struct afs_call *call)
138138 }
139139}
140140
141- /*
142- * Find the server record by peer address and record a probe to the cache
143- * manager from a server.
144- */
145- static int afs_find_cm_server_by_peer (struct afs_call * call )
146- {
147- struct sockaddr_rxrpc srx ;
148- struct afs_server * server ;
149- struct rxrpc_peer * peer ;
150-
151- peer = rxrpc_kernel_get_call_peer (call -> net -> socket , call -> rxcall );
152-
153- server = afs_find_server (call -> net , peer );
154- if (!server ) {
155- trace_afs_cm_no_server (call , & srx );
156- return 0 ;
157- }
158-
159- call -> server = server ;
160- return 0 ;
161- }
162-
163- /*
164- * Find the server record by server UUID and record a probe to the cache
165- * manager from a server.
166- */
167- static int afs_find_cm_server_by_uuid (struct afs_call * call ,
168- struct afs_uuid * uuid )
169- {
170- struct afs_server * server ;
171-
172- rcu_read_lock ();
173- server = afs_find_server_by_uuid (call -> net , call -> request );
174- rcu_read_unlock ();
175- if (!server ) {
176- trace_afs_cm_no_server_u (call , call -> request );
177- return 0 ;
178- }
179-
180- call -> server = server ;
181- return 0 ;
182- }
183-
184141/*
185142 * Clean up a cache manager call.
186143 */
@@ -322,10 +279,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
322279
323280 if (!afs_check_call_state (call , AFS_CALL_SV_REPLYING ))
324281 return afs_io_error (call , afs_io_error_cm_reply );
325-
326- /* we'll need the file server record as that tells us which set of
327- * vnodes to operate upon */
328- return afs_find_cm_server_by_peer (call );
282+ return 0 ;
329283}
330284
331285/*
@@ -349,18 +303,10 @@ static void SRXAFSCB_InitCallBackState(struct work_struct *work)
349303 */
350304static int afs_deliver_cb_init_call_back_state (struct afs_call * call )
351305{
352- int ret ;
353-
354306 _enter ("" );
355307
356308 afs_extract_discard (call , 0 );
357- ret = afs_extract_data (call , false);
358- if (ret < 0 )
359- return ret ;
360-
361- /* we'll need the file server record as that tells us which set of
362- * vnodes to operate upon */
363- return afs_find_cm_server_by_peer (call );
309+ return afs_extract_data (call , false);
364310}
365311
366312/*
@@ -373,8 +319,6 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
373319 __be32 * b ;
374320 int ret ;
375321
376- _enter ("" );
377-
378322 _enter ("{%u}" , call -> unmarshall );
379323
380324 switch (call -> unmarshall ) {
@@ -421,9 +365,13 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
421365 if (!afs_check_call_state (call , AFS_CALL_SV_REPLYING ))
422366 return afs_io_error (call , afs_io_error_cm_reply );
423367
424- /* we'll need the file server record as that tells us which set of
425- * vnodes to operate upon */
426- return afs_find_cm_server_by_uuid (call , call -> request );
368+ if (memcmp (call -> request , & call -> server -> _uuid , sizeof (call -> server -> _uuid )) != 0 ) {
369+ pr_notice ("Callback UUID does not match fileserver UUID\n" );
370+ trace_afs_cm_no_server_u (call , call -> request );
371+ return 0 ;
372+ }
373+
374+ return 0 ;
427375}
428376
429377/*
@@ -455,7 +403,7 @@ static int afs_deliver_cb_probe(struct afs_call *call)
455403
456404 if (!afs_check_call_state (call , AFS_CALL_SV_REPLYING ))
457405 return afs_io_error (call , afs_io_error_cm_reply );
458- return afs_find_cm_server_by_peer ( call ) ;
406+ return 0 ;
459407}
460408
461409/*
@@ -533,7 +481,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)
533481
534482 if (!afs_check_call_state (call , AFS_CALL_SV_REPLYING ))
535483 return afs_io_error (call , afs_io_error_cm_reply );
536- return afs_find_cm_server_by_peer ( call ) ;
484+ return 0 ;
537485}
538486
539487/*
@@ -593,7 +541,7 @@ static int afs_deliver_cb_tell_me_about_yourself(struct afs_call *call)
593541
594542 if (!afs_check_call_state (call , AFS_CALL_SV_REPLYING ))
595543 return afs_io_error (call , afs_io_error_cm_reply );
596- return afs_find_cm_server_by_peer ( call ) ;
544+ return 0 ;
597545}
598546
599547/*
@@ -667,9 +615,5 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)
667615
668616 if (!afs_check_call_state (call , AFS_CALL_SV_REPLYING ))
669617 return afs_io_error (call , afs_io_error_cm_reply );
670-
671- /* We'll need the file server record as that tells us which set of
672- * vnodes to operate upon.
673- */
674- return afs_find_cm_server_by_peer (call );
618+ return 0 ;
675619}
0 commit comments