[Devel] [PATCH 1/2] Reverted commit bab81d0231d ("nfs: protect callback execution against ")

Vasily Averin vvs at virtuozzo.com
Mon Dec 17 10:20:30 MSK 2018


Reason of PSBM-75751 was found incorrectly,
patch is not required.

Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 fs/nfs/callback.c          | 20 --------------------
 include/linux/sunrpc/svc.h |  1 -
 2 files changed, 21 deletions(-)

diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index feffccf44d08..0beb27579be8 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -99,8 +99,6 @@ nfs4_callback_up(struct svc_serv *serv)
 }
 
 #if defined(CONFIG_NFS_V4_1)
-static DEFINE_MUTEX(nfs41_callback_mutex);
-
 /*
  * The callback service for NFSv4.1 callbacks
  */
@@ -119,12 +117,6 @@ nfs41_callback_svc(void *vrqstp)
 		if (try_to_freeze())
 			continue;
 
-		mutex_lock(&nfs41_callback_mutex);
-		if (kthread_should_stop()) {
-			mutex_unlock(&nfs41_callback_mutex);
-			return 0;
-		}
-
 		prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE);
 		spin_lock_bh(&serv->sv_cb_lock);
 		if (!list_empty(&serv->sv_cb_list)) {
@@ -137,10 +129,8 @@ nfs41_callback_svc(void *vrqstp)
 			error = bc_svc_process(serv, req, rqstp);
 			dprintk("bc_svc_process() returned w/ error code= %d\n",
 				error);
-			mutex_unlock(&nfs41_callback_mutex);
 		} else {
 			spin_unlock_bh(&serv->sv_cb_lock);
-			mutex_unlock(&nfs41_callback_mutex);
 			schedule();
 			finish_wait(&serv->sv_cb_waitq, &wq);
 		}
@@ -149,13 +139,6 @@ nfs41_callback_svc(void *vrqstp)
 	return 0;
 }
 
-static void nfs41_callback_down_net(struct svc_serv *serv, struct net *net)
-{
-	mutex_lock(&nfs41_callback_mutex);
-	bc_svc_flush_queue_net(serv, net);
-	mutex_unlock(&nfs41_callback_mutex);
-}
-
 /*
  * Bring up the NFSv4.1 callback service
  */
@@ -167,7 +150,6 @@ nfs41_callback_up(struct svc_serv *serv)
 	INIT_LIST_HEAD(&serv->sv_cb_list);
 	spin_lock_init(&serv->sv_cb_lock);
 	init_waitqueue_head(&serv->sv_cb_waitq);
-	serv->svc_cb_down_net = nfs41_callback_down_net;
 	rqstp = svc_prepare_thread(serv, &serv->sv_pools[0], NUMA_NO_NODE);
 	dprintk("--> %s return %d\n", __func__, PTR_ERR_OR_ZERO(rqstp));
 	return rqstp;
@@ -260,8 +242,6 @@ static void nfs_callback_down_net(u32 minorversion, struct svc_serv *serv, struc
 		return;
 
 	dprintk("NFS: destroy per-net callback data; net=%p\n", net);
-	if (serv->svc_cb_down_net)
-		serv->svc_cb_down_net(serv, net);
 	svc_shutdown_net(serv, net);
 }
 
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index c04ef8022019..fe70ff076ad5 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -108,7 +108,6 @@ struct svc_serv {
 	wait_queue_head_t	sv_cb_waitq;	/* sleep here if there are no
 						 * entries in the svc_cb_list */
 	struct svc_xprt		*sv_bc_xprt;	/* callback on fore channel */
-	void			(*svc_cb_down_net)(struct svc_serv *serv, struct net *net);
 #endif /* CONFIG_SUNRPC_BACKCHANNEL */
 };
 
-- 
2.17.1



More information about the Devel mailing list