Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp14359rdb; Fri, 26 Jan 2024 16:36:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IESjbfzmd7J+sD+UCvddwNDlEpx8FLil0zIAWgeRrDMBinE2yQOb3B2AdwAfLwnvjNQS4tc X-Received: by 2002:a05:6808:16a3:b0:3be:260:6278 with SMTP id bb35-20020a05680816a300b003be02606278mr698495oib.42.1706315810405; Fri, 26 Jan 2024 16:36:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706315810; cv=pass; d=google.com; s=arc-20160816; b=YtewF44ZMm/n5xIImSIbmjwq5PoH40kY4IyvbD4D5/4MHEBihqF1eKTOQSrQLGdPsO AVaCytCWwA7HAfvM5SJy2TAHO4jfmPYfay+Bi9XZNZQUwF6Kak6CDNGtKcU2udgqK9WO DgjFrngCnwoVO3a7hb61Jmpd5A/B4sGK/fO4ZDSstah6FdUlDsgu0eDVkxPrzX+i4PBs W2YD8L+ZM22zroazXwstad4QiJz23173HeCRsB5j6GuiH8jzaWXdjzK60nmdvzZknBTM l1M0Lj1CQSeHepKOqDYGkYykJimjWjRSEarEvLBQUv1XonZJPtc5VF0Y8xnZ6jTmJnDM pVbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=GydXMmSuj/uYXlybfN2w6K2XDuYK0bvidi/G9R0qOpI=; fh=M648oune0DwZmCHpgeKmdqyNG9Pnhrh1APj5VeeCjyQ=; b=lS2FiB4uq/bbJywiY/phWc/zFZgKaHezdxUjIkQKMPMR+fArWEQSJ9c5tNfh1F7ss6 j6Yj3cgafp5Ga3VnFEHmpfnGId1hdr1FBYhnZVsB1NYI9aK2T7otJRQjCFtgGWJm6A1y 1T3w692C8xc7rfZ2gzWXvRY7MhV3YrLsc+N1ZTSg15kh/K60s70nnWJ5+u+kEZTI4v+y 6kKt+KUioJ+8zqT/jNzhSvoX+hAAs5GEny2LfaWqyj7zI0ZIEdE2OAvlD4ildGmpXUPW 8lm11u7I0IECIJJOfd4uuFseWne3vV0b6m65nBNLqFqPlsc+URZblBsUO/oG9bhmAXmN 4Y7w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kg617hfS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kg617hfS; 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-936-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-936-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s64-20020a632c43000000b005ce0be7965esi1966883pgs.467.2024.01.26.16.36.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 16:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-936-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kg617hfS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kg617hfS; 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-936-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-936-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 38EF3B274A5 for ; Sat, 27 Jan 2024 00:11:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4B3EA41; Sat, 27 Jan 2024 00:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="kg617hfS"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="fZQkcjqw"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="kg617hfS"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="fZQkcjqw" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 322081C2F; Sat, 27 Jan 2024 00:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706314222; cv=none; b=oxZezoS6qbs4XBEiIhgHQONz3JSwL5oxwZPbSkbzJds81Z7lJv06yCgAjxUB9DEZKjcMjcMW/9g4uB0tP+P2r7o9T274O9xIVMalKVwkWP+sV3D3Hdskhi08BH8ZxbBAUbbfjYu7osCk1KspA246/XdN4q5o3dzhEvS+SaBcra0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706314222; c=relaxed/simple; bh=jvyy4JAJu9Y6cX/1I2LuK3eXa22FjhvE6irM/TZBjms=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NIG7OcITRDk5q2P18jpIGKXeuQFh9XryMq6ZZyOPVwcccHz8fZGl0hZCrOl26Asp6H9zmBhNBYl6tadCplVp74TwNHPIhp+tL+47Ed2dSk0mBoeN8Bz2u111wQGOvweMFs+WKaywE/HEC5ih+0ULnAjPYqZnjCEvIuGROdsWD5U= 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=kg617hfS; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=fZQkcjqw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=kg617hfS; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=fZQkcjqw; arc=none smtp.client-ip=195.135.223.130 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-out1.suse.de (Postfix) with ESMTPS id 329A32214A; Sat, 27 Jan 2024 00:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706314218; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GydXMmSuj/uYXlybfN2w6K2XDuYK0bvidi/G9R0qOpI=; b=kg617hfSs+9so9gC5I1o8ciS4Wy3Dr/YmOOXQF2ZesOXWmRNaBZ6LNa6CUAfHLnzx/fna1 +ClkwZlqS0kuYbkogWw+2P2UkA8ulu6RdnE6oZPq4ZwxpFqhIeNTm97PxTjJbZbUDEe8Il JFfAtSnfrT+a5YcMHTMQwFi8nn2yAvw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706314218; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GydXMmSuj/uYXlybfN2w6K2XDuYK0bvidi/G9R0qOpI=; b=fZQkcjqw6hGGrW90atyCw9RCFbtfwIIjRSjTyvMlhTiUM6SvORYMnc/kk6Pcaunn5MdUia u7/1ynboi1eP9tCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706314218; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GydXMmSuj/uYXlybfN2w6K2XDuYK0bvidi/G9R0qOpI=; b=kg617hfSs+9so9gC5I1o8ciS4Wy3Dr/YmOOXQF2ZesOXWmRNaBZ6LNa6CUAfHLnzx/fna1 +ClkwZlqS0kuYbkogWw+2P2UkA8ulu6RdnE6oZPq4ZwxpFqhIeNTm97PxTjJbZbUDEe8Il JFfAtSnfrT+a5YcMHTMQwFi8nn2yAvw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706314218; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GydXMmSuj/uYXlybfN2w6K2XDuYK0bvidi/G9R0qOpI=; b=fZQkcjqw6hGGrW90atyCw9RCFbtfwIIjRSjTyvMlhTiUM6SvORYMnc/kk6Pcaunn5MdUia u7/1ynboi1eP9tCw== 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 8A6CF13998; Sat, 27 Jan 2024 00:10:17 +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 yQjED+lJtGVIEQAAD6G6ig (envelope-from ); Sat, 27 Jan 2024 00:10:17 +0000 From: Gabriel Krisman Bertazi To: ebiggers@kernel.org, viro@zeniv.linux.org.uk, jaegeuk@kernel.org, tytso@mit.edu Cc: amir73il@gmail.com, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Gabriel Krisman Bertazi Subject: [PATCH v4 00/12] Set casefold/fscrypt dentry operations through sb->s_d_op Date: Fri, 26 Jan 2024 21:10:00 -0300 Message-ID: <20240127001013.2845-1-krisman@suse.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=kg617hfS; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=fZQkcjqw X-Spamd-Result: default: False [-0.31 / 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]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; 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]; MID_CONTAINS_FROM(1.00)[]; 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)[gmail.com,vger.kernel.org,lists.sourceforge.net,suse.de]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: -0.31 X-Rspamd-Queue-Id: 329A32214A X-Spam-Level: X-Spam-Flag: NO X-Spamd-Bar: / Hi, The v4 of this patchset addresses the issues Eric pointed out in the previous version. The patch merging the fscrypt lookup helpers was completely rewritten to avoid the race condition; We also now return immediately from __fscrypt_handle_d_move; Finally, the overlayfs patch message was improved. Further details can be found on the changelog of each patch. As usual, this survived fstests on ext4 and f2fs. --- original cover letter: 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 (12): ovl: Reject mounting over case-insensitive directories fscrypt: Factor out a helper to configure the lookup dentry fscrypt: Call fscrypt_prepare_lookup_dentry on unencrypted dentries fscrypt: Drop d_revalidate for valid dentries during lookup fscrypt: Drop d_revalidate once the key is added fscrypt: Ignore non-fscrypt volumes during d_move 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 | 28 ++++----------- 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 | 78 +++++++++++++++++++++++++++++------------ 11 files changed, 103 insertions(+), 96 deletions(-) -- 2.43.0