From mboxrd@z Thu Jan 1 00:00:00 1970 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 45E22239E6F; Sun, 10 Aug 2025 08:00:07 +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=1754812808; cv=none; b=hNpw9Iuw8/qkazMtTNRPnYRwDJlNJ2eN90/5B9unfqh7Uvd+uOg9/BhmeVNxppnWf6rf/OEIiA1ylNQO20tjXu1CTsKXNJUz5Th04ODA3qNEOe9u2nlDUZxXKl1CxXDZPGMX5TaSiy+uLqU0xW8Fzpm3GlUNjog4l9A9Xhnn7yI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754812808; c=relaxed/simple; bh=aTHyx1cf8uUcKi9iLPhMiaHNvBZweQxvaRFblGuIkU0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MFG5yFInQ/F2gNa2+Y0roSyTYPKmeU/fivEk1bDXNRGJTzi91ebWEqe9TdukBpJygI3fL2sGvd8+xMbVAwz64NKX06Gpfu2akZ1SSwc9VgvAZPUy2GSYeWxhwg7rF1kF9Q8Uf2RwMqdJf1MSRL4Lrzk4tZfDY0Qh35WRMGpC2Oc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WJdGfnTN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WJdGfnTN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E84DC4CEEB; Sun, 10 Aug 2025 08:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754812807; bh=aTHyx1cf8uUcKi9iLPhMiaHNvBZweQxvaRFblGuIkU0=; h=From:To:Cc:Subject:Date:From; b=WJdGfnTNdEQ6MVf/hGAbh0JwTqoz1Yh+pYp0k313F/a1j/rorDF8R07LPBEZ0sLKf 6TxIZXJpfRkfiRSg79aTBLrOKodHRWnOYxIzpGNzqukX7W9ZpAjrTaSykO5VbJXU6M rkyXb6XfNgNUexzXDTYxsxC562eZhrAIUbuI29XD8/0xg59FuqKZjrrfxyllWOp+0H pVx0Qmp2Zi2NnZkdXh0MsxAXjpQMVsGoNDFQBesUFz9qP+u5Wtl/oSyI7pmdRGsa5n +v/4jBd7cw61Mw1MmUKzH2i7rF9Ljz955U2e9s4ryWyazVca4ZmDDM7IWpIX6vR9d2 covGiQZeubuTQ== From: Eric Biggers To: linux-fscrypt@vger.kernel.org, fsverity@lists.linux.dev Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, Christian Brauner , Eric Biggers Subject: [PATCH v5 00/13] Move fscrypt and fsverity info out of struct inode Date: Sun, 10 Aug 2025 00:56:53 -0700 Message-ID: <20250810075706.172910-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is a cleaned-up implementation of moving the i_crypt_info and i_verity_info pointers out of 'struct inode' and into the fs-specific part of the inode, as proposed previously by Christian at https://lore.kernel.org/r/20250723-work-inode-fscrypt-v4-0-c8e11488a0e6@kernel.org/ The high-level concept is still the same: fs/crypto/ and fs/verity/ locate the pointer by adding an offset to the address of struct inode. The offset is retrieved from fscrypt_operations or fsverity_operations. I've cleaned up a lot of the details, including: - Grouped changes into patches differently - Rewrote commit messages and comments to be clearer - Adjusted code formatting to be consistent with existing code - Removed unneeded #ifdefs - Improved choice and location of VFS_WARN_ON_ONCE() statements - Added missing kerneldoc for ubifs_inode::i_crypt_info - Moved field initialization to init_once functions when they exist - Improved ceph offset calculation and removed unneeded static_asserts - fsverity_get_info() now checks IS_VERITY() instead of v_ops - fscrypt_put_encryption_info() no longer checks IS_ENCRYPTED(), since I no longer think it's actually correct there. - verity_data_blocks() now keeps doing a raw dereference - Dropped fscrypt_set_inode_info() - Renamed some functions - Do offset calculation using int, so we don't rely on unsigned overflow - And more. For v4 and earlier, see https://lore.kernel.org/r/20250723-work-inode-fscrypt-v4-0-c8e11488a0e6@kernel.org/ I'd like to take this series through the fscrypt tree for 6.18. (fsverity normally has a separate tree, but by choosing just one tree for this, we'll avoid conflicts in some places.) Eric Biggers (13): fscrypt: replace raw loads of info pointer with helper function fscrypt: add support for info in fs-specific part of inode ext4: move crypt info pointer to fs-specific part of inode f2fs: move crypt info pointer to fs-specific part of inode ubifs: move crypt info pointer to fs-specific part of inode ceph: move crypt info pointer to fs-specific part of inode fs: remove inode::i_crypt_info fsverity: add support for info in fs-specific part of inode ext4: move verity info pointer to fs-specific part of inode f2fs: move verity info pointer to fs-specific part of inode btrfs: move verity info pointer to fs-specific part of inode fs: remove inode::i_verity_info fsverity: check IS_VERITY() in fsverity_cleanup_inode() fs/btrfs/btrfs_inode.h | 5 ++++ fs/btrfs/inode.c | 3 ++ fs/btrfs/verity.c | 2 ++ fs/ceph/crypto.c | 2 ++ fs/ceph/inode.c | 1 + fs/ceph/super.h | 1 + fs/crypto/bio.c | 2 +- fs/crypto/crypto.c | 14 +++++---- fs/crypto/fname.c | 11 +++---- fs/crypto/fscrypt_private.h | 4 +-- fs/crypto/hooks.c | 2 +- fs/crypto/inline_crypt.c | 12 ++++---- fs/crypto/keysetup.c | 43 ++++++++++++++++----------- fs/crypto/policy.c | 7 +++-- fs/ext4/crypto.c | 2 ++ fs/ext4/ext4.h | 8 +++++ fs/ext4/super.c | 6 ++++ fs/ext4/verity.c | 2 ++ fs/f2fs/f2fs.h | 6 ++++ fs/f2fs/super.c | 10 ++++++- fs/f2fs/verity.c | 2 ++ fs/ubifs/crypto.c | 2 ++ fs/ubifs/ubifs.h | 4 +++ fs/verity/enable.c | 6 ++-- fs/verity/fsverity_private.h | 9 +++--- fs/verity/open.c | 23 ++++++++------- fs/verity/verify.c | 2 +- include/linux/fs.h | 10 ------- include/linux/fscrypt.h | 40 +++++++++++++++++++++++-- include/linux/fsverity.h | 57 +++++++++++++++++++++++++++++------- 30 files changed, 215 insertions(+), 83 deletions(-) base-commit: 561c80369df0733ba0574882a1635287b20f9de2 -- 2.50.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2748AC87FCF for ; Sun, 10 Aug 2025 08:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:Message-ID:Date:To:Sender: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Wb60tN6ua8Q9Pkq9RvvIjVcNkF1QEJWyxp7h8278BkA=; b=fFDVbhah1NVII7YpV+NYYwnl2a NT+nU74h/QLai55pG0ROyVuotkTtZi9OiR7q2T3hbcURBz17Bt1L4c7KDrfuhOsLIg7Ymmjudzj1C oG0b42kl/4+YpZyE5+6AgKa5EyuVLNjKMTjR/z77lklfQwVQ8YUrkPYK0GeJIulbx7SQ=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1ul0yV-00020b-QJ; Sun, 10 Aug 2025 08:00:15 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ul0yV-00020V-8K for linux-f2fs-devel@lists.sourceforge.net; Sun, 10 Aug 2025 08:00:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GdPH/+NcW6TAbXooVQlTd8faOiYQtXgqsrfPYMPIfhQ=; b=dSX+NWErfVBfLKuv7NqCkCfeSk TvUwpOV5UuVZafbWZ5mrL9iGIw2cq64XfiOaPn2HnoTGSKixqtbdTXU9fJ3VYhVWwE9dDb/UEP3Uy 4pNCKcL3g2o3u3rNzHKIECQFvelEKnkNPtqx3mstNQtxXTFbiLBmpqu6rLaORHH+QT1E=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=GdPH/+NcW6TAbXooVQlTd8faOiYQtXgqsrfPYMPIfhQ=; b=O sOuNkCFd8G9ijxRoUxHXz4sNx+E94CTAFxbQ3S5gqyZ+Ig7xkUyN08BS+AIMcdslna4cxZKZF+XJf +RsIDgR6XAjbxyr0/yjbbUMPA1m82hY08rv+HwgsBbyc1dYLDR2xKPrZvgyJqV17Xoh54qB1dqpJp BqJXWNw1Lv0nrz2s=; Received: from nyc.source.kernel.org ([147.75.193.91]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1ul0yU-00010M-7t for linux-f2fs-devel@lists.sourceforge.net; Sun, 10 Aug 2025 08:00:15 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 72453A54F4E; Sun, 10 Aug 2025 08:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E84DC4CEEB; Sun, 10 Aug 2025 08:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754812807; bh=aTHyx1cf8uUcKi9iLPhMiaHNvBZweQxvaRFblGuIkU0=; h=From:To:Cc:Subject:Date:From; b=WJdGfnTNdEQ6MVf/hGAbh0JwTqoz1Yh+pYp0k313F/a1j/rorDF8R07LPBEZ0sLKf 6TxIZXJpfRkfiRSg79aTBLrOKodHRWnOYxIzpGNzqukX7W9ZpAjrTaSykO5VbJXU6M rkyXb6XfNgNUexzXDTYxsxC562eZhrAIUbuI29XD8/0xg59FuqKZjrrfxyllWOp+0H pVx0Qmp2Zi2NnZkdXh0MsxAXjpQMVsGoNDFQBesUFz9qP+u5Wtl/oSyI7pmdRGsa5n +v/4jBd7cw61Mw1MmUKzH2i7rF9Ljz955U2e9s4ryWyazVca4ZmDDM7IWpIX6vR9d2 covGiQZeubuTQ== To: linux-fscrypt@vger.kernel.org, fsverity@lists.linux.dev Date: Sun, 10 Aug 2025 00:56:53 -0700 Message-ID: <20250810075706.172910-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 X-Headers-End: 1ul0yU-00010M-7t Subject: [f2fs-dev] [PATCH v5 00/13] Move fscrypt and fsverity info out of struct inode X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eric Biggers via Linux-f2fs-devel Reply-To: Eric Biggers Cc: Christian Brauner , linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This is a cleaned-up implementation of moving the i_crypt_info and i_verity_info pointers out of 'struct inode' and into the fs-specific part of the inode, as proposed previously by Christian at https://lore.kernel.org/r/20250723-work-inode-fscrypt-v4-0-c8e11488a0e6@kernel.org/ The high-level concept is still the same: fs/crypto/ and fs/verity/ locate the pointer by adding an offset to the address of struct inode. The offset is retrieved from fscrypt_operations or fsverity_operations. I've cleaned up a lot of the details, including: - Grouped changes into patches differently - Rewrote commit messages and comments to be clearer - Adjusted code formatting to be consistent with existing code - Removed unneeded #ifdefs - Improved choice and location of VFS_WARN_ON_ONCE() statements - Added missing kerneldoc for ubifs_inode::i_crypt_info - Moved field initialization to init_once functions when they exist - Improved ceph offset calculation and removed unneeded static_asserts - fsverity_get_info() now checks IS_VERITY() instead of v_ops - fscrypt_put_encryption_info() no longer checks IS_ENCRYPTED(), since I no longer think it's actually correct there. - verity_data_blocks() now keeps doing a raw dereference - Dropped fscrypt_set_inode_info() - Renamed some functions - Do offset calculation using int, so we don't rely on unsigned overflow - And more. For v4 and earlier, see https://lore.kernel.org/r/20250723-work-inode-fscrypt-v4-0-c8e11488a0e6@kernel.org/ I'd like to take this series through the fscrypt tree for 6.18. (fsverity normally has a separate tree, but by choosing just one tree for this, we'll avoid conflicts in some places.) Eric Biggers (13): fscrypt: replace raw loads of info pointer with helper function fscrypt: add support for info in fs-specific part of inode ext4: move crypt info pointer to fs-specific part of inode f2fs: move crypt info pointer to fs-specific part of inode ubifs: move crypt info pointer to fs-specific part of inode ceph: move crypt info pointer to fs-specific part of inode fs: remove inode::i_crypt_info fsverity: add support for info in fs-specific part of inode ext4: move verity info pointer to fs-specific part of inode f2fs: move verity info pointer to fs-specific part of inode btrfs: move verity info pointer to fs-specific part of inode fs: remove inode::i_verity_info fsverity: check IS_VERITY() in fsverity_cleanup_inode() fs/btrfs/btrfs_inode.h | 5 ++++ fs/btrfs/inode.c | 3 ++ fs/btrfs/verity.c | 2 ++ fs/ceph/crypto.c | 2 ++ fs/ceph/inode.c | 1 + fs/ceph/super.h | 1 + fs/crypto/bio.c | 2 +- fs/crypto/crypto.c | 14 +++++---- fs/crypto/fname.c | 11 +++---- fs/crypto/fscrypt_private.h | 4 +-- fs/crypto/hooks.c | 2 +- fs/crypto/inline_crypt.c | 12 ++++---- fs/crypto/keysetup.c | 43 ++++++++++++++++----------- fs/crypto/policy.c | 7 +++-- fs/ext4/crypto.c | 2 ++ fs/ext4/ext4.h | 8 +++++ fs/ext4/super.c | 6 ++++ fs/ext4/verity.c | 2 ++ fs/f2fs/f2fs.h | 6 ++++ fs/f2fs/super.c | 10 ++++++- fs/f2fs/verity.c | 2 ++ fs/ubifs/crypto.c | 2 ++ fs/ubifs/ubifs.h | 4 +++ fs/verity/enable.c | 6 ++-- fs/verity/fsverity_private.h | 9 +++--- fs/verity/open.c | 23 ++++++++------- fs/verity/verify.c | 2 +- include/linux/fs.h | 10 ------- include/linux/fscrypt.h | 40 +++++++++++++++++++++++-- include/linux/fsverity.h | 57 +++++++++++++++++++++++++++++------- 30 files changed, 215 insertions(+), 83 deletions(-) base-commit: 561c80369df0733ba0574882a1635287b20f9de2 -- 2.50.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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.lore.kernel.org (Postfix) with ESMTPS id B2A43CA0ECF for ; Sun, 10 Aug 2025 08:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=h2+AI2KLiDfeOpAmPRlTx1/3oUEq5B8mTV3/a95UMWs=; b=v19FPH9+IC8CrO D2H4FiQK6eXZJJdY0Xpx8iJWwXPkwT7DVLOHwjbXCgnx8kHUOUzocik6WiHIwo5+levk1A6T7X58N WpwK715iBLcUBqdiXyo4aHWNxerwnu3fZVDSlm41Y6W/WgfeIUQvYgI9F96yfGHNZBzcQInfEhp2d dWFwy3L/rQK6lPy1J3VCJXaZXgNx4SNmzd+UKniqK7uyY6UQ67KEucptFfDD4tFb/TkJJgkW4t5V6 qbx7Z32IH5BwJUB6ZLv0D/fvtym953ttyt5xc242ziSN/nPaQmWD4DasEKtJMPiBdCc14J+V4xd6x LocOZDPie1DUt0NWp5Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ul0yW-00000005QKV-49ax; Sun, 10 Aug 2025 08:00:16 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ul0yQ-00000005QDq-1zlQ for linux-mtd@lists.infradead.org; Sun, 10 Aug 2025 08:00:13 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 72453A54F4E; Sun, 10 Aug 2025 08:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E84DC4CEEB; Sun, 10 Aug 2025 08:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754812807; bh=aTHyx1cf8uUcKi9iLPhMiaHNvBZweQxvaRFblGuIkU0=; h=From:To:Cc:Subject:Date:From; b=WJdGfnTNdEQ6MVf/hGAbh0JwTqoz1Yh+pYp0k313F/a1j/rorDF8R07LPBEZ0sLKf 6TxIZXJpfRkfiRSg79aTBLrOKodHRWnOYxIzpGNzqukX7W9ZpAjrTaSykO5VbJXU6M rkyXb6XfNgNUexzXDTYxsxC562eZhrAIUbuI29XD8/0xg59FuqKZjrrfxyllWOp+0H pVx0Qmp2Zi2NnZkdXh0MsxAXjpQMVsGoNDFQBesUFz9qP+u5Wtl/oSyI7pmdRGsa5n +v/4jBd7cw61Mw1MmUKzH2i7rF9Ljz955U2e9s4ryWyazVca4ZmDDM7IWpIX6vR9d2 covGiQZeubuTQ== From: Eric Biggers To: linux-fscrypt@vger.kernel.org, fsverity@lists.linux.dev Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, Christian Brauner , Eric Biggers Subject: [PATCH v5 00/13] Move fscrypt and fsverity info out of struct inode Date: Sun, 10 Aug 2025 00:56:53 -0700 Message-ID: <20250810075706.172910-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250810_010010_659745_7D016DFE X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org This is a cleaned-up implementation of moving the i_crypt_info and i_verity_info pointers out of 'struct inode' and into the fs-specific part of the inode, as proposed previously by Christian at https://lore.kernel.org/r/20250723-work-inode-fscrypt-v4-0-c8e11488a0e6@kernel.org/ The high-level concept is still the same: fs/crypto/ and fs/verity/ locate the pointer by adding an offset to the address of struct inode. The offset is retrieved from fscrypt_operations or fsverity_operations. I've cleaned up a lot of the details, including: - Grouped changes into patches differently - Rewrote commit messages and comments to be clearer - Adjusted code formatting to be consistent with existing code - Removed unneeded #ifdefs - Improved choice and location of VFS_WARN_ON_ONCE() statements - Added missing kerneldoc for ubifs_inode::i_crypt_info - Moved field initialization to init_once functions when they exist - Improved ceph offset calculation and removed unneeded static_asserts - fsverity_get_info() now checks IS_VERITY() instead of v_ops - fscrypt_put_encryption_info() no longer checks IS_ENCRYPTED(), since I no longer think it's actually correct there. - verity_data_blocks() now keeps doing a raw dereference - Dropped fscrypt_set_inode_info() - Renamed some functions - Do offset calculation using int, so we don't rely on unsigned overflow - And more. For v4 and earlier, see https://lore.kernel.org/r/20250723-work-inode-fscrypt-v4-0-c8e11488a0e6@kernel.org/ I'd like to take this series through the fscrypt tree for 6.18. (fsverity normally has a separate tree, but by choosing just one tree for this, we'll avoid conflicts in some places.) Eric Biggers (13): fscrypt: replace raw loads of info pointer with helper function fscrypt: add support for info in fs-specific part of inode ext4: move crypt info pointer to fs-specific part of inode f2fs: move crypt info pointer to fs-specific part of inode ubifs: move crypt info pointer to fs-specific part of inode ceph: move crypt info pointer to fs-specific part of inode fs: remove inode::i_crypt_info fsverity: add support for info in fs-specific part of inode ext4: move verity info pointer to fs-specific part of inode f2fs: move verity info pointer to fs-specific part of inode btrfs: move verity info pointer to fs-specific part of inode fs: remove inode::i_verity_info fsverity: check IS_VERITY() in fsverity_cleanup_inode() fs/btrfs/btrfs_inode.h | 5 ++++ fs/btrfs/inode.c | 3 ++ fs/btrfs/verity.c | 2 ++ fs/ceph/crypto.c | 2 ++ fs/ceph/inode.c | 1 + fs/ceph/super.h | 1 + fs/crypto/bio.c | 2 +- fs/crypto/crypto.c | 14 +++++---- fs/crypto/fname.c | 11 +++---- fs/crypto/fscrypt_private.h | 4 +-- fs/crypto/hooks.c | 2 +- fs/crypto/inline_crypt.c | 12 ++++---- fs/crypto/keysetup.c | 43 ++++++++++++++++----------- fs/crypto/policy.c | 7 +++-- fs/ext4/crypto.c | 2 ++ fs/ext4/ext4.h | 8 +++++ fs/ext4/super.c | 6 ++++ fs/ext4/verity.c | 2 ++ fs/f2fs/f2fs.h | 6 ++++ fs/f2fs/super.c | 10 ++++++- fs/f2fs/verity.c | 2 ++ fs/ubifs/crypto.c | 2 ++ fs/ubifs/ubifs.h | 4 +++ fs/verity/enable.c | 6 ++-- fs/verity/fsverity_private.h | 9 +++--- fs/verity/open.c | 23 ++++++++------- fs/verity/verify.c | 2 +- include/linux/fs.h | 10 ------- include/linux/fscrypt.h | 40 +++++++++++++++++++++++-- include/linux/fsverity.h | 57 +++++++++++++++++++++++++++++------- 30 files changed, 215 insertions(+), 83 deletions(-) base-commit: 561c80369df0733ba0574882a1635287b20f9de2 -- 2.50.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/