Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1528607pxb; Thu, 16 Sep 2021 09:17:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvbTacUN7O5Pq1AogMu9MGU6+SxtmwVZH9vtNbLok11KpUyBUt4BUr4WcYxBGUAi0E+6sx X-Received: by 2002:a05:6e02:1aa2:: with SMTP id l2mr2638678ilv.179.1631809049887; Thu, 16 Sep 2021 09:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809049; cv=none; d=google.com; s=arc-20160816; b=BRQaAg2JnuqPJRogT1SVcCWWT41VBmcEjV3XKhB7N13o91EpDZahApt3nUAFZjVoMk NyMInxTimhCFVPSzX3IG68W9CG/I27b93SSk3FzaLQclqmWcQFyyqrYJQzRmJAnPkQiW 3Mfh4DHLZ/IOzUovKA2QhgAncZNHvmBnVDEZrZ3yXas+r/3P0xKLmz9hauzFEBsKjC8O /mzTfWhExfhwwOWHVFe5iL9oNvnJHaFoYJ23VHV9qsMMlmPlVimp9poSnmzHiVp86gZR k+A2A73aA1bOsbFiQrI/yusUhgKBSODieg5NB8qFWukGX993uzPUvZv6xbB830D7c2zY jZOA== 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=/dSVSRwi0fXY1+IdLTtDFIsAkSnKYZOKtpsH4XOo8p0=; b=0t3OcEowfUPoXPOUVMKXZYytU5g+2ymqZtEQL3Ndd5a/0NHPU5rgkH6o6aG7HUlFYm 0AQ2OBvrucygyhjVjYAV9t3yxoZHAOF6nD+kmse7BN3qLk0dSPwQ4ZcQkaXjTq4EN4pZ yAvDkj6Dg6zNplav3dRP1IP/gxAe6A146p2BAaTu9aXmkfZlm/qih7G2qcv9WiPYBApD SaoU8aVrwhbB2IpcQ8Cs0nz0whxe7GNMvop55aee6z8eMXI29O2Vkxd2LA2Tk/4YrNK+ goQoEj5v43tmVzPPNhkePw1CtuQHV5Gmip/6MI/e6Chy34OOsig3SVLSicbcnheLrq2c DFDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ufpSpMl; 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 x13si3215870ile.180.2021.09.16.09.17.16; Thu, 16 Sep 2021 09:17:29 -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=2ufpSpMl; 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 S239857AbhIPQQg (ORCPT + 99 others); Thu, 16 Sep 2021 12:16:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:48850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234735AbhIPQJi (ORCPT ); Thu, 16 Sep 2021 12:09:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8EC2361251; Thu, 16 Sep 2021 16:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808485; bh=EVDUO2oUt5rJvRUrkuVen1JdDbTj1AOdqi0F3CLini0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ufpSpMlEJtqThVd0yBQpxoDBGpt1wUiQDnSHK2Eer9UhFFrB9XxHyfxLb6UCFZQt rCU/iYEDhOcgpxWaQlv/BMsh9pGVgZaw2Q6OcMRnIjgvN3re355zddFUTKnaKUY4vd XDFHqD9QEk6ns+kmji/vJsmbOQlH/xW8KNLtDpAE= 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 076/306] NFSv4/pNFS: Always allow update of a zero valued layout barrier Date: Thu, 16 Sep 2021 17:57:01 +0200 Message-Id: <20210916155756.646922134@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 45baadaad7bf9183651fb74f4ed1200da48505a5 ] A zero value for the layout barrier indicates that it has been cleared (since seqid '0' is an illegal value), so we should always allow it to be updated. Fixes: d29b468da4f9 ("pNFS/NFSv4: Improve rejection of out-of-order layouts") 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 fef0537d15b0..741b6283ac9c 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -335,7 +335,7 @@ static bool pnfs_seqid_is_newer(u32 s1, u32 s2) static void pnfs_barrier_update(struct pnfs_layout_hdr *lo, u32 newseq) { - if (pnfs_seqid_is_newer(newseq, lo->plh_barrier)) + if (pnfs_seqid_is_newer(newseq, lo->plh_barrier) || !lo->plh_barrier) lo->plh_barrier = newseq; } -- 2.30.2