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=1796230678; b=OZCVsjIhkRUeG8Nt4Fjd2Zv8gVqle00pbudYEfDmA+IX5NqfnqT1eRHa8EukfFumimPd Aa5BUcT5t/duajVnyvSS9+CJ5x+JleX/8nZK1D1m9MFlFLyeoUHqps4IXAlqekzm8s9RP 5+ulDuTyuVtJjwkfHX1ogwbgItPPNkCV77FKr6QSXoOIhtXj9bDMaWo+CXLMw+6WhDgEK PzcQ7SKizntlS7N1F/Mf5ZLfaSz+lgwOSBRDsoxMt5ogJ8hG+kM9xrY9ovtLicMVIWTkI 69NahRhYiNuTncaYkpIxPp+CmiNGiOLzMomk72g2Yh37//+cB9dMop0jpYw9D3VLusA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796230678; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=b2SBl9/Tsl3k8c196AyWWRA86ZP4i+TTnelhECsJT68=; b=L7iU5+b25dP+UNKqtztRb/Ml0cnL/i3VdIfDb8Q/1+5g7hXIB1UwLIjo+vNzeRYGasPD iY7OfrAV/kWlfUpre/6kyYR0TV2BYjvJbrTraTCxq2AeA+HLIiZfWFoIcgn7f/Y/Ga38X qG+TKlhFxI1ZWf7qLa7mQ/UEeRcOtrVOaAsZ2ZZUCr9hQSucy4lvAgR824hwEUFmqqT0r BxOq4N88m6RispqBFSoQ6o/z/9iqPmkReq2vcuG/TDOgLGpIoAmtWuFPifQCKmVL+AkSX Q7IKI31AUNI40hAAacDswG2w2qy4eiBFUFq+dpZp6KTkW3qiCBEWj7/6RZP7fazYWNg== 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=HARm27jt; 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 C936A606A329; Wed, 2 Dec 2026 16:57:58 +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=HARm27jt Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81F2B1F00899; Wed, 2 Dec 2026 16:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796230678; bh=b2SBl9/Tsl3k8c196AyWWRA86ZP4i+TTnelhECsJT68=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HARm27jtvrftUkt6d6XCJPF1B5Hkyrv08esBAFmDHHLhebSSSJYOif9fXE9MRKxbE 2J/9TUEi+3/Gn9WsByaQFBnyWcd6rFLwB4s59TtP2SykLrszU/MoGlDdGSqyfSxs9T KwvhjwvvHx42F4reRTIguCWHelT8F09Q0XmyYVB/xsGB9UhVZDrCmrO+dv1UnIyw1r 6LYSh9P1q53o8A/8PeUJ+1/0YwY7JPpQzPWFFE4uZ2qESDC6e4EcMtFb5eoXRdNNxY ZgwFh8egeC0om8HgpPaLaiWZ5aJOfV0g5OO9wSO7ibYdMAV1SdMS4pT325xcC19IiB 8/tT2xPTpBWzg== 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 05/23] iomap: use fsverity_is_building() to check for fsverity IO Date: Wed, 2 Dec 2026 17:56:35 +0100 Message-ID: <20261202165653.767961-6-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: fsverity@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Recently, inode gained new I_VERITY_BUILDING flag. This flag indicates that inode is undergoing fsverity metadata construction. Previously, it was indicated by stale iomap flag on the IO, now we can check the inode instead. Signed-off-by: Andrey Albershteyn --- fs/iomap/buffered-io.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 25915c0f5e1c..3e91b4849c7b 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1950,16 +1950,13 @@ static int iomap_writeback_range(struct iomap_writepage_ctx *wpc, * i_size, adjust end_pos and zero all data beyond i_size. Don't skip fsverity * folios as those are beyond i_size. */ -static bool iomap_writeback_handle_eof(struct folio *folio, - struct iomap_writepage_ctx *wpc, u64 *end_pos) +static bool iomap_writeback_handle_eof(struct folio *folio, struct inode *inode, + u64 *end_pos) { - struct inode *inode = wpc->inode; u64 isize = i_size_read(inode); - if (wpc->iomap.flags & IOMAP_F_FSVERITY) { - WARN_ON_ONCE(folio_pos(folio) < isize); + if (fsverity_is_building(inode) && folio_pos(folio) >= isize) return true; - } if (*end_pos > isize) { size_t poff = offset_in_folio(folio, isize); @@ -2026,7 +2023,7 @@ int iomap_writeback_folio(struct iomap_writepage_ctx *wpc, struct folio *folio) trace_iomap_writeback_folio(inode, pos, folio_size(folio)); - if (!iomap_writeback_handle_eof(folio, wpc, &end_pos)) + if (!iomap_writeback_handle_eof(folio, inode, &end_pos)) return 0; WARN_ON_ONCE(end_pos <= pos); -- 2.54.0