From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796230682; b=bD0aGTqr/Sizru3BgE4X/AQfQkv+VpKuXxS6GO/yDJFSnMlA4RW5+7CwZlJK+NHQ5iax Zmo3TfMH1HCrGMfj38f0eWWtz4j9TNHgRHExVDjHXNqo3Xo5rbCOa1MJzkmJBiFUqEBpa kVkLCcqrGHr+oUHFZqQ56eIabBAhtqMvWYuivgQKtYSSouUGimfvyLhhpbn7JMEpKbpKB oIH1LH5l8z5G5ziBB0Lg1MEs5u7vRS9kMP67WA15OgTKeaS+sbRe2Ho3XQnZxnn0x1n07 mRicHDU+ia2dqqv/OkDOGoYlELIbuVquIovMiNPSh+u6p/pAGp708WtJQDigqowFxvw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796230682; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=lizTcuSYWUIopycLWQe3gYcaIwLecJSICxRsK0lO5ko=; b=HGqg7n2GJbFCeJbBgtqZOucjr+FLm0GDpgJF8FZt5+iqZjB7auyvCpH7eMuVfLezf/bG 8q+2AQO7ZCc6/U29KIAP5UGKJgWCoVc123vWRniDBGlyOmdUGRgrmhspBRosrOfI9EFKo BTY/vAxI+qWSnB3IBKtBbXI+pTaGFM53hfhAkUad+3NpjrUcmbxnOzppJGP1MzeSRYwBJ Vf/IV+bDR4xOFkID0uhKL4F70i4KtygZEy+DbKrojST6LCr/2RGaBSyP1hZDfkel4C9nn yjfRNokDJZvrSlQZAdFsTVMTXpoDnlSI+hYw5X+RPT9JlmEHjSzdanYUjSQBd1+Lu3Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DcjwBFDx; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 000D5606A323; Wed, 2 Dec 2026 16:58:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DcjwBFDx Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1ABB31F00899; Wed, 2 Dec 2026 16:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796230681; bh=lizTcuSYWUIopycLWQe3gYcaIwLecJSICxRsK0lO5ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DcjwBFDxGs4mLctIJdtkatnxASZS/O+C5qmZ2BbciqWVupNiGfHDQg+5zf3Q1fJFq TIUTmm5cEPqkbsvEguTdaeJd0FLpcdD6qKDMNgmEUpfUf+LHLO6Vh3CaoAj+KuyZnH kVHN5xf9C0OeR8xCfH52SD1NNyG9Q+fwI7l+gBBp64B4ifwSH22t1JEdSQL4KhQuNs y49siVlpjhlcBLd0xPQ1voucyBTtapasi+6FGH5uHC2JcL1Y72DX6c9nV2NwoPVJ9O IAtsqd/V0sb4sXxlEKFPOge2FEy+gMEucYjiV1j0r/OfjG3QSWri9tqiOViakJC4lR 7XHCp+YLPKKRA== From: Andrey Albershteyn To: "fsdevel" , "linux-ext4" , "linux-btrfs" , "linux-f2fs" , "Eric Biggers" , "Christoph Hellwig" , "Carlos Maiolino" , "fsverity" , "linux-xfs" Cc: "Christian Brauner" , Andrey Albershteyn , david@fromorbit.com Subject: [PATCH v20 06/23] btrfs: use I_VERITY_BUILDING instead of private flags Date: Wed, 2 Dec 2026 17:56:36 +0100 Message-ID: <20261202165653.767961-7-aalbersh@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261202165653.767961-1-aalbersh@kernel.org> References: <20261202165653.767961-1-aalbersh@kernel.org> X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Now that the VFS tracks an inode whose Merkle tree is under construction via I_VERITY_BUILDING and handles the concurrent-enable guard in the generic fs-verity enable path, drop the inode runtime flags that duplicated this. btrfs only used BTRFS_INODE_VERITY_IN_PROGRESS internally, so remove it outright. Signed-off-by: Andrey Albershteyn Reviewed-by: Christoph Hellwig --- fs/btrfs/btrfs_inode.h | 7 ------- fs/btrfs/verity.c | 12 ++---------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 0782f917fccc..5c752b947b56 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -78,13 +78,6 @@ enum { * the file range, inode's io_tree). */ BTRFS_INODE_NO_DELALLOC_FLUSH, - /* - * Set when we are working on enabling verity for a file. Computing and - * writing the whole Merkle tree can take a while so we want to prevent - * races where two separate tasks attempt to simultaneously start verity - * on the same file. - */ - BTRFS_INODE_VERITY_IN_PROGRESS, /* Set when this inode is a free space inode. */ BTRFS_INODE_FREE_SPACE_INODE, /* Set when there are no capabilities in XATTs for the inode. */ diff --git a/fs/btrfs/verity.c b/fs/btrfs/verity.c index 79ace98714ad..c7eec8886e49 100644 --- a/fs/btrfs/verity.c +++ b/fs/btrfs/verity.c @@ -461,7 +461,6 @@ static int rollback_verity(struct btrfs_inode *inode) btrfs_assert_inode_locked(inode); truncate_inode_pages(inode->vfs_inode.i_mapping, inode->vfs_inode.i_size); - clear_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &inode->runtime_flags); ret = btrfs_drop_verity_items(inode); if (ret) { btrfs_handle_fs_error(root->fs_info, ret, @@ -513,7 +512,6 @@ static int rollback_verity(struct btrfs_inode *inode) * - mark the inode with the verity flag * - delete the orphan item * - mark the ro compat bit - * - clear the in progress bit * * Returns 0 on success, negative error code on failure. */ @@ -555,7 +553,6 @@ static int finish_verity(struct btrfs_inode *inode, const void *desc, goto end_trans; /* Now that rollback is no longer possible, set S_VERITY. */ btrfs_sync_inode_flags_to_i_flags(inode); - clear_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &inode->runtime_flags); btrfs_set_fs_compat_ro(root->fs_info, VERITY); end_trans: if (ret) @@ -570,8 +567,8 @@ static int finish_verity(struct btrfs_inode *inode, const void *desc, * * @filp: file to enable verity on * - * Begin enabling fsverity for the file. We drop any existing verity items, add - * an orphan and set the in progress bit. + * Begin enabling fsverity for the file. We drop any existing verity items and + * add an orphan. * * Returns 0 on success, negative error code on failure. */ @@ -587,9 +584,6 @@ static int btrfs_begin_enable_verity(struct file *filp) if (IS_ENCRYPTED(&inode->vfs_inode)) return -EOPNOTSUPP; - if (test_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &inode->runtime_flags)) - return -EBUSY; - /* * This should almost never do anything, but theoretically, it's * possible that we failed to enable verity on a file, then were @@ -606,8 +600,6 @@ static int btrfs_begin_enable_verity(struct file *filp) return PTR_ERR(trans); ret = btrfs_orphan_add(trans, inode); - if (!ret) - set_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &inode->runtime_flags); btrfs_end_transaction(trans); return ret; -- 2.54.0