From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 454ABC433EF for ; Mon, 13 Jun 2022 19:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343675AbiFMTBr (ORCPT ); Mon, 13 Jun 2022 15:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346311AbiFMTAy (ORCPT ); Mon, 13 Jun 2022 15:00:54 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A94A2DD72; Mon, 13 Jun 2022 09:27:34 -0700 (PDT) Received: from sequoia (162-237-133-238.lightspeed.rcsntx.sbcglobal.net [162.237.133.238]) by linux.microsoft.com (Postfix) with ESMTPSA id 7AAAA20BA5A7; Mon, 13 Jun 2022 09:27:33 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7AAAA20BA5A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1655137654; bh=/qpneIaXgCEUFQH7gFgUkKTtF8803lByIPiZ1KxLBA0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IGMV2vH6NSqdUPMcxV2+Q36SOixGyuGLw17xQUDm8DcKNSvm3rV5U0zX34JjN8qsU IO6llWd74e03MNOcjCA+GvYUaL9Q7JwwtCRIIK7H4wtpVzBctn01zg7VEkae9gPLsk VTjUVUY1AinBLGemcB2f1MhyGcXWTyl46RuGYI1Y= Date: Mon, 13 Jun 2022 11:27:30 -0500 From: Tyler Hicks To: Dominique Martinet Cc: Christian Schoenebeck , Eric Van Hensbergen , Latchesar Ionkov , Jianyong Wu , v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 01/06] 9p: fix fid refcount leak in v9fs_vfs_atomic_open_dotl Message-ID: <20220613162730.GB7401@sequoia> References: <20220612085330.1451496-1-asmadeus@codewreck.org> <20220612085330.1451496-2-asmadeus@codewreck.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220612085330.1451496-2-asmadeus@codewreck.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-12 17:53:24, Dominique Martinet wrote: > We need to release directory fid if we fail halfway through open > > This fixes fid leaking with xfstests generic 531 > > Fixes: 6636b6dcc3db ("9p: add refcount to p9_fid struct") > Cc: stable@vger.kernel.org > Reported-by: Tyler Hicks Reviewed-by: Tyler Hicks Tyler > Signed-off-by: Dominique Martinet > --- > fs/9p/vfs_inode_dotl.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c > index d17502a738a9..b6eb1160296c 100644 > --- a/fs/9p/vfs_inode_dotl.c > +++ b/fs/9p/vfs_inode_dotl.c > @@ -274,6 +274,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, > if (IS_ERR(ofid)) { > err = PTR_ERR(ofid); > p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); > + p9_client_clunk(dfid); > goto out; > } > > @@ -285,6 +286,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, > if (err) { > p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n", > err); > + p9_client_clunk(dfid); > goto error; > } > err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags), > @@ -292,6 +294,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, > if (err < 0) { > p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n", > err); > + p9_client_clunk(dfid); > goto error; > } > v9fs_invalidate_inode_attr(dir); > -- > 2.35.1 >