提交 84b6c83d 编写于 作者: O Olga Kornievskaia 提交者: Yang Yingliang

NFSv4.2: support EXCHGID4_FLAG_SUPP_FENCE_OPS 4.2 EXCHANGE_ID flag

stable inclusion
from linux-4.19.155
commit 3c040b924988be85e99819dd48c1f3130ae683cc

--------------------------------

commit 8c39076c upstream.

RFC 7862 introduced a new flag that either client or server is
allowed to set: EXCHGID4_FLAG_SUPP_FENCE_OPS.

Client needs to update its bitmask to allow for this flag value.

v2: changed minor version argument to unsigned int
Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
CC: <stable@vger.kernel.org>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2ff025c9
...@@ -7591,9 +7591,11 @@ int nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, ...@@ -7591,9 +7591,11 @@ int nfs4_proc_secinfo(struct inode *dir, const struct qstr *name,
* both PNFS and NON_PNFS flags set, and not having one of NON_PNFS, PNFS, or * both PNFS and NON_PNFS flags set, and not having one of NON_PNFS, PNFS, or
* DS flags set. * DS flags set.
*/ */
static int nfs4_check_cl_exchange_flags(u32 flags) static int nfs4_check_cl_exchange_flags(u32 flags, u32 version)
{ {
if (flags & ~EXCHGID4_FLAG_MASK_R) if (version >= 2 && (flags & ~EXCHGID4_2_FLAG_MASK_R))
goto out_inval;
else if (version < 2 && (flags & ~EXCHGID4_FLAG_MASK_R))
goto out_inval; goto out_inval;
if ((flags & EXCHGID4_FLAG_USE_PNFS_MDS) && if ((flags & EXCHGID4_FLAG_USE_PNFS_MDS) &&
(flags & EXCHGID4_FLAG_USE_NON_PNFS)) (flags & EXCHGID4_FLAG_USE_NON_PNFS))
...@@ -7988,7 +7990,8 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred, ...@@ -7988,7 +7990,8 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred,
if (status != 0) if (status != 0)
goto out; goto out;
status = nfs4_check_cl_exchange_flags(resp->flags); status = nfs4_check_cl_exchange_flags(resp->flags,
clp->cl_mvops->minor_version);
if (status != 0) if (status != 0)
goto out; goto out;
......
...@@ -136,6 +136,8 @@ ...@@ -136,6 +136,8 @@
#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000 #define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000
#define EXCHGID4_FLAG_CONFIRMED_R 0x80000000 #define EXCHGID4_FLAG_CONFIRMED_R 0x80000000
#define EXCHGID4_FLAG_SUPP_FENCE_OPS 0x00000004
/* /*
* Since the validity of these bits depends on whether * Since the validity of these bits depends on whether
* they're set in the argument or response, have separate * they're set in the argument or response, have separate
...@@ -143,6 +145,7 @@ ...@@ -143,6 +145,7 @@
*/ */
#define EXCHGID4_FLAG_MASK_A 0x40070103 #define EXCHGID4_FLAG_MASK_A 0x40070103
#define EXCHGID4_FLAG_MASK_R 0x80070103 #define EXCHGID4_FLAG_MASK_R 0x80070103
#define EXCHGID4_2_FLAG_MASK_R 0x80070107
#define SEQ4_STATUS_CB_PATH_DOWN 0x00000001 #define SEQ4_STATUS_CB_PATH_DOWN 0x00000001
#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002 #define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册