From patchwork Tue Mar 1 01:34:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 600191 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 p21HTeTi031677 for ; Tue, 1 Mar 2011 17:30:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757123Ab1CAR37 (ORCPT ); Tue, 1 Mar 2011 12:29:59 -0500 Received: from mx2.netapp.com ([216.240.18.37]:39366 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757133Ab1CAR36 (ORCPT ); Tue, 1 Mar 2011 12:29:58 -0500 X-IronPort-AV: E=Sophos;i="4.62,248,1297065600"; d="scan'208";a="524725719" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 01 Mar 2011 09:29:58 -0800 Received: from localhost.localdomain (izzi01-lxp.hq.netapp.com [10.58.48.159] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id p21HTQG9003783; Tue, 1 Mar 2011 09:29:38 -0800 (PST) From: andros@netapp.com To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org, Andy Adamson Subject: [PATCH pNFS wave 3 Version 3 07/18] NFSv4.1: add MDS mount DS only check Date: Mon, 28 Feb 2011 20:34:12 -0500 Message-Id: <1298943263-2886-8-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.6.6 In-Reply-To: <1298943263-2886-7-git-send-email-andros@netapp.com> References: <1298943263-2886-1-git-send-email-andros@netapp.com> <1298943263-2886-2-git-send-email-andros@netapp.com> <1298943263-2886-3-git-send-email-andros@netapp.com> <1298943263-2886-4-git-send-email-andros@netapp.com> <1298943263-2886-5-git-send-email-andros@netapp.com> <1298943263-2886-6-git-send-email-andros@netapp.com> <1298943263-2886-7-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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 01 Mar 2011 17:30:01 +0000 (UTC) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 280d41f..d5c5bdf 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -1453,6 +1453,10 @@ static int nfs4_server_common_setup(struct nfs_server *server, BUG_ON(!server->nfs_client->rpc_ops); BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); + /* data servers support only a subset of NFSv4.1 */ + if (is_ds_only_client(server->nfs_client)) + return -EPROTONOSUPPORT; + fattr = nfs_alloc_fattr(); if (fattr == NULL) return -ENOMEM; diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 7a74740..5d84642 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -259,6 +259,13 @@ extern int nfs4_proc_destroy_session(struct nfs4_session *); extern int nfs4_init_session(struct nfs_server *server); extern int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo); + +static inline bool +is_ds_only_client(struct nfs_client *clp) +{ + return (clp->cl_exchange_flags & EXCHGID4_FLAG_MASK_PNFS) == + EXCHGID4_FLAG_USE_PNFS_DS; +} #else /* CONFIG_NFS_v4_1 */ static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *server) { @@ -276,6 +283,12 @@ static inline int nfs4_init_session(struct nfs_server *server) { return 0; } + +static inline bool +is_ds_only_client(struct nfs_client *clp) +{ + return false; +} #endif /* CONFIG_NFS_V4_1 */ extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[];