Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1900220pxb; Thu, 16 Sep 2021 19:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7FJj9VBx3Kb8/FVjD+L0y+Wgoiq0CFg0YrcrgQNbOJlXhOpJH1Zr0qPGXjyiKuFBs0f4m X-Received: by 2002:a6b:ec0b:: with SMTP id c11mr6665999ioh.207.1631846100404; Thu, 16 Sep 2021 19:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631846100; cv=none; d=google.com; s=arc-20160816; b=JpABWUpEHTdtnec4tDcWuYSibCTyn+i0w4WmKzoELmRz+KOng6aIvVIJqsc7YV/F6V xVehkEZENJ8WEzpDO8CSQFY600/KRZRA3LKEXj0FYhLKvj8PRgX5kDffoT+waAJiZ0p/ 5NR5kO2eyi9/1HMQRSQpbYNhfgetc5wSZ10LeO558IW4mY4szbhcVcarBm5+yTDpJi68 ZwAAwYfkKSPJkqpCKPWuSBOBPrblO9w8B9Ji/OYqupoLdOu8u44jwrwPlsZwQ4qP6ik4 Wi/fcFmvansI3yRF+EnFaodFY96JmL6gPk/9m25xPy3gIXX4lBpeLbYqNlpNjiN3gdxn bSqQ== 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=KQqM/A6LYLJgHMt3FU3zdeyMkjv9dVYus0pPXzQg/2I=; b=VfwnbCFF3ph/PQHa6KbsofQH7/pOEfUIGyFRdXxhI1740r1vlGhW4zca15hkJKAzjG jjy3Of7gCqQFwHWrpw6rvIn/JdlGyUmyOYZ6F1mh2JZ9kQ6M9myyo8WIFJRoy3RSkgIq /nFh/iDHDKFtLuipeKld1ykiPIRqxDqEBChNtzmSvRC9HoaHyV/xSyenRZPFNm2q5KiV ZRuBrF940xEgijWJZrRCNPazTJUb4bLC4D2fj1y+nNqgzJqUyK3QrSSMS2CmpZYxZv5B nUdQSLuo6ojzPhQC9aQ/4gkz40pI0sRNlxdohtV2ykggWem3FCdBI296d9pz+lF+5/fe 4UDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rl0sZbGX; 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 o12si4503873ilj.142.2021.09.16.19.34.48; Thu, 16 Sep 2021 19:35:00 -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=Rl0sZbGX; 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 S1352217AbhIPRUt (ORCPT + 99 others); Thu, 16 Sep 2021 13:20:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:39808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350246AbhIPRN4 (ORCPT ); Thu, 16 Sep 2021 13:13:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 33E50613A8; Thu, 16 Sep 2021 16:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810341; bh=qBZd2qfd0FZkQ9vTT+ukApEJxUsf/MSMV5Dy5aduhOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rl0sZbGXcVOZ0ooh8V2Ve3GvOOPfSBQkEX6tl6itBb+bLwBXcGVrW4NYFjF8jQLiS 3VZ7BwWo72RL/qRCqRhS1FO4Agk+FmQ6Wg7Ov7o8AXfqB54+QMl+kqww3ze3dslQP/ CDitk8JouZ9mjlW4kV4wRxPrQwek5Wn/DPujzubM= 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.14 106/432] NFSv4/pnfs: The layout barrier indicate a minimal value for the seqid Date: Thu, 16 Sep 2021 17:57:35 +0200 Message-Id: <20210916155814.361426159@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@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 615ac993b9f9..51049499e98f 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