Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp233291lqp; Tue, 11 Jun 2024 02:53:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXGIsxoyAOTcHcjwtEw3pW8dsnyvph6h/aqeUA8cEkenlON3Z+PQWN3wWiOPk6d4gL8HeFwIohlmf1Xc1B9Rl04okY+8HzWsMCNnXyJHA== X-Google-Smtp-Source: AGHT+IFUODS5l9fV+HD81sVRS0NrQUf6FP7DZsO5S1VuBiJV8lXDsaLzJVgHc0a5g2247bWRdokq X-Received: by 2002:a05:622a:20d:b0:43a:c18e:678d with SMTP id d75a77b69052e-44041cae201mr142054071cf.42.1718099605760; Tue, 11 Jun 2024 02:53:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718099605; cv=pass; d=google.com; s=arc-20160816; b=GaGgU2XuqIQFhEppdZgNzzgKTOc9ywpJ4C3jytSujwgvpYoLE8LyKGsGCbSkToqVtZ dS+uSRkZRnwlGRbNWst8f5YD6EY1Cqn2VbZGE1eNqv/78gAMIOqRO5SiLxFrVP98wROM xsX4ndb9+yakTey/rDLhomV/ubhzNtoPskVzBOi7ZTaA3HGWl3XY3B1QtkRPXlgcIP6s d96BcRoZjkLjy3yBUoebzt/hU8ABH9NYjEEr6KlrkzYkUTfoJESMXx+SNtcesfQxD4Cz q+zBklki13PX5C/RRGlRQ7gxx+p+99ZY3Awg/g5bP+V1CppmwF30laX0/VIkDhJjiGU/ ovsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WNevOOm63bNyWQcozMtSXtp0dk1N2fSRps5B0mWi8Lc=; fh=umN2S9mqTDjSId2kFQEV4t/bdUuRCp5dISM2gDCrSsc=; b=qAy0kHMWO209JbVPQ6DXI6L/WwZI3yrJPajIUf8j8sJKmIlNsQcrclMydOwS2Li5h5 Km2pz5brRbRBuVmGUT+cSud9s+B3V6nVKc4ADit1s6h/wNWFJRdT/tZRocp4asYE5b3e pmZvMmv5+ctyyD30sqh18klNBMfWeMg3rBcA/g2lHT9sVuVzKY9keIUCKpB47cnxO8Jl BohbfavJio12b0QlzN+e917hUYhmF2wHNNMI4HxthM7Eze8HqXovboOcx1yuoFwDGCSm AbEERK8IEqcpMpy4425U4A0iuFigkiHgnled/PiXO+2f5FYPh1yxjqGbW8O/A6j6CvYr sl/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Bw18CTVz; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-209259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209259-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-440d29fedbesi50408631cf.405.2024.06.11.02.53.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Bw18CTVz; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-209259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209259-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E241F1C22990 for ; Tue, 11 Jun 2024 04:59:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CCBA170849; Tue, 11 Jun 2024 04:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Bw18CTVz" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 061EF14290; Tue, 11 Jun 2024 04:59:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718081984; cv=none; b=aIRkw8/LLqrUDyuBXbR7BPmYbdu4e9+9+xqM42QalWSK6r+iP8Og4m5hUzRBlm+7WSQpPZcnOf3CIMNClbH+0MoMxImfc6sbcAlcThat9KcxpCcy7RzwxP01KJ65uVosyI1Buh+3V09WpyYfWvkXWFEP5q8KazKSTYc2VBcVnCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718081984; c=relaxed/simple; bh=accUI4Ob47/mGnG38ZHmlsUndsefVIHJj7mN8QZs4oU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sLL54E9CvVYjQfwe+DCWatZw+YOJs3n2eluSjKKrM78Gf+rGgYtvd9JrYGi+udFhbFyqQ+6cTLjIzK1Q143kGHNiOtB0p2J/tGOOZYntdQffXz9vqQVh6qy/Pf/d/QmEe780cc88UU2TOInR6LgLjO9gjuhLBEtl6cclNLNqYyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Bw18CTVz; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WNevOOm63bNyWQcozMtSXtp0dk1N2fSRps5B0mWi8Lc=; b=Bw18CTVzsoMhcxtU1jfh7ZMRi2 Uv0U4JYPI+MweNs1IG28JZ3/oBF5H8hd7n2/x5I5wo3pR5YGAzsEBDxDLLqGw2LBaI7poPBXtF+S6 1NkopJ/GqEG3vg7qs/sxdp6y5WBwkEMm6N8WO2562gB1RP9LOaKzcG2wjznRKVqSHaks3LMhFyCGK JKs3qrqnUueJPxwRwB+bnoYSQO2VQeveQIw28cFtEQIRdWVf0qzCvU5JSq5k8GBO1WXJjkh9J5CSb +R/cneH1rywoMnVaUWQb5CDA+JwYkmlO9RjBDbbiARt1rWGtTvkfDZUNyEh/efpe3S+UbQglR6ba4 iMlzboyQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGtbe-00000007OZd-3XLk; Tue, 11 Jun 2024 04:59:38 +0000 Date: Mon, 10 Jun 2024 21:59:38 -0700 From: Christoph Hellwig To: Mateusz Guzik Cc: brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, josef@toxicpanda.com Subject: Re: [PATCH v2 1/2] vfs: add rcu-based find_inode variants for iget ops Message-ID: References: <20240610195828.474370-1-mjguzik@gmail.com> <20240610195828.474370-2-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240610195828.474370-2-mjguzik@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html > +EXPORT_SYMBOL(iget5_locked_rcu); EXPORT_SYMBOL_GPL for rcu APIs. > +static void __wait_on_freeing_inode(struct inode *inode, bool locked) > { > wait_queue_head_t *wq; > DEFINE_WAIT_BIT(wait, &inode->i_state, __I_NEW); > wq = bit_waitqueue(&inode->i_state, __I_NEW); > prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE); > spin_unlock(&inode->i_lock); > - spin_unlock(&inode_hash_lock); > + rcu_read_unlock(); > + if (locked) > + spin_unlock(&inode_hash_lock); The conditional locking here is goign to make sparse rather unhappy. Please try to find a way to at least annotate it, or maybe find another way around like, like leaving the schedule in finish_wait in the callers. > +extern struct inode *ilookup5_nowait_rcu(struct super_block *sb, > + unsigned long hashval, int (*test)(struct inode *, void *), > + void *data); No need for the extern here (or down below).