Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1735947pxb; Thu, 16 Sep 2021 14:21:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOjGnhsXH9d36fvXzcZB8kkV2LDULYNxhiPTY2TVkexoa8HqU+70vIUrV61D2u0+tkWMvX X-Received: by 2002:a5e:c905:: with SMTP id z5mr5975651iol.33.1631827280052; Thu, 16 Sep 2021 14:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631827280; cv=none; d=google.com; s=arc-20160816; b=FmZMmxYQnYuhmgrNYHxSezwBOwzMIweZ7MzINRqfZRExGIxO7Y+m9O4hX3YSX6Wqlb T1qMihZybVZO6GHZ2Bo49YeDGKtL2VFPDr7er8kltrzKFF//bHVT00XqF8XdN8jGzhsX xsT9nvS8BMcWxCJv5AE6UBEH1op5BfCgKmoR1nJMseQaaVKEAUZbrYBLwooEcpLz5fDs tjXHqUCdpGrnf2XaZ/mYf1Do/5YAxD3FMhql1qNOYYDf3+VWdxPo15n8GqQKnnLgI8fR x54xuzYXs/G+VFkd8rVlQ1//w+BFBdFobK8jZYYqvfVQPsxtuS3x4oiGtx+OduLWe7nP s/ww== 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=rXnduGfPPm8rpwZ3CUErSrYGSp1BxtM8qn+xn2bKea4=; b=sgP5SlGIMltprUlOt2ordzBkuclfoGpdbly7u0B9J0I9+c1X3TPK1zoZGfR0VnRQNc vIczy8f1GDVuPdMfrUYLeo1jeUDb9MR+06dDsi4Ysj1EyKl5iJqDX8J1M1UydMA1Tt7h +4Qp/qaTYiRiqFXf6yVNu1oCL9c884SewqmIZaj0L5n8M/wRASx6ekYcKwXKLzp1s8Jo EmxfgbDnJjOlnA4LGpXSp+IRJuF3hCB/2Ep5Fx8quV15mKTJg6VwVcL+mjuxi/DT85z1 JFE0CJPE6V/PISx3/momDKdzs4L6xjlCa1BgbGtcBwgG6cqeTi1IBDeOSfLyQKv6tO08 yUZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="n7Wo5us/"; 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=pass (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 w7si3968853jad.86.2021.09.16.14.21.06; Thu, 16 Sep 2021 14:21:20 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b="n7Wo5us/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242472AbhIPQlr (ORCPT + 99 others); Thu, 16 Sep 2021 12:41:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:44760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240887AbhIPQfT (ORCPT ); Thu, 16 Sep 2021 12:35:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DD6F461401; Thu, 16 Sep 2021 16:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809279; bh=i7wc2uRKQVQ6nQLuaNp9hIehMq1xIm5c5aaokRAIFrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n7Wo5us/KWP7+bROay4B9098NxVgUq3NX0HK7rUzByY9oZT0g99Fax5EAM041mBg7 ouBt86nl9/NqTu09kTwy2wcHqP+6XxxiOIRmbIyjGjQa3x+rIvunXX9lNPbm1aPQSo ranlXBwkySH/5HN4iwVrUV1Yt0iONRxk9qr0sL4g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [PATCH 5.13 096/380] NFSv4/pnfs: The layout barrier indicate a minimal value for the seqid Date: Thu, 16 Sep 2021 17:57:33 +0200 Message-Id: <20210916155807.301331981@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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: Trond Myklebust [ Upstream commit d6236a98b3bab07c0a1455fd1ab46f79c3978cdc ] The intention of the layout barrier is to ensure that we do not update the layout to match an older value than the current expectation. Fix the test in pnfs_layout_stateid_blocked() to reflect that it is legal for the seqid of the stateid to match that of the barrier. Fixes: aa95edf309ef ("NFSv4/pnfs: Fix the layout barrier update") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/pnfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 6cc5ae51fd80..28350d62b9bd 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1004,7 +1004,7 @@ pnfs_layout_stateid_blocked(const struct pnfs_layout_hdr *lo, { u32 seqid = be32_to_cpu(stateid->seqid); - return !pnfs_seqid_is_newer(seqid, lo->plh_barrier) && lo->plh_barrier; + return lo->plh_barrier && pnfs_seqid_is_newer(lo->plh_barrier, seqid); } /* lget is set to 1 if called from inside send_layoutget call chain */ -- 2.30.2