Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934434AbaFJAaY (ORCPT ); Mon, 9 Jun 2014 20:30:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58620 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934587AbaFJAWs (ORCPT ); Mon, 9 Jun 2014 20:22:48 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stanislav Kinsbursky , "J. Bruce Fields" , Weng Meiling Subject: [PATCH 3.4 60/88] nfsd: pass proper net to nfsd_destroy() from NFSd kthreads Date: Mon, 9 Jun 2014 17:25:10 -0700 Message-Id: <20140610002426.492757275@linuxfoundation.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <20140610002424.500996570@linuxfoundation.org> References: <20140610002424.500996570@linuxfoundation.org> User-Agent: quilt/0.63-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stanislav Kinsbursky commit 88c47666171989ed4c5b1a5687df09511e8c5e35 upstream. Since NFSd service is per-net now, we have to pass proper network context in nfsd_shutdown() from NFSd kthreads. The simplest way I found is to get proper net from one of transports with permanent sockets. Signed-off-by: Stanislav Kinsbursky Signed-off-by: J. Bruce Fields [wengmeiling: backport to 3.4: adjust context] Signed-off-by: Weng Meiling Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfssvc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -483,6 +483,8 @@ static int nfsd(void *vrqstp) { struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; + struct svc_xprt *perm_sock = list_entry(rqstp->rq_server->sv_permsocks.next, typeof(struct svc_xprt), xpt_list); + struct net *net = perm_sock->xpt_net; int err, preverr = 0; /* Lock module and set up kernel thread */ @@ -557,7 +559,7 @@ out: /* Release the thread */ svc_exit_thread(rqstp); - nfsd_destroy(&init_net); + nfsd_destroy(net); /* Release module */ mutex_unlock(&nfsd_mutex); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/