Received: by 10.213.65.68 with SMTP id h4csp249223imn; Fri, 23 Mar 2018 03:55:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELvgoIf3uVT7xCOOLdUrE5sE+DtlmCD4kNHkOCJgS9fO7fboCzQRLxrUrxzv2z0de3V96cNi X-Received: by 2002:a17:902:930c:: with SMTP id bc12-v6mr14965181plb.18.1521802517600; Fri, 23 Mar 2018 03:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521802517; cv=none; d=google.com; s=arc-20160816; b=UW4dIl+88vqXtrv40Fr03qp0CikFhMaZU04EDMNbvfwwYq8gVsHa8xsWBi8YYAzfsN bzhNZrDsEEAUil6xLG6yD3yBokuaXP5v/5JGy09Nwuttd9WQepCvusamLqnXyuD6F8i3 qa31QdQyv7FfJiVmc4xWDg6kGN7FjJEHCfwJdMGAei3b3N+YkRMwmCHG02b2omZszlev mr9QVDLg9kAogUyTZVKfTztK5lfTWi5rbP9InBnprDGk3Zd8uqXiuBxMF6eKxAjQ0KYP qjcVVnidsWi8cg7ShDe5am34MmpUQs8BRJwpvGnWf9GzxeYFc1rCthy+GwEbrxDb/tJ2 YLrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Bu8DxgSe+AFTJ3LXRokFtnzlytSNm+rt3O9SoR5A2+0=; b=I12etgYkEnL2ErDYmSyyXvc1MdFIbPeBW3TcoV96X6adrjo1XalyMpZFw72Hy49kcA 1ozrbjuBPbr31CJX8LjZicEaqXV5Wbkcvu5OZPWdpwNOxIO6Ba/LTV9Gh/C9WmAKdgW5 g6yhMIEnUuzgyM9OfudR313JB08/KOwIxmIuQJ8oPqoTnJ9ZTU4A9j7aR5l1QizHne+a KUTLVYK6pIW5XW1zOrTgImVlgqZPiyFWmwCao+ERiVpvnvYuFGgl4tGBuaIsSnjK+6gp Sa/x4NQAetX+y0Bivub42xKGK1tY1syxevMwbnbSZrPygIfS1eGIPqaVihdP0xfmHRSq QGKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y14-v6si7475977plr.110.2018.03.23.03.55.02; Fri, 23 Mar 2018 03:55:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752962AbeCWKxA (ORCPT + 99 others); Fri, 23 Mar 2018 06:53:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44998 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755934AbeCWKNx (ORCPT ); Fri, 23 Mar 2018 06:13:53 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 88F171224; Fri, 23 Mar 2018 10:13:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Coddington , Trond Myklebust , Sasha Levin Subject: [PATCH 4.4 27/97] NFS: Fix missing pg_cleanup after nfs_pageio_cond_complete() Date: Fri, 23 Mar 2018 10:54:14 +0100 Message-Id: <20180323094159.137676612@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Coddington [ Upstream commit 43b7d964ed30dbca5c83c90cb010985b429ec4f9 ] Commit a7d42ddb3099727f58366fa006f850a219cce6c8 ("nfs: add mirroring support to pgio layer") moved pg_cleanup out of the path when there was non-sequental I/O that needed to be flushed. The result is that for layouts that have more than one layout segment per file, the pg_lseg is not cleared, so we can end up hitting the WARN_ON_ONCE(req_start >= seg_end) in pnfs_generic_pg_test since the pg_lseg will be pointing to that previously-flushed layout segment. Signed-off-by: Benjamin Coddington Fixes: a7d42ddb3099 ("nfs: add mirroring support to pgio layer") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/nfs/pagelist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -1273,8 +1273,10 @@ void nfs_pageio_cond_complete(struct nfs mirror = &desc->pg_mirrors[midx]; if (!list_empty(&mirror->pg_list)) { prev = nfs_list_entry(mirror->pg_list.prev); - if (index != prev->wb_index + 1) - nfs_pageio_complete_mirror(desc, midx); + if (index != prev->wb_index + 1) { + nfs_pageio_complete(desc); + break; + } } } }