Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2723558pxb; Sun, 24 Jan 2021 18:25:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcsSU1ux+2OxYKksjX0lQ214Co1Xz55EqZtuGKogOakl5xiCxUYhHXavR3wn00TjeiiyTS X-Received: by 2002:a17:907:932:: with SMTP id au18mr1979094ejc.91.1611541505035; Sun, 24 Jan 2021 18:25:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611541505; cv=none; d=google.com; s=arc-20160816; b=rl4ErOUdFMKHgyA6iBAOBm+e9XB8AitbLB+lnmWsVHHH6VXgVyL/63JOo773OkWVCn pcwxNGxZya0gzJ5Wmx/xjDmu1Dq2/niaTg9tg3H1MjoqhqJY+cyysFbkYdzVVbxpMhl9 olnk8ju1k8Fa6j5MsZyJ5SKIqjPKQqe6SXrbvBrIW2NgFigHCGNpdtosfSQcML+0KiGh wpnnCeOzWIfvOTdemTs68dxibSUuQqRvmS0bIy8A2WxUdtNeBoftdNRLh1/aga2Q5lDD SUPAYyi1b8/U7mIs+QX1u7aCClsvaeJqkqbeSAxzWqddob4ckDvpa52fyvzLXpbRprvq 45nA== 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 :message-id:date:subject:to:from:dkim-signature; bh=Ej6Fbkzn81FwuX9VXZYo4kZY/0fiIG3UmUPdw5M29TI=; b=bUlFgJh/+pTjsMpxI8skyS4W48qv7OtLIH9dTxFDf34Pw2kGhDg332ZlyOHghmKfB4 R/sAtzm8S5bQMSsE9xh0gOH55rYaOlJJnCOrf8XnKtjJFhrxs/UK0dXFj9ipk4f5pnsO ZmoG2FldDmjdWMsW8CJQHWp7RFmEXFx/mNCccedfjW6U9/NidoCgzF6r2poggbxIu3vl K39MVTv/e2uYFD8UjERkmOPwC+M0X6m5njRivujfVNeUoagKX7F6mw77zSfhdpfWnb8s 44l2pK7dqwoBoWV9qWdJ22EoCXUStzfv9dcrdu/3T7KxEK4pqdlhZCl4fXQiqeCmsbcL gQRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lP5cuMNP; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p7si325679ejf.627.2021.01.24.18.24.34; Sun, 24 Jan 2021 18:25:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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=@kernel.org header.s=k20201202 header.b=lP5cuMNP; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbhAYCWy (ORCPT + 99 others); Sun, 24 Jan 2021 21:22:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:42398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbhAYBzY (ORCPT ); Sun, 24 Jan 2021 20:55:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4AE79207AB for ; Mon, 25 Jan 2021 01:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611539677; bh=Kq8s+A5QRTVAgmNA6JsSa0lAbw1Txw9em9g6cujZzJY=; h=From:To:Subject:Date:From; b=lP5cuMNPz3ocT0W7ZZ7gDuqgNa+6kiJxuy2aYh8ZdYf+zTE3Tz4rCKtyRVhRR3XOF m76gnbdr7+17TQqMnj/9uuBdtrrXdEgi0G91KzwfvyUUlhOyRpsgpfFgY7X4k7iHZr Ohvx8eD7x2tsEt7RfXheje9tFgK493sSwRc/hZV3s/MoNiIsIsKrfWoajcepEMhk+A ah05MQE9UCa0RsZ9kFkdddPDOmHeO+LeYrt4ETGLzE3nXSqyrSjUrJT96jDKfaCa4q cw0B2jcaWJv7oasTwpOgCjMfDmbUPOZlghdMtmkL0Uf3CuVIRMFxg5KFrpMg46d8pa HF2JhdK4gY0Fg== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 1/4] pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process() Date: Sun, 24 Jan 2021 20:54:32 -0500 Message-Id: <20210125015435.45979-1-trondmy@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If the server returns a new stateid that does not match the one in our cache, then pnfs_layout_process() will leak the layout segments returned by pnfs_mark_layout_stateid_invalid(). Fixes: 9888d837f3cf ("pNFS: Force a retry of LAYOUTGET if the stateid doesn't match our cache") Signed-off-by: Trond Myklebust --- fs/nfs/pnfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 4f274f21c4ab..e68e6f8cb407 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -2417,6 +2417,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) spin_unlock(&ino->i_lock); lseg->pls_layout = lo; NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg); + pnfs_free_lseg_list(&free_me); return ERR_PTR(-EAGAIN); } -- 2.29.2