Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp648589pxb; Tue, 2 Feb 2021 14:18:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqDOM/9E1b4zhjK29SrvnvmG9Gs24V+deckybIDRlcJompg6mnJA+Shub79zNqA7QES6ho X-Received: by 2002:a17:906:d8b5:: with SMTP id qc21mr165126ejb.62.1612304323808; Tue, 02 Feb 2021 14:18:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304323; cv=none; d=google.com; s=arc-20160816; b=jixs7E6juNuVt4H6Pp2CzUOQ7lim02uNzMIR0DqPermYSS8TgebvFUGYlWtkEfR2Q4 mLlKm3Zi6Sd73dAyVaZb/wmWHN6NTuDK/n3RJA8xFQsIIvIeb7ftbBL6HYkRXe4mRWmA XXyFiZyvp9E0GZX9+A0Kae8Z4F8TIXgb8tA8vVzT9S2O8JGdudw9hlqUNSmC12yi0cdK zZgeDg6Z/oPu0Kdipm/xV1IL9r1gNjYielOalxEa3HUz4EVBRleh4c9tYFqlcu6dSfBS p602FVIC72/tui0GnuQtwIJpJWgzG3E3acNNmlr1PD7pC6kvjZwYyCeVsV+gTnhv8hik iyZQ== 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=w2IdkujTQmsz+0tI+ZHrZwPAt1PVyoV9wkqnKxqleS8=; b=ew8U4VYji0Kt/igeYkn6EXrmmp5NqzcDrsvLcytVfPdN81ifdYu5Xm4oi8DFAfPNrA 9pGmJ0z2wdxXduKcySgWbg2gU3xm1q3OwmAXYAVpKaESRrmCwrMucw533bg8nvycnKDL wZEgBAWXzXE2V3OdMxCMajw0YHPqYVO+U+LtMRc2KCbWKdxSR2o8IQx9BsqzXY5SqeHj kJcj8pWgEygfLecTi2OxpSgrBsSm9umLlHSSdJ+aEiKyYASUM+ODf4VEuiWF6erPoSlD badihEY6/rNEQJFZHiwGBcTefKsoBs9c7daRe61KmXCe+/lVRp/KRFBNo+cMnzDW8xot 3YKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cIm7eIDQ; 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 y19si50158edu.188.2021.02.02.14.18.19; Tue, 02 Feb 2021 14:18:43 -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=cIm7eIDQ; 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 S233482AbhBBN6B (ORCPT + 99 others); Tue, 2 Feb 2021 08:58:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:41022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232640AbhBBNvo (ORCPT ); Tue, 2 Feb 2021 08:51:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6536064FBD; Tue, 2 Feb 2021 13:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273410; bh=onaZ8XFYYkEufPgP5rHs26W5zhQS+nX8oYg1XWr25TE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIm7eIDQHPpoLlI7tcz/5/jwuiKc5CvmBDnRUIRx1C3hg+tpr99L6mFn/5jDz/8Fn xfx/brzO/9aECSKMX5fO9H9fqZeVHrl9TQ3pMXSTpl5LddZ/M8nAdlXPuivgO00Nq5 kNfmqAg6OO7Y8Z13mNGBCKT8pvCZOD4WqzkLrgbc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Sasha Levin Subject: [PATCH 5.10 096/142] pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process() Date: Tue, 2 Feb 2021 14:37:39 +0100 Message-Id: <20210202133001.674846954@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@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 814b84971388cd5fb182f2e914265b3827758455 ] 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 Signed-off-by: Sasha Levin --- fs/nfs/pnfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 471bfa273dade..426877f72441e 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -2418,6 +2418,7 @@ out_forget: 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.27.0