Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp804167pxb; Tue, 3 Nov 2020 13:01:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJsQnHtVzAvNh4veCGB5hbAKm/YTJ9Crfbgv/s+hTsY+esnI0+DRozrOTc7BSjCELU6LLg X-Received: by 2002:a17:907:42a1:: with SMTP id nf1mr22705950ejb.135.1604437273480; Tue, 03 Nov 2020 13:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437273; cv=none; d=google.com; s=arc-20160816; b=1E+gs8qJH9QdJbcJcjT52q4pwn387epC2m7/wbBbRrEs9NGKJX/8lN+4d9QAFbH7kP T+D7/Pix866UpQDidX5s29t/3bM+UX5V2QOA9IYmgaBPSIGe1m7GnYaZjcWDru0Hsh+L ZlC2QZ5EHI/FBNsukKiEUToy7xhLBHzaZI/82dsTkR0EAp4pf5LX4dB/ydgKdkJcSbHt dyVzFZ6uTbQseqBS6EoBJws6I3h109gW46wXpYH9kKxmAMSAKUA6PMKPT4NgU6S4c033 UG1g1LCZ76YcEYXLnr0dbamwAmgCgPdi8T+bx9tH6OFiGwwvz92Rb0YA+9occysdjGFr lsRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fkKqsZCBjZU7gea29dlIrHyFHj8py/qq6qpxE5+wQpU=; b=rRJcsLAq6Hox8STHLE4ziiPzo86TQqOxTASRLlA0h5A1qo2MCYJKbKtPkYgZf5NrgB JeQGu5b8HpBNYrMSqvhl/bKJzA8aNtZejo5IjJpth1LgRWck+I5DP4AKHZUzbkf9LqvX 1IwgrF0vX6DwDNp42D/VId69GevZa5764Ey4XhTWGKqY86FhQ67bacRg8OYeVAMMDDY/ aoThnUrqKzGMJDlR5/AYF2RQG3J0mqti2Im7P/Ly/0hcVLmgA24yQX21oSIzTfbA71r9 NmWLKnJwZCTz3rkSU2GtUJGDHwi6Zp1PC0XOla1NpdFAYc0FUwXNmcjK6zPsFITYQyHs 7FgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R9COULfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si2059ejv.189.2020.11.03.13.00.50; Tue, 03 Nov 2020 13:01:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R9COULfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730604AbgKCU7G (ORCPT + 99 others); Tue, 3 Nov 2020 15:59:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:33872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733058AbgKCU7D (ORCPT ); Tue, 3 Nov 2020 15:59:03 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD49F2053B; Tue, 3 Nov 2020 20:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437142; bh=eM6w+HbpO30a66/rFp2xskdZ1nI9nPo89xz2YciUCNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R9COULfr+0oMrbdzhGaDgVPUqB1JZwi+YW1lsHecQqblgnX+1u7eVkf4oLYphMoZ2 IpaqaW87jGh2/O8KXP42avvdZBxiN9R2nnI2vJlE8Q7BjX5xinF2XBnngyCeBoCywE e0mSntlrfAqjQEvNw019k8ZV3ofvOCFMkHimBREg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Anna Schumaker Subject: [PATCH 5.4 165/214] NFSv4.2: support EXCHGID4_FLAG_SUPP_FENCE_OPS 4.2 EXCHANGE_ID flag Date: Tue, 3 Nov 2020 21:36:53 +0100 Message-Id: <20201103203306.244619789@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Olga Kornievskaia commit 8c39076c276be0b31982e44654e2c2357473258a 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: Olga Kornievskaia CC: Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4proc.c | 9 ++++++--- include/uapi/linux/nfs4.h | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7859,9 +7859,11 @@ int nfs4_proc_secinfo(struct inode *dir, * both PNFS and NON_PNFS flags set, and not having one of NON_PNFS, PNFS, or * 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; if ((flags & EXCHGID4_FLAG_USE_PNFS_MDS) && (flags & EXCHGID4_FLAG_USE_NON_PNFS)) @@ -8274,7 +8276,8 @@ static int _nfs4_proc_exchange_id(struct if (status != 0) 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) goto out; --- a/include/uapi/linux/nfs4.h +++ b/include/uapi/linux/nfs4.h @@ -136,6 +136,8 @@ #define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000 #define EXCHGID4_FLAG_CONFIRMED_R 0x80000000 + +#define EXCHGID4_FLAG_SUPP_FENCE_OPS 0x00000004 /* * Since the validity of these bits depends on whether * they're set in the argument or response, have separate @@ -143,6 +145,7 @@ */ #define EXCHGID4_FLAG_MASK_A 0x40070103 #define EXCHGID4_FLAG_MASK_R 0x80070103 +#define EXCHGID4_2_FLAG_MASK_R 0x80070107 #define SEQ4_STATUS_CB_PATH_DOWN 0x00000001 #define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002