Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1102261pxa; Thu, 20 Aug 2020 02:30:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+vNmsrfbjC2puIIauIYHuT5cKo9yXKJmRkWpG/l+F3FT0a5gc4yU70bDPuYoYCkFtZgR7 X-Received: by 2002:a05:6402:c81:: with SMTP id cm1mr1929086edb.256.1597915841429; Thu, 20 Aug 2020 02:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597915841; cv=none; d=google.com; s=arc-20160816; b=gySs3UcolNujcYKzNwJ6bTMzkb5nKoOvJkvO4LSjlmmoh16f9XTlfkKozfUJfQNCjQ myG6YOLpYwpOpFYDz+ZvxbzF5NEZALfu9BiFQBsrFD2W4XIx8HP5X57cIo4FdOpVidYD Xe7J4sJ1tsX2mUi68lSufvX5Hoxa2dSfDVO8LdhN/ouaW/KQ/UgfMSNibmAfVzQepjJi W6ZYv/l6wn+c7Wf3899FqgkkhoBxN5dpWi5ync48pOYq8POtl+Euu21K16QnQYAvxcgb CFV5ZXDzt3CkRUUaT7s9bJ4spOmp51gIcJgXUWZOBSTTKL/8l5ffmKZ8oUTY11/qYCfH mZEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qi7jalkYvj60nC96iDb+JFXcwRmQ8rREybllsgR57JY=; b=VNE+VGNQR41Smvt1F5Avl+0V96Rh8eEWlN3n+I/FAYo4MSd+L4FoHvWWwGiO30k1Vs mYsUIIY+ZSLce4G9I6mkWw+2WYKvtlkQl2wRQlPK6wROkB08P+4Gk/a6cg5Cbvjxtdqx CZLjAYxMDFo0rmUAlsg7SpM93GTxuZElAr1It3oWrASk02NCF5OO6LsLwtlvW050sdOo ISBdOM++ib6UvCFsT0qIBXtAd8X8pt63JW48yjvQl/0m2A1WT16IaAw0CQjv0ykvBvjl +R7h5qqDhVwQZ57iRPJFnRSPXrdnD5YGXjGpN0lVYerzUhkzf/ibvEboJtRcd9z9g1OM r2cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wCAQy8Qk; 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=fail (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 di8si1059869edb.395.2020.08.20.02.30.17; Thu, 20 Aug 2020 02:30:41 -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=@kernel.org header.s=default header.b=wCAQy8Qk; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbgHTJ3r (ORCPT + 99 others); Thu, 20 Aug 2020 05:29:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:36966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbgHTJ22 (ORCPT ); Thu, 20 Aug 2020 05:28:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 872A32173E; Thu, 20 Aug 2020 09:28:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915704; bh=jfRmqQXtOm3jQLhGdzHpq2QpxhkScsukKFbXDwwPES8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wCAQy8QkYVcojUCCbHmIWBmCyR3n/64GmpBPK/jEbeWqjcSCcNNkQbotqxTXFW2Mf zCKzDPCHTO0XWgvyn9UgGfq37oPNX7kUpyWanXoSApmmb0JIvS5mtaSpb7v1Dzgb4A GzUSFiWF64lhxdgRN89BFjkftkzU1mMdaV5Qvj74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Gruenbacher Subject: [PATCH 5.8 106/232] gfs2: Fix refcount leak in gfs2_glock_poke Date: Thu, 20 Aug 2020 11:19:17 +0200 Message-Id: <20200820091617.956813624@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Gruenbacher commit c07bfb4d8fa1ee11c6d18b093d0bb6c8832d3626 upstream. In gfs2_glock_poke, make sure gfs2_holder_uninit is called on the local glock holder. Without that, we're leaking a glock and a pid reference. Fixes: 9e8990dea926 ("gfs2: Smarter iopen glock waiting") Cc: stable@vger.kernel.org # v5.8+ Signed-off-by: Andreas Gruenbacher Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/glock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -790,9 +790,11 @@ static void gfs2_glock_poke(struct gfs2_ struct gfs2_holder gh; int error; - error = gfs2_glock_nq_init(gl, LM_ST_SHARED, flags, &gh); + gfs2_holder_init(gl, LM_ST_SHARED, flags, &gh); + error = gfs2_glock_nq(&gh); if (!error) gfs2_glock_dq(&gh); + gfs2_holder_uninit(&gh); } static bool gfs2_try_evict(struct gfs2_glock *gl)