Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp933321ioo; Thu, 26 May 2022 19:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHwXcpm52kT8eLHT5V7cP1USJdgVddOtc0uvH2de+EA+ADbx4RVJTfojsKVgx58ebScwQd X-Received: by 2002:a05:6402:1941:b0:413:2555:53e3 with SMTP id f1-20020a056402194100b00413255553e3mr43240216edz.164.1653618987887; Thu, 26 May 2022 19:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653618987; cv=none; d=google.com; s=arc-20160816; b=YliC0Ia6orz0JSQEuV/StTb18mM3kb5n0Q5WpPF3a6AqOiMuHayrpVTeWa1RHoSm2/ O+9TPjiSgB2KeJid9m8IzhEKAD7ouHNT17pkLlIKxN02wX7vseUYBmZhJKEBkaVhUKbK j4g9UqzG9Fw///9V4E8jno7rzOu3xnYmdv2T2/mcFr7WLoG/vwfOcxDVyPuEw+Qzi7T1 Q0Q/OwSEj9qcA1tzcRm1v4PNPRqXCJqTmHY8nnVlSz5jFO4D/+hygGJnKFoLlkaQeBcS 2CoYFgS+83esYPwa9wh5jMGoHMVkl3x/sVdV5+9Ilb+qmbo/mxkEzyvCscoEZcDa8xfG G6bg== 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:cc:to:from:dkim-signature:dkim-filter; bh=fd3AmZ5c2EXp0lmLUJ+sKREKqjhalZD5/f8lKuTHF04=; b=e0mlLaP/KIS1PgXZKRleqx1iNP5GTPj+rkqhUgv0pB3w0iF5DKaTL1VMu6Q9Z0vx0F UpDfNB+ahN49tchZjGr1GW620KZm3zq3PZTV2Z5957kjOtGe/1X14IrK9HUJJ+vImUBb uSFSRgwrOdaa6DxIMFog1jPAvrmfrvZNR4ATS5xjDM/zGlgCrIYhvRdAHQg5oms8KFoK s1EUh/5DI3n9qskSTF//H9EuYFQuunt5glTfcB9RYgCZWIcxSmARX0Jbgyxdbs2uVy1F a6hUx/pGpdl3OTk1FfdS0FrERxQW6CIKJpm2HtC7xepYqtQaM+qDIUyrnI8Hs7ztHYtu wj9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=qJlGTFzm; 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 ej18-20020a056402369200b0042374f2973bsi3229511edb.193.2022.05.26.19.36.02; Thu, 26 May 2022 19:36:27 -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=qJlGTFzm; 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 S237784AbiE0AAZ (ORCPT + 99 others); Thu, 26 May 2022 20:00:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231754AbiE0AAX (ORCPT ); Thu, 26 May 2022 20:00:23 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E9669FD0F for ; Thu, 26 May 2022 17:00:22 -0700 (PDT) Received: from sequoia.corp.microsoft.com (162-237-133-238.lightspeed.rcsntx.sbcglobal.net [162.237.133.238]) by linux.microsoft.com (Postfix) with ESMTPSA id 08A0320B71D5; Thu, 26 May 2022 17:00:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 08A0320B71D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1653609622; bh=fd3AmZ5c2EXp0lmLUJ+sKREKqjhalZD5/f8lKuTHF04=; h=From:To:Cc:Subject:Date:From; b=qJlGTFzmxbhCAfoUYXyQLf7yxV9+Iz1ehzDKm+m5Y5ApGFNte7W+R061JcEXZkQ4a x6KxIV9If17zFo0QtHclwlk1HiQichWF2Nq6lgG9KiavxCUglCzcHxUJ4wn2aa1sRW jVDpMWhqPnbTznn/FsYMgkFbYX/NGX7d+OGEZSDk= From: Tyler Hicks To: Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet Cc: Christian Schoenebeck , Jianyong Wu , v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/5] 9p: Fix refcounting and improve readability in lookup Date: Thu, 26 May 2022 18:59:58 -0500 Message-Id: <20220527000003.355812-1-tyhicks@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 v2: - Simplified the first patch, by removing code cleanups, to reduce churn and minimize regression potential in stable trees + The resulting changes are *identical* to the v1 submission when patches 1, 2, and 3 are applied - Added patches 4 and 5 which are additional, minor code cleanups v1: https://lore.kernel.org/lkml/20220525182530.266068-1-tyhicks@linux.microsoft.com/ The primary motivation for this series is patch #1 which fixes a refcounting issue in the path walking code of v9fs_fid_lookup_with_uid(). Userspace can cause fids, which are created for use during lookup, to not be clunked and make the mount unusable. The remaining patches are code cleanups to improve readability. They're not critical. I tested v1 and v2 by running fstests against 9p inside of QEMU to ensure that the results were the same as without my changes applied. I also backported patch #1 of v2 to linux-5.15.y (v5.15.32) and ensured that the 'fid not clunked' issue did not occur when running against the Windows Subsystem for Linux (WSL) 9p server. Tyler Tyler Hicks (5): 9p: Fix refcounting during full path walks for fid lookups 9p: Track the root fid with its own variable during lookups 9p: Make the path walk logic more clear about when cloning is required 9p: Remove unnecessary variable for old fids while walking from d_parent 9p: Fix minor typo in code comment fs/9p/fid.c | 50 ++++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) -- 2.25.1