Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2187057rbb; Tue, 27 Feb 2024 13:34:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU9ICXqkrPniAlP6bXe2QSEHUo7nytoRZ4JGTmrNtYN/JDxCJ4DT7W9dJpS8ghkTbjiShAo5/XHwPaObJE2j3FiMvSO8YIJZWMP6VNlsg== X-Google-Smtp-Source: AGHT+IECt91Ut9RLuLMKpe68mMun74Sz6KA0m2XmsN2QwAhIZXZDDEKtE6kMv1q1ooiXZnv67tbF X-Received: by 2002:a9d:61d0:0:b0:6e4:8fa3:d861 with SMTP id h16-20020a9d61d0000000b006e48fa3d861mr10746903otk.34.1709069674555; Tue, 27 Feb 2024 13:34:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709069674; cv=pass; d=google.com; s=arc-20160816; b=njJsNXHAFxlUqg2O+TvdhBqlVRr1UyloUzfAOxUf0zTWqs0hMJ+xqZ6878wHKFWvAx HXF6qpsytgq2lVzmaAmhZ5AJi3nc7mAN9HJ3iJRp8LkWUSMnqPjvC9QHp7ZsXdUXk6u4 Av4EU7e7J0RRc5QfgAsH+dgN7Xb9fqIjARQyYh1/il5bzkecj6IRl+YhCcyO3XEsWi50 340H+pbhLeKP4r4xRGYYI6jHsOXRDStekDpAxMUp0zLvYnCZGHq5swWO79Q7Sxd+iN9T 3VKJ2TvsUQtR/yRRYkgDqxF9CKe0HP/r1Z1r6MCegULL4+9YbLOZ4MCe+6qXk9FILLGR qLaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:organization:in-reply-to :subject:cc:to:from:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=idN97xqKgdpGpjCD/ggWuEREFt+8JtJCxbC+SceKShg=; fh=SE/YwIFLHnyZBT/vi4T8u2rru4JnzzP0/MA2vLmSDTc=; b=LmkNJ/iiZi3Mesv+QOgInkuA14ccaQnz90ylSK95oEIoMGZYxy4n13irpknncCI7kR 07KYxpH0HFkB7KoxWvAbgsvFw8j7lZS//wORQG2J4dLV2CCMcbsAOIfwQtPD5MqwjPXR In7qhb9q3ukwfHZA57iiCFIhUmTr9UaMIX3w4u+8hib/F9oIhq1m+Lr8j8p8MKkCRmWo Al1AYKj8MSyCRT2YSWSf4Y6KuGIQ+Ypm0DJi6qhP+vkXmwPrLJqJKcNpMaJKciLT7Mqs 2AP1RHm9m0ISUMtUkUy8SoD2UcoFqjs0FQlsS1PpCBFaprNF9vx8Zz5tA2mFi54wYv8i zG7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=l4vBZT7i; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=l4vBZT7i; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1407-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1407-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jw20-20020a056a00929400b006e468ec9951si6260694pfb.103.2024.02.27.13.34.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:34:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1407-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=@suse.de header.s=susede2_rsa header.b=l4vBZT7i; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=l4vBZT7i; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1407-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1407-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 A9FA12869F5 for ; Tue, 27 Feb 2024 21:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A48415445C; Tue, 27 Feb 2024 21:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="l4vBZT7i"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zmtl8qHB"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="l4vBZT7i"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zmtl8qHB" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE73D153BEF; Tue, 27 Feb 2024 21:28:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709069308; cv=none; b=oT3WEqBOVCJFHYJCacmOqR9iAMIwtBJ9wSNV+Gmc8VAdOtaiB+Cji7gx3XxbH0gIEd7rJtxTJDKLxXqYC1NMyf4Bx7Xo7ac1yz9uL7cjVx3uL5Xl8+Iati1t/QszeZrw6INnEse0xbakOIIemcmgC9mo+N3xO6JtLBkIIJLuoPE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709069308; c=relaxed/simple; bh=Q2Y6vBk1Le9pCisVKdF1YWPazcSd0f9HIiA0VPoszYs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Z2/vFFaTkyI06RvCdfx70QK9W5AV6gK9mam91T4999rNuEzDd6hZ8MlWmrT5/KV+ot981bVS9TWL6Bhq5j9CgcdV5fPcmQLpdP75W+SA/W+3sL02uYptjKa6OcOIGvpRxWQzVSl73nV6hNiAY1/HrweDqFFr/S8cdJZITCcv5UA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=l4vBZT7i; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zmtl8qHB; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=l4vBZT7i; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zmtl8qHB; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BBE171FD92; Tue, 27 Feb 2024 21:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709069304; 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=idN97xqKgdpGpjCD/ggWuEREFt+8JtJCxbC+SceKShg=; b=l4vBZT7i8u70lV2TrPudoBzr/q0TNxKxaaG3sHE2uANRrCToECWXrI/7+OEbjJXTODGMy8 fy414AJcAON8u+pE30eQOcUCd4RDl0t43bURTOrtCM3qw7gzXs+WOIjg8vj7nsZiZ3Rygz p3BonInGGKqE/iE8pwTZ9LCxSiNCZ6E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709069304; 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=idN97xqKgdpGpjCD/ggWuEREFt+8JtJCxbC+SceKShg=; b=zmtl8qHB06Ce+bk6C6JIQwJ2knV4oay5i8p7wz6/mzwXnD4Oa9mJWsRSGQhYnMfgFnbmaq +GwNLTAaUOmvLOCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709069304; 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=idN97xqKgdpGpjCD/ggWuEREFt+8JtJCxbC+SceKShg=; b=l4vBZT7i8u70lV2TrPudoBzr/q0TNxKxaaG3sHE2uANRrCToECWXrI/7+OEbjJXTODGMy8 fy414AJcAON8u+pE30eQOcUCd4RDl0t43bURTOrtCM3qw7gzXs+WOIjg8vj7nsZiZ3Rygz p3BonInGGKqE/iE8pwTZ9LCxSiNCZ6E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709069304; 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=idN97xqKgdpGpjCD/ggWuEREFt+8JtJCxbC+SceKShg=; b=zmtl8qHB06Ce+bk6C6JIQwJ2knV4oay5i8p7wz6/mzwXnD4Oa9mJWsRSGQhYnMfgFnbmaq +GwNLTAaUOmvLOCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 80C0713ABA; Tue, 27 Feb 2024 21:28:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MfkhGfhT3mXQHAAAD6G6ig (envelope-from ); Tue, 27 Feb 2024 21:28:24 +0000 From: Gabriel Krisman Bertazi To: Eric Biggers 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 In-Reply-To: <20240227063614.GB1126@sol.localdomain> (Eric Biggers's message of "Mon, 26 Feb 2024 22:36:14 -0800") Organization: SUSE References: <20240221171412.10710-1-krisman@suse.de> <20240227063614.GB1126@sol.localdomain> Date: Tue, 27 Feb 2024 16:28:23 -0500 Message-ID: <87o7c161hk.fsf@mailhost.krisman.be> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=l4vBZT7i; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=zmtl8qHB X-Spamd-Result: default: False [-4.81 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_DKIM_ARC_DNSWL_HI(-1.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[9]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[zeniv.linux.org.uk,kernel.org,mit.edu,gmail.com,vger.kernel.org,lists.sourceforge.net]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:106:10:150:64:167:received] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: BBE171FD92 X-Spam-Level: X-Spam-Score: -4.81 X-Spam-Flag: NO Eric Biggers writes: > 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 Thank you for you reviews, Eric. I really appreciate them. Since this been on the list for a while, I pushed it to get some linux-next testing and, should nothing arise or no one else comments, will get to Linus soon. Thanks, -- Gabriel Krisman Bertazi