Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1900218pxb; Thu, 16 Sep 2021 19:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7dWzvd1pWAe/pZoZ3vtTSJD6VGUdJsyiX7cLJ3uMEnzFQDGlXhp5lDB06wBRVvVKh1mmo X-Received: by 2002:a92:130a:: with SMTP id 10mr5945748ilt.186.1631846100403; 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=a5WzajnvtIObqe16IsIQVi+8+vMxKCUccNvPN6IdWlRNn0zFeKDUQxQ6RnXuvT9KA6 2fACuq6a+wz+uNWBfmXQSgNq60U9Nlqm1jJwdz0qx7uduJ7H5aCv+9b3tUPBGcFY8QLd NYp8S9puYBL/L4t+64YnLlNdcxnzT7/4lTS8iRoTKDL3z5LWOS8PJKH7o0jg3bY+Uei3 ua/tdUTKP0MtLJy2fHwxt8bGgPLWuauP2iy013N/7CQ5DOHDwttTnlI92sv6a9d7vfnA bNUWwWmMG7Hm4w5s8AH2YXC8o8LzwwgBfisyYfueUiSq9t9xiVspgiYDQLBoTbNLAgwl jp+Q== 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=K8ig5z2QewH3t1I9MriZTQQHwvCV+JJWJ+HMVAZj38w=; b=TOUoCWDowGXxX40k9X5lBi4qcZvT+40vJJjnxNEYB8u3bwtVN5UARGL6Qn3y0iXY9e hVr0fy4QTHwDY0LWr0At8V7220iHXl3IJnfn10rR7Q2fLgJzl2V82Fqdkmp+Z8q9eo8s Jz2k8c8ZD5dAqj5ZBYbYhTKcadn/OL01TfGdJI0nQzxHiAkoVR/7aUcBl//VGn8IDoH5 YYLqnvPHXvka+6gLC1Wh6+u37kOnlk7llW3ZbsLIDZffKRKvdEwr1KibZwZP1rZV6OwM gU6qhG8W/qhz2IUnSOOX4oIs336T49bN2hiNhLlnD6utpY/MWq7FX0TCVhF6uy3efOf7 UH3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ybmPcfzL; 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 d8si4668193ila.45.2021.09.16.19.34.49; 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=ybmPcfzL; 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 S241790AbhIPRUv (ORCPT + 99 others); Thu, 16 Sep 2021 13:20:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350548AbhIPRN4 (ORCPT ); Thu, 16 Sep 2021 13:13:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5392961B55; Thu, 16 Sep 2021 16:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810338; bh=Y4UIgB3891sM8ME1fxlQT60gDFlCPHdkCSYW5MO6J/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ybmPcfzL0q03Fx2Vcf9MRsu4DxW69urP+fdRsUSPBRw5XiVVy4viOty3zCmZHW+gA RhAmD4OnLgShgAV5eoROw35qvJK8T74LBeAPKN1HeH2cjnspB3NXkxun6MG7XM9nzk jriWi2dQXkYnBZmvJVzvY+7Nq3pm3wy+6+Vg7Rx8= 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 105/432] NFSv4/pNFS: Always allow update of a zero valued layout barrier Date: Thu, 16 Sep 2021 17:57:34 +0200 Message-Id: <20210916155814.329967605@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 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 da5cacad6979..615ac993b9f9 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