Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp828327iog; Mon, 13 Jun 2022 13:59:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s8Aj3LPxf+jsWXhb0bt1ZWak1JWQiEGIPxHi6ojamANI1nf7aUuEh5IA+J0/IFyrc3ogq0 X-Received: by 2002:aa7:d157:0:b0:42d:c3a9:5beb with SMTP id r23-20020aa7d157000000b0042dc3a95bebmr1934470edo.160.1655153973348; Mon, 13 Jun 2022 13:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655153973; cv=none; d=google.com; s=arc-20160816; b=scdTG0xcRi1Q2WeGlaPnAYis5Uq1n7s9B5a8SrajKDPo6EFyjg0m14VVP5W5YB5oi+ FWqn2IVjTFi1UgDtwrrwDQdT1JYujVKMd9aehY/PGI3ImjX12ZJsy9QJ3rZIwQ8B6kRr D4Couhp2EsFeYtd+t+AWz8BnbrurwA3m45NnglPzvPFDyuNp+SbIG4Q0tv3bWKfPKmtI blIsoRpdV53g46RWX+Gykuuairfr7QuNmNs6Xy4JUwYOMIYCjP8Ay+EFz4pK93CdFJ6n b1GsqSudCF4YREv4YBNttUl3pCSBkkzDWCkZ7MTCajT8SCc2fDoocJZOoEPDyoylk5Ab GDyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=Nft++AK4Xo5eRcdhC/+nOVQRH0imfgMDAanvnC8iCGY=; b=XS1S9+33NpHXOo1rIrkNU9uBa+QC0ptSvJSbnagCWPro13beUtbewPANrxT6AOHFNQ E6YdFIrcSHxJK3rvJIV76N6+x8egs8OPmQhX9EYVYGbfXeJJEA7UHJL20reXrbsQuOV+ 34utt3HG7SNW36kRsXmu6lIfhNt14m7VrlKcdLakdDEbOT/IG0EAeNvI3YhiAYfcUVW8 WHQ9ocKXczAOAImIRvXJcZ4pOO2DuDNcWtW+peBEIAvUoLiHNXD+4uj6X0OoZ/rLZ4iJ 3ouDrZQL37MymbkkJxc3gDmIoC54/fIA/wn/yqs0DSuHoMxB3zu8Hqfj5lqC2IDHt6lA UYOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=g0bSIsfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a170906739000b006f460b50245si8327026ejl.682.2022.06.13.13.59.05; Mon, 13 Jun 2022 13:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=g0bSIsfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350914AbiFMU5V (ORCPT + 99 others); Mon, 13 Jun 2022 16:57:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352213AbiFMUyR (ORCPT ); Mon, 13 Jun 2022 16:54:17 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3429D29353 for ; Mon, 13 Jun 2022 13:20:58 -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 8640820C154C; Mon, 13 Jun 2022 13:20:57 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8640820C154C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1655151657; bh=Nft++AK4Xo5eRcdhC/+nOVQRH0imfgMDAanvnC8iCGY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g0bSIsfsfTpuWw1wxebHkd2aPkjo0Gyxb/hYPwXstl6EQLvknbiRYqW/HO1jZAlxi 4RY8Zijlv9dmd3IldYIG/q1jLlzlna24bgt4BfAHvvaknQNpNVG7Ot1ZgVD5WZ74Je ImAB7VOaW0frx6XujBx9pjxOV9fEfwVu7CY4sv0I= Date: Mon, 13 Jun 2022 15:20:53 -0500 From: Tyler Hicks To: Dominique Martinet Cc: Christian Schoenebeck , v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/06] fid refcounting improvements and fixes Message-ID: <20220613202053.GI7401@sequoia> References: <20220612085330.1451496-1-asmadeus@codewreck.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220612085330.1451496-1-asmadeus@codewreck.org> X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-12 17:53:23, Dominique Martinet wrote: > So: > - I could reproduce Tyler's generic 531 leak, fixed it by the first > commit in v9fs_vfs_atomic_open_dotl > - Found another less likely leak while reworking code > - Christian's comment that it's not obvious that clunk is just a > refcount decrease was very true: I think it's worth the churn, > so I've rename this all through a new helper... > - ... with the not-so-hidden intent to improve debugging by adding > a tracepoint for them, which I have also done. > > I've also taken my comment in the other thread further and went ahead > and made it in its own commit. Tyler, if you're ok with this I'll just > squash it up. You can see rebased patches here: > https://github.com/martinetd/linux/ > > Note that I also took the permission to add back '/* clone */' as a > comment to your changing p9_client_walk's arguments: while I can agree > variables are hard to track, figuring out what the heck that boolean > argument means is much harder to me and I honestly preferred the > variable. > Having both through a comment is good enough for me if you'll accept > this: > ---- > @@ -222,7 +221,8 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry, > * We need to hold rename lock when doing a multipath > * walk to ensure none of the patch component change > */ > - fid = p9_client_walk(old_fid, l, &wnames[i], clone); > + fid = p9_client_walk(old_fid, l, &wnames[i], > + old_fid == root_fid /* clone */); This is no problem at all. The rebased patches look good to me. Squash your fix to my fix and it should be ready to go. Thanks again! Tyler > /* non-cloning walk will return the same fid */ > if (fid != old_fid) { > p9_client_clunk(old_fid); > ---- > > > The last commit is just cleanups and should be no real change. > > Dominique Martinet (6): > 9p: fix fid refcount leak in v9fs_vfs_atomic_open_dotl > 9p: fix fid refcount leak in v9fs_vfs_get_link > 9p: v9fs_fid_lookup_with_uid fix's fix suggestion > 9p fid refcount: add p9_fid_get/put wrappers > 9p fid refcount: add a 9p_fid_ref tracepoint > 9p fid refcount: cleanup p9_fid_put calls > > > (diff stats include Tyler's commits) > > fs/9p/fid.c | 71 +++++++++++++++------------- > fs/9p/fid.h | 6 +-- > fs/9p/vfs_addr.c | 4 +- > fs/9p/vfs_dentry.c | 4 +- > fs/9p/vfs_dir.c | 2 +- > fs/9p/vfs_file.c | 9 ++-- > fs/9p/vfs_inode.c | 97 +++++++++++++++++---------------------- > fs/9p/vfs_inode_dotl.c | 79 ++++++++++++------------------- > fs/9p/vfs_super.c | 8 ++-- > fs/9p/xattr.c | 8 ++-- > include/net/9p/client.h | 3 ++ > include/trace/events/9p.h | 48 +++++++++++++++++++ > net/9p/client.c | 42 +++++++++++------ > 13 files changed, 211 insertions(+), 170 deletions(-) > > -- > 2.35.1 >