Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2266104pxb; Thu, 11 Feb 2021 08:15:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfWRjERWRaZYugCp3oAhjA4FOvQXXp/aK9Cpfbt9ynP5YbdgZqa5aSs3yb/UMplGbeGj/S X-Received: by 2002:a17:906:6c92:: with SMTP id s18mr9098926ejr.22.1613060142916; Thu, 11 Feb 2021 08:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613060142; cv=none; d=google.com; s=arc-20160816; b=dogJt6T/RYuNKqeJLe1lLHiwPvm+O/lVCIzPezigLns4fDPUamuzUb5HgzWDShi1/n zdbJJ26pzYXXxMGBDNOYtAHaEdr/iokhyoEhG5EJvLlVrfXtKeYTYOVryR8QLH17DK+v fg3tlU5F9lp7Gd4u0UWz/tS2NsnbXETwJPOHDvKAxkoWqKnF/R4kkJwY6tUE0zSsda7l 0qE5c620kXZOAVNymLTFY6TXHBhhMiSk7H3Iq5o2JAvmlYbY7PGA+xX5VcCdIDyJEtDG XdcBs9hlC73/gGd0aAjvcf6CIkiyaf9E28OoJMXK/nNRMVwhubKZnxywzqMnbySuTnfx LDGg== 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=sNl23ZPXahSPZ8DM0CkN5fzBbyXzRVMyjY5FqQKXMZI=; b=jqCzNSKGbDaOt7nt+Kjj1dbEs1X80SJRoAZ2UGex+XkEe/JJlDzXD19LvUmny0NVl5 4g1Pe9g6+D09SzNo9M8e7iHbL6aDSSq1/kyOZ54jNP2Dd+9gxSZDFR4HD/6VL0X8Itox X8IqkEkppwKP0dqX3cWabYwc0qOqCaaMsd7BXyNCVsuoKkSh2iZg5AvCDkND6KB1km7t PSHCuXHx/N7fXgwb7zGZv+e5DLUEsgmfAXvdju/fge+z1nogPPMVaCdHF6YI4yx8H8NS lLJFOiPWYwZveYom8tijJqkCJNu5wEHIyLCurPJQqyw1azU5znXve9/n5xndL+KzPQud Dr7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JqSEDac7; 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 kd11si4096430ejc.396.2021.02.11.08.15.09; Thu, 11 Feb 2021 08:15:42 -0800 (PST) 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=JqSEDac7; 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 S231483AbhBKQOa (ORCPT + 99 others); Thu, 11 Feb 2021 11:14:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:53540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230445AbhBKPWi (ORCPT ); Thu, 11 Feb 2021 10:22:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4972E64F3C; Thu, 11 Feb 2021 15:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613056051; bh=8E6WZmFizPDa+uxrj+vSD1bp5LLb1Q3wsf5WVP8fcQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JqSEDac7r9wXxGJlr4GoRQtkXs5ShZiLbEYIZtaSH/H/DhrMBXQ4pzVg9RmFM+K5n CBmgIARDI9HtoLJ6e6S1yhsdglrxspettfglUnnriiRs5pTCPam40axdqy6xO/Ql/a 4ffq2brqP7wJaOsVtSBMsEFV3P3QOlIQsuGLFI1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Sasha Levin Subject: [PATCH 4.19 09/24] pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process() Date: Thu, 11 Feb 2021 16:02:43 +0100 Message-Id: <20210211150148.170803970@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210211150147.743660073@linuxfoundation.org> References: <20210211150147.743660073@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 08bd8dbe88825760e953759d7ec212903a026c75 ] If the server returns a new stateid that does not match the one in our cache, then try to return the one we hold instead of just invalidating it on the client side. This ensures that both client and server will agree that the stateid is invalid. Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/pnfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 4b165aa5a2561..55965e8e9a2ed 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -2301,7 +2301,13 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) * We got an entirely new state ID. Mark all segments for the * inode invalid, and retry the layoutget */ - pnfs_mark_layout_stateid_invalid(lo, &free_me); + struct pnfs_layout_range range = { + .iomode = IOMODE_ANY, + .length = NFS4_MAX_UINT64, + }; + pnfs_set_plh_return_info(lo, IOMODE_ANY, 0); + pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs, + &range, 0); goto out_forget; } -- 2.27.0