Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1175634iof; Mon, 6 Jun 2022 23:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbWi0Fxa/b/yVo8+c6544gWVF4rxe3JpNZm3+/2+QQ65dmnSPRafw07f0tVRh3Nm7ky7bu X-Received: by 2002:a05:6402:4255:b0:431:34c3:6018 with SMTP id g21-20020a056402425500b0043134c36018mr16733829edb.146.1654582865048; Mon, 06 Jun 2022 23:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654582865; cv=none; d=google.com; s=arc-20160816; b=Lu2Gzo+yPyBKUf6CZ0hHIUo1FAfFIcbEyuWctL6cH8MY9OX+yaKisJBaeWphoERunr xU7CxHugCsSaO7czQIHHyHdNNGYqMsM1McPKEXFknv4HWAbSzaJxY37hTjDBLv/4iegs z415KKV2g/uDhv+au9bSJxV9GiuUTSsNyBQxEhAP+5y9uJ4T/2ZS8dAoJXuAHkDU5Pl5 eQ9mbRc8puSBrMoYnXMvZrH2cMGszjIOjzWWFKXqrb5JcRpq8k2FfAQc27YUUW0kXc7O 5YUgHTYXhTg8QN0BZ4ro1/Rk2tdY+iJ+KAZByT4o+IvOhzX6sZPHYKK3BSzZzZcQfcSS I+8g== 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=4tLzl4/HAg0Lw635r/GzVfA/PgvqTa8rP2CYhqLXFYk=; b=jL+vkG8rebLStfxxcHNd5kudr+pUlkME5wxcBivEEEFNsguO4J/khuRN6KB6Ks9nMw 4deFNApuZAsUb5F8c+MP7tcV5Dy669wbOLixfEyM9ZGaCEXvfUSwGyYlKS8hb8Yha+cL nMAg3mj0NuW1luTTy2LGmknUDayi/kvgB2b4XDX2dE7HlYpDs/boUR17jblHPcMYtiB8 B9zhEInXuCIlsl9hO/y+DYcJ1DJDl4QjsWH18pztBZGTFRLfwmNR4fvnLu/iRa1G+hr9 gTrBfulEhDkEo9OuVSxMekqHy5xHhg1vl7VGzRXa1Qn9c1iqEOIQ/Pa3+wNbdWSVyhgi lu+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="NZ5sUx/U"; 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 hc18-20020a170907169200b006fe3246c6a3si1426821ejc.524.2022.06.06.23.20.38; Mon, 06 Jun 2022 23:21:05 -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="NZ5sUx/U"; 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 S234747AbiFGDle (ORCPT + 99 others); Mon, 6 Jun 2022 23:41:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232266AbiFGDld (ORCPT ); Mon, 6 Jun 2022 23:41:33 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 52F5D1EC70 for ; Mon, 6 Jun 2022 20:41:31 -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 615EE20BE62B; Mon, 6 Jun 2022 20:41:30 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 615EE20BE62B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1654573291; bh=4tLzl4/HAg0Lw635r/GzVfA/PgvqTa8rP2CYhqLXFYk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NZ5sUx/UlOZrV/pcDFvmq2kvIC2/zcpuLArY4liv2FgeI7T5s0dJmBXbRIIpc8ndp wkJ0DsPOZIglb1Zb6vQ2tTvguctmYuClL0U1oiWrJuJxTDYTOsp1W17PZYlMUC94mt 9Fj0ujzP6XzPtrAtJzs4OQNf2F/Hf6it7kRqDTmE= Date: Mon, 6 Jun 2022 22:41:10 -0500 From: Tyler Hicks To: Christian Schoenebeck , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet Cc: Jianyong Wu , v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/5] 9p: Fix refcounting during full path walks for fid lookups Message-ID: <20220607034110.GA7401@sequoia> References: <20220527000003.355812-1-tyhicks@linux.microsoft.com> <43525959.9j6oIFhYhY@silver> <20220531142829.GA6868@sequoia> <1849605.JvGbLJQp6r@silver> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1849605.JvGbLJQp6r@silver> 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-01 16:28:49, Christian Schoenebeck wrote: > On Dienstag, 31. Mai 2022 16:28:29 CEST Tyler Hicks wrote: > > On 2022-05-30 19:14:43, Christian Schoenebeck wrote: > > > On Freitag, 27. Mai 2022 01:59:59 CEST Tyler Hicks wrote: > > > > Decrement the refcount of the parent dentry's fid after walking > > > > each path component during a full path walk for a lookup. Failure to do > > > > so can lead to fids that are not clunked until the filesystem is > > > > > > > > unmounted, as indicated by this warning: > > > > 9pnet: found fid 3 not clunked > > > > > > That explains why I saw so many fids not being clunked with recent Linux > > > kernel versions while doing some 9p protocol debugging with QEMU recently. > > > > In addition to this refcounting bug, there's another one that I noticed > > while running fstests. My series does not fix it and I haven't had a > > chance to look into it more. The generic/531 test triggers it. > > > > https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/tests/generic/5 > > 31 > > > > The improper refcounting after walking resulted in open(2) returning > > > > -EIO on any directories underneath the mount point when using the virtio > > > > transport. When using the fd transport, there's no apparent issue until > > > > the filesytem is unmounted and the warning above is emitted to the logs. > > > > > > Actually I never saw that open() = -EIO error. Do you have a reproducer? > > > > The reproducer that I have is binary only (fairly large and runs a bunch > > of different tests) and is used to regression test the Windows Subsystem > > for Linux 2 (WSL2) host <-> guest filesystem sharing. Now that I think > > about it, I'm not sure if the open() = -EIO error happens with other 9p > > servers. This -EIO error looks to be specific to the WSL 9p server. I was unable to reproduce it with QEMU's 9p server. I just see unclunked fids with QEMU. > > > > I can try to tease out the exact sequence of filesystem operations from > > this test binary but it might take me a bit. It looks like it has to do > > with switching UIDs, which could make sense because different users may > > not be connected to the filesystem yet (the conditional block that does > > p9_client_attach() and v9fs_fid_add()). I didn't have much luck here. This issue only reproduces after a sequence of somewhat unrelated tests running in succession. They each contain a lot of unnecessary filesystem operations but they each contain some setuid() calls which makes some sense considering the refcounting change proposed in this patch. 9p maintainers, is there anything else that I can help with to get this bug fix reviewed/merged? Thanks! Tyler