Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1744465rbb; Mon, 26 Feb 2024 22:36:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV5Xmdq7frh1dSxVMxNqx77p2QZr8uHxWJuQ1vJMIKg7wFkf8lVO9O71Rk3d/VX03OHqTgXsknhfdHeBh8NCi4hhz4PyaecMjRH2gagNg== X-Google-Smtp-Source: AGHT+IG2l1m87yXL7lg7jKpz6pkTNxFC78WTHSJJv16bAf00CRQQVN2lmU4Unb84sawPorD99bxu X-Received: by 2002:a05:6a00:4ba6:b0:6e5:bdf:7df7 with SMTP id kt6-20020a056a004ba600b006e50bdf7df7mr4981980pfb.7.1709015783769; Mon, 26 Feb 2024 22:36:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709015783; cv=pass; d=google.com; s=arc-20160816; b=cr0ru2SP46U1fR920JFBLqGh0/ieQGkUQaSibx+HjoJaMPP6PrAPEpsyUqaSyBZIcM vV2uk951ffDS7jkcrFNJ4KT1yjYQmBCdeJg1qb7oJQf8mHhbpUQ8tfA6ropr+0kJId6t StkQ96WWVaubrynGmawQ5LU3+A5M2o+LpcuBOZOqlaSoGzuTrQ4OREbj+S3BUPN9P6UP +QRIP2Hzh38MvAqk073pbHjGn+2lmWOdjUf0e5wMrDCWJNm/Lyu4xMEYmaw3pAdIqzFO xVjUQ4bL7LYdw7Y0pP4yiDv5hh+gLRRcDH5x6C7fAoS7nPd7K7qLyAcr1bjVWh0iR+IM 6tCA== 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=Esne05Xg/2+FYn1gPTCPuX94UvkRu95MFCnEvRPRHOU=; fh=2iydB5pt4SYT/kH4TIHHSsSMF4WO/iWQt5Wj30+i5ig=; b=0DkvEO1dNGTS1FwBD0yAHKg0S+ODUuXhbVq74d5NrnZG437JvuwNI4/zTcRLt7GHxX hnTDmQdWIgAIiT9U7395yHOfv5MnTiqzxAv/zcrMVyTRa6efhcyqJDoGHml8b69GUp9K RIWZ3OLKLACXxMz2qG6sqzoSJ2sJbGNf/Dw/pstmE3uRfocgj08z9HvilBpZYKcHW5mf TmSNsapQBTbOP5DjD/a5omWGXPwzBfzNnD+np62AxWZaKCsuFvHS24U4dsSoz6qMSPEZ rZ312IiJ9iY8Da7gBC5/HfFsyzbFuIz45nnN4dK7poWdDSQH8VS7Pui4MDq/fnrqsfFB 9zIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAON0pAS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-1392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a124-20020a636682000000b005e17c9e194fsi4918102pgc.247.2024.02.26.22.36.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 22:36:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAON0pAS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-1392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7A509284301 for ; Tue, 27 Feb 2024 06:36:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E97441A84; Tue, 27 Feb 2024 06:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TAON0pAS" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C443B256A; Tue, 27 Feb 2024 06:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709015776; cv=none; b=RZvLjTOmmXN7l3vp76yBzZcuuqSoI7/h277gHpbLs6xc7rJ6wd3mottmqzdTtHqhLbfqJ+e7uR2cXRPdX64yDe+tRMdXOBA8tQE/vNTLVcHU/wcE+VqJeyYgb1DdnG7ls1qLyw9fctLP0BxCzFFs4OZDuAXbWNO4QDQnt4LaNXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709015776; c=relaxed/simple; bh=BnWI1QlWvLT8QiqmYWbI9nYOFqfqKjduJfF+ni+ECWU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kqlQCdHjIsgkIGJelIUmEt98ajOScQfyZjc0HBKvXHE0r9lP0A+zM6p+LybYXlH3UyHA1zG/KIjOXdMz+hSLDmG4Xbgcckg/B2JRHIf7aYSKIJ1gLAVo5RC6+ZIstZYPwDiXBNhwmU3SO0rZ+hdbEwzGWYYPpHUNjRHZLmcmMf4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TAON0pAS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B0E8C433C7; Tue, 27 Feb 2024 06:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709015776; bh=BnWI1QlWvLT8QiqmYWbI9nYOFqfqKjduJfF+ni+ECWU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TAON0pASJNwPRPdlYDWOlNy5thVAd1zfXGGDMD9tvgdhVDaM5MNasI2hsJeAog4tq 7CTK3YUoVpDtoSiwjBCcs1j8vsWNtuNltYFB2rpX5BA8lpn/ER+fi+uVYOiaslWRaB XPj3t5FLRAz5a4gWlqFvqfHWQNMawq6j6zD6CqvUGJ5fmaW9ltX7XUqs0garIZvcAE r/1CDWmMln2ZZ5SQzUh1yg3TkgSgQvG07KDx7Dn5Yr5UCvCMi2QH8Z/wIrLCX2XwrE F9TjgMeBF2H5Lxr7j46Wnvh/8W/qUtLTUWQRcH3QLnYc5/msk+7Cw58aZIFQhiiARk tYei7ksoL52xQ== Date: Mon, 26 Feb 2024 22:36:14 -0800 From: Eric Biggers To: Gabriel Krisman Bertazi Cc: viro@zeniv.linux.org.uk, jaegeuk@kernel.org, tytso@mit.edu, amir73il@gmail.com, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, brauner@kernel.org Subject: Re: [PATCH v7 00/10] Set casefold/fscrypt dentry operations through sb->s_d_op Message-ID: <20240227063614.GB1126@sol.localdomain> References: <20240221171412.10710-1-krisman@suse.de> Precedence: bulk X-Mailing-List: linux-ext4@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: <20240221171412.10710-1-krisman@suse.de> On Wed, Feb 21, 2024 at 12:14:02PM -0500, Gabriel Krisman Bertazi wrote: > > When case-insensitive and fscrypt were adapted to work together, we moved the > code that sets the dentry operations for case-insensitive dentries(d_hash and > d_compare) to happen from a helper inside ->lookup. This is because fscrypt > wants to set d_revalidate only on some dentries, so it does it only for them in > d_revalidate. > > But, case-insensitive hooks are actually set on all dentries in the filesystem, > so the natural place to do it is through s_d_op and let d_alloc handle it [1]. > In addition, doing it inside the ->lookup is a problem for case-insensitive > dentries that are not created through ->lookup, like those coming > open-by-fhandle[2], which will not see the required d_ops. > > This patchset therefore reverts to using sb->s_d_op to set the dentry operations > for case-insensitive filesystems. In order to set case-insensitive hooks early > and not require every dentry to have d_revalidate in case-insensitive > filesystems, it introduces a patch suggested by Al Viro to disable d_revalidate > on some dentries on the fly. > > It survives fstests encrypt and quick groups without regressions. Based on > v6.7-rc1. > > [1] https://lore.kernel.org/linux-fsdevel/20231123195327.GP38156@ZenIV/ > [2] https://lore.kernel.org/linux-fsdevel/20231123171255.GN38156@ZenIV/ > > Gabriel Krisman Bertazi (10): > ovl: Always reject mounting over case-insensitive directories > fscrypt: Factor out a helper to configure the lookup dentry > fscrypt: Drop d_revalidate for valid dentries during lookup > fscrypt: Drop d_revalidate once the key is added > libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops > libfs: Add helper to choose dentry operations at mount-time > ext4: Configure dentry operations at dentry-creation time > f2fs: Configure dentry operations at dentry-creation time > ubifs: Configure dentry operations at dentry-creation time > libfs: Drop generic_set_encrypted_ci_d_ops > > fs/crypto/hooks.c | 15 ++++------ > fs/ext4/namei.c | 1 - > fs/ext4/super.c | 1 + > fs/f2fs/namei.c | 1 - > fs/f2fs/super.c | 1 + > fs/libfs.c | 62 +++++++++++--------------------------- > fs/overlayfs/params.c | 14 +++++++-- > fs/ubifs/dir.c | 1 - > fs/ubifs/super.c | 1 + > include/linux/fs.h | 11 ++++++- > include/linux/fscrypt.h | 66 ++++++++++++++++++++++++++++++++++++----- > 11 files changed, 105 insertions(+), 69 deletions(-) > Looks good, Reviewed-by: Eric Biggers - Eric