From patchwork Tue Nov 30 20:31:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 369001 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAUMTd9f024662 for ; Tue, 30 Nov 2010 22:29:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754223Ab0K3W3H (ORCPT ); Tue, 30 Nov 2010 17:29:07 -0500 Received: from mx2.netapp.com ([216.240.18.37]:26569 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753999Ab0K3W3F (ORCPT ); Tue, 30 Nov 2010 17:29:05 -0500 X-IronPort-AV: E=Sophos;i="4.59,282,1288594800"; d="scan'208";a="489187655" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 30 Nov 2010 14:29:05 -0800 Received: from localhost.localdomain (verdan01-lxp.hq.netapp.com [10.58.48.142] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id oAUMT3Zl011288; Tue, 30 Nov 2010 14:29:05 -0800 (PST) From: andros@netapp.com To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org, Andy Adamson Subject: [PATCH 1/5] NFS dont free shared socket on backchannel put xprt Date: Tue, 30 Nov 2010 15:31:07 -0500 Message-Id: <1291149071-2026-2-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.6.6 In-Reply-To: <1291149071-2026-1-git-send-email-andros@netapp.com> References: <1291149071-2026-1-git-send-email-andros@netapp.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Nov 2010 22:29:40 +0000 (UTC) diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 93a8b3b..023a9eb 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c @@ -193,6 +193,9 @@ nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt) serv->bc_xprt = bc_xprt; xprt->bc_serv = serv; + /* socket is shared with the fore channel */ + set_bit(XPT_SHARE_SOCK, &bc_xprt->xpt_flags); + INIT_LIST_HEAD(&serv->sv_cb_list); spin_lock_init(&serv->sv_cb_lock); init_waitqueue_head(&serv->sv_cb_waitq); diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index aea0d43..600c669 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h @@ -62,6 +62,7 @@ struct svc_xprt { #define XPT_DETACHED 10 /* detached from tempsocks list */ #define XPT_LISTENER 11 /* listening endpoint */ #define XPT_CACHE_AUTH 12 /* cache auth info */ +#define XPT_SHARE_SOCK 13 /* fore and back channel share socket */ struct svc_pool *xpt_pool; /* current pool iff queued */ struct svc_serv *xpt_server; /* service for transport */ diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index ea2ff78..8c4d9ad 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -128,7 +128,8 @@ static void svc_xprt_free(struct kref *kref) if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags)) svcauth_unix_info_release(xprt); put_net(xprt->xpt_net); - xprt->xpt_ops->xpo_free(xprt); + if (!test_bit(XPT_SHARE_SOCK, &xprt->xpt_flags)) + xprt->xpt_ops->xpo_free(xprt); module_put(owner); }