Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp543283pxj; Thu, 20 May 2021 15:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBTf4TG53r3gRHvrqwximbp/Wv77qidmFMiOA9Svm20mXJmvc6Qa0n2KM+ACHoDIO3LjSB X-Received: by 2002:a17:906:7c4b:: with SMTP id g11mr6895730ejp.461.1621550884479; Thu, 20 May 2021 15:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621550884; cv=none; d=google.com; s=arc-20160816; b=OjtRKIxXFB149NEjtRPNcvjOCcnaYz9QLbHNCPWYGUaXw0vxbz1Dgbpltxrcbvelar ibesk4ijOKzcPuS/X7b2RihBlwhd8w5SdawNLHCJ3BmVA5FmuztQnQiwBZ6MhEA1BJPv JhWauMZKDYNBbx/pRgHQEyBQ6V+ce1KnRZaTsSXOvlR+uqQ64mIPoaTUhTbFlSf9VfNw b2/Bt7+4/VqgIrQKl7OUESFJ+82meoFiHjARyaO7AwAcZdopUAf/VMEOwj+0BjuT8hAh IMFIfjCtuIK08FJNxaYCsboWFNxM+lBdC6fp0WdH8onXaxMnBTtV27baF+5dvsYqsC4T f2DQ== 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=UAIHoO66J11JRp2HU9B9HeRSR3WGC8HN5cXYzCNg10M=; b=J2lyAuQgzIPwQWTTjzk1XQMBrxSGJqVUvNeIhWKPt56rf4jLnkzGXhZ0VM0An9nvTI UkuOEjwnGDaxaA38I68em3opXcEEl234zXzYIaFriLdPaSOflLrWTlcusbUd/d4wh+ir Cfow4DB6i7aFujDJEKxAXeOUvtm26TGAZmX0qHSCbSCuF0p+Zg93JgBar8M0fvCuRkDm 5at8Dm11UdfFBTFlCwCLNN++H9VkAawpO/Umoa8dMBeCwacYO1Y+GLaUQMsv7ds+0vGN qr65KEHkGrpNKI/t/spKKKLO9PwzZnOF1N2rz9cBEskgKXjNqDKke5qEmjsBPZgxxOfD vmeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mvk6sCpD; 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 gf1si3801136ejb.318.2021.05.20.15.47.40; Thu, 20 May 2021 15:48:04 -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=mvk6sCpD; 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 S237934AbhETLHQ (ORCPT + 99 others); Thu, 20 May 2021 07:07:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:48094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238014AbhETKs0 (ORCPT ); Thu, 20 May 2021 06:48:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDE606141D; Thu, 20 May 2021 09:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504723; bh=TdqnW6tppbjS5iPvbuOsdbm4sZAxcDxsTGeuTpgehFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mvk6sCpDnaiRdbJt5t/2+Rb73T9taZXTbL/Qf3QSpms0ORIQgq732cD+pyoW8Sx7W HZ2xisSk52HTpjH3Y2mWNInx60LGYHZNIELRsoVq06x+sb2/9J1CtffN/4B+k7IJ4p tuMcjex44nyFpHQg1vIN3rnpyqxiLWzoMcRbZC5E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust Subject: [PATCH 4.9 052/240] NFSv4: Dont discard segments marked for return in _pnfs_return_layout() Date: Thu, 20 May 2021 11:20:44 +0200 Message-Id: <20210520092110.420550292@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 commit de144ff4234f935bd2150108019b5d87a90a8a96 upstream. If the pNFS layout segment is marked with the NFS_LSEG_LAYOUTRETURN flag, then the assumption is that it has some reporting requirement to perform through a layoutreturn (e.g. flexfiles layout stats or error information). Fixes: 6d597e175012 ("pnfs: only tear down lsegs that precede seqid in LAYOUTRETURN args") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/pnfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1088,7 +1088,7 @@ _pnfs_return_layout(struct inode *ino) pnfs_get_layout_hdr(lo); empty = list_empty(&lo->plh_segs); pnfs_clear_layoutcommit(ino, &tmp_list); - pnfs_mark_matching_lsegs_invalid(lo, &tmp_list, NULL, 0); + pnfs_mark_matching_lsegs_return(lo, &tmp_list, NULL, 0); if (NFS_SERVER(ino)->pnfs_curr_ld->return_range) { struct pnfs_layout_range range = {