Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1699526pxb; Thu, 16 Sep 2021 13:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzenE9+e6uC657gcPbm1pYAw2W6wLR86juv9IjHiSEivTph/497OKuzC5JUJE2PaV/jpkm X-Received: by 2002:a17:906:79d5:: with SMTP id m21mr5349853ejo.437.1631823555771; Thu, 16 Sep 2021 13:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631823555; cv=none; d=google.com; s=arc-20160816; b=BzI33DedC80A/tIvrA6D+c+VJjWvZe0+aZ/CHx7ZYVb1V0isfjWDa7Tee3SMBsGpXN rr73LSv2P0/XuEK3J4C1YkQ9bzabUlQzkq3b9JWi1fmO8kOVLH0E2YELrxsO5pgbxJsP 0/6P7goJqJopqqN9CeN/4iLnmgLxYk0llg8Ifn6WX1BPGlUevwPiPlbVuE4Fwo+nIyWB NMy2oQiUiakMjFdwsWpDUxqKmF/GysISHeAYPSC7IGlZj9O6hkL7KE82/qaQuK1861ae 7kb49La23PG29yrSAExOHBaG00v3B/BpE8J3pIP/5SDhP3x0ijc5+uxWGUL/XFOujWAj S3kA== 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=PsSdCb2s5Tjf+CMyeTuosHKDAOJXedKblCna0yggKWE=; b=JRxDv7Owwu07kYti5kMK1Aal1ikNzfnm2bZIAL/lmW5d24gDiK8Ujy9S8eeYdJy/9T RnXNGU53y9PNW3smmjAL52+BTUWAY2aSPW+uqUO4NqJ4Qm5Zzd7Tva5hZFXJR2FTZSo+ kzUDgIQlHizgNHJOdrY1jHWCohMC36O/Hi9JCyOwZY/cUcwm1c+sfxpOyrhqztg2p09F 4vOyQzgZvNexqRMpM+Qz90KAejL15vKqj/8Gfsre0Wwjbrc8BXBVmaQXBK7lCjlUPcBJ kqKcMdofmL2k+gmm3ffda57QVUEch3KEwhxIHRD60lZZz3Dx9Hp+jc6WdWJ/KOWfb2ZF 0+7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FPMdmdU6; 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 a9si4979279edj.313.2021.09.16.13.18.51; Thu, 16 Sep 2021 13:19:15 -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=FPMdmdU6; 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 S241138AbhIPQTS (ORCPT + 99 others); Thu, 16 Sep 2021 12:19:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:47920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234492AbhIPQJl (ORCPT ); Thu, 16 Sep 2021 12:09:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6EA8E6120F; Thu, 16 Sep 2021 16:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808487; bh=xEFKJ8NxsTJKFjIvmvRIhpmNlTmdkUqZs1UxJSWe3XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FPMdmdU6FdHL5so40uJ4QZnmhbf5KtTmgNTXBNuxsTsqEp54AnKhi5WZ+QCxZPpX2 TwEQTX2/eG99C3bDG+KPeLJfGBKCqkh4Ax9kPPUwQ7x4G/lLz48xFeHpeZ+3OMXdCP ZcIRjQXKTE8eYOq3QRBKHHPgUdRwQE+4Gj2K8hos= 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.10 077/306] NFSv4/pnfs: The layout barrier indicate a minimal value for the seqid Date: Thu, 16 Sep 2021 17:57:02 +0200 Message-Id: <20210916155756.684191320@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 741b6283ac9c..5370e082aded 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