Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2519742rwo; Thu, 3 Aug 2023 10:30:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHJ8eiEKZOnFGtJCB6S/LZVRViADSAVds4gtGPEHevK25iy44lU6J4gD85kb7gSd/bR6jbl X-Received: by 2002:a05:6512:ba7:b0:4f8:49a8:a0e2 with SMTP id b39-20020a0565120ba700b004f849a8a0e2mr10351812lfv.16.1691083831879; Thu, 03 Aug 2023 10:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691083831; cv=none; d=google.com; s=arc-20160816; b=S9jLpgxcwftTTw7B/r3XgQ7K1dXzsCa1b9pZ5Twp2Z7njWN6T0gDMtTiQodoDjvEUv RJwJoZxqKmznKW5ioaWDyGZGiUkOYjz4it7ugez87v/GeWMxIREoUcgW8W4fhsEH5A6b Ps2fimCTITaHdji1tYH+IaYP2HBNMHbhcyAerVZXDDsROrB7wlO1bIsre8Ai46lhFSFC bVYrfj3+/e/vjiWNbHrABjWHm9bMO86/C3780pLKermPyYKqFTLVi009Pmdl6KZVZYJT bXeBcz7rWrec+/57O1tXl2xBnxgbis6lgbjuFt19QfnY1rJC+InU6vyhyUsq6ukshRTe TQCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from:dkim-signature :dkim-signature; bh=8jmGqv5VrNNN6mYDaT468r0ysSqZdLXbTiuCY1iyBvU=; fh=k9OfdnI6XRCzrwokjBMFiYIUilYmm8DuDW/ukbB0Pgc=; b=GlOJODL2FfT97e7Xgw4Rt2Wao7cS6Hfd8m0cV4lYAFetobzFnVFl+oJOweGCh1pEEZ 7N2v9+rN06SNrnJl+QTet/rCU7n6Yj54mfhDM0X7t2okQy6mtVKD0QCzlNL5ZnoPPOjg 7Vlv9K2wYNPurYPAVBprAQTxrDwCghXlUPQjZbvW71fFKYMnL1zJ292EHGsSodEU8uP7 WE/9vd8hq9pmKQHo+nXS9wWJEK+W8YbzBFxn8YtGU6+uBuIkLKmMUBGd1rTkFtzIh56G rUdC+uG8IyI1vcNY2Fwespnfdy569Q5koEqry2OpK9k2V3GwlO49kc5LF3hEygTT1oow eRug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TxLd0HeM; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z18-20020aa7cf92000000b005222c4133f8si112593edx.16.2023.08.03.10.30.02; Thu, 03 Aug 2023 10:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@suse.de header.s=susede2_rsa header.b=TxLd0HeM; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234480AbjHCQ5X (ORCPT + 99 others); Thu, 3 Aug 2023 12:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234281AbjHCQ5I (ORCPT ); Thu, 3 Aug 2023 12:57:08 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0674C4227; Thu, 3 Aug 2023 09:56:17 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 412A72190C; Thu, 3 Aug 2023 16:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1691081775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8jmGqv5VrNNN6mYDaT468r0ysSqZdLXbTiuCY1iyBvU=; b=TxLd0HeM/26VTzN2RSiMjSK4UA3aEVWxf4yVMDutyM05qIwSgDCqDgsa4pgtOeWDs8bpE7 9EQ/OYgGQZ9VHx8Z8vLkWVfbp9OSxthffiYgt4wEM0On5oXqPGKEaaO7IW4faSykVkUTPT 846xrgWZ0KteXI9VCUKtPOuQyi8VRy0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1691081775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8jmGqv5VrNNN6mYDaT468r0ysSqZdLXbTiuCY1iyBvU=; b=pcPBq4k4ZIU5vU52Pylta0bS+0mjQ8UQdrzUfpsvtxc3eFTqdyVquXgDMV3ksWRn7STD08 pVxc2SYgy1TUyMAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 090E01333C; Thu, 3 Aug 2023 16:56:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xScbOC7cy2SpVwAAMHmgww (envelope-from ); Thu, 03 Aug 2023 16:56:14 +0000 From: Gabriel Krisman Bertazi To: Eric Biggers Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, tytso@mit.edu, jaegeuk@kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Gabriel Krisman Bertazi Subject: Re: [PATCH v4 3/7] libfs: Validate negative dentries in case-insensitive directories Organization: SUSE References: <20230727172843.20542-1-krisman@suse.de> <20230727172843.20542-4-krisman@suse.de> <20230729045156.GD4171@sol.localdomain> Date: Thu, 03 Aug 2023 12:56:13 -0400 In-Reply-To: <20230729045156.GD4171@sol.localdomain> (Eric Biggers's message of "Fri, 28 Jul 2023 21:51:56 -0700") Message-ID: <87bkfo12vm.fsf@suse.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org Eric Biggers writes: > On Thu, Jul 27, 2023 at 01:28:39PM -0400, Gabriel Krisman Bertazi wrote: >> dentry->d_name is only checked by the case-insensitive d_revalidate hook >> in the LOOKUP_CREATE/LOOKUP_RENAME_TARGET case since, for these cases, >> d_revalidate is always called with the parent inode read-locked, and >> therefore the name cannot change from under us. > > "at least read-locked"? Or do you actually mean write-locked? No. I mean read-locked, as in holding the read-part of the inode lock. This is the case for lookup_slow, which is safe, despite the d_add_ci case we discussed in the previous iteration. I'll reword to say "at least read-locked and mention it is the case in lookup_slow". >> +static inline int generic_ci_d_revalidate(struct dentry *dentry, >> + const struct qstr *name, >> + unsigned int flags) > > No need for inline here. sorry, I missed the inline from your previuos review. Will fix it up for this one. > > - Eric -- Gabriel Krisman Bertazi