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=1796061293; b=kGjM8z2K9/luZeQDkOb1z0zH0GlHjGVe/a82Chxj8YrhlzPaOTHXpxRNQ3z+Xm6nFl0/ BgZBmYkoy3LpbHP7TA40/S1DwL+BQRUlLnRaJ1Mhtq1lO9QUL/DTny2ehVqnG/bCqzx0H RZQLzUxjMJFwhv7LdrINb/cK++gBl0CUhwdbBXgjSVI6ZjSRQvQHyJzXq+2rLNwWBqh2T xHxAauvef+rfgyjqz6z9Xn3UUxzK1k9etkdQleZeoAwbr4bDBR/uDnkqB65ZdJD7nb2uJ J7JNfM6SG3oOyYYogV6tYgshsOAH6oyQI8HvU53lP8h76CuaeKbMw1l3vQ8zI/x8r2w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796061293; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=TDVbqaltJHFvOcqQLVDq6Jp9Ym5In8LVXR0r7AZTIsA=; b=jgRqsqUYMgxZ9zJLagVJXEhKyfSbG+1LmOcFppjLeyNEaoyb78L/x7Tw5JA8qWa1iULL XRu9kWL1+LlwVopk6j/+pZefIpCiJQzc3IrJGwOxtFsn0E3782Y5ifB0O9hWcH7WmFjOt bXq/u07Htdk43SM46wDCk6lmafwc1W0j9Vhiy9n10mJ8KLxo8EYVjOonK8YOBXGlpdTjG r66gSE3lfgAaiSeJDIwe6odKCJlNMqfvTV700WB/myg2pMyu0pXKYE0nnGUNNNacsvmyZ chci+hJva4Jdo+Xs4W5Ek/8kRxgaIWabwc3siGznsUOY6O7Y2O9zPP0njkMhmj90G9Q== 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=U5kUQ6nx; 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 CB699606A31C for ; Mon, 30 Nov 2026 17:54:53 +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=U5kUQ6nx Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F96A1F000C1; Mon, 30 Nov 2026 17:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796061293; bh=TDVbqaltJHFvOcqQLVDq6Jp9Ym5In8LVXR0r7AZTIsA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=U5kUQ6nxaGkz2GjDIOa1GLzEOgGEqFGuMEOwky32zsD+pY1SWXsNq4UM1h8KlvKfZ IdkSi5nfrcDQ1DjSs4Guig7Wnmyp6O74DNX+XIY8MRjFpEv5vzJleStPigVEYixfCR IeXVErAVOFtHInagXaJSKF5wYkUJ/rEIUISxBTKqM5WyfMEg0PTdLQPZHv/4AfC5y+ BNixsfpu/VerrGEj/I9YrG+pxN5Nti1XkwrB/cAdE2IHwOBfCCT9PsRTeseK4eUiH/ S7WnEK39MQFkplkdv1DrVauWr29RzGIQnCJ3tdYqxrvtoZdtf4gCTQddTeV5JqKq10 vv6mqA1NqM47Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 2/2] ext4: track truncated block range in ext4_truncate() for fast commit Reply-To: sashiko-reviews@lists.linux.dev To: "Xing Ma" , linux-ext4@vger.kernel.org Cc: tytso@mit.edu In-Reply-To: <20261201013742.1563067-3-maxing.lan@bytedance.com> References: <20261201013742.1563067-1-maxing.lan@bytedance.com> <20261201013742.1563067-3-maxing.lan@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 17:54:53 +0000 X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] ext4: missing ES hole entry in ext4_truncate() forces fast commit fallback -- commit 1366fe063363ad292213a9db24e8bfd6ed620257 Author: Xing Ma ext4: track truncated block range in ext4_truncate() for fast commit This commit calls ext4_fc_track_range() in ext4_truncate() so that fast commit tracks the truncated logical block range from start_lblk to EXT_MAX_BLOCKS - 1. > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 07a62d8569d31..22560318d2348 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -5608,6 +5608,15 @@ int ext4_truncate(struct inode *inode) > if (err) > goto out_stop; > =20 > + if (!ext4_handle_is_aborted(handle)) { > + ext4_lblk_t start_lblk; > + > + start_lblk =3D inode->i_size > 0 ? > + (inode->i_size - 1) >> inode->i_blkbits : 0; > + ext4_fc_track_range(handle, inode, start_lblk, > + EXT_MAX_BLOCKS - 1); > + } [Severity: Medium] Does tracking [start_lblk, EXT_MAX_BLOCKS - 1] here cause ext4_fc_snapshot_inode_data() to fail with -EAGAIN instead of emitting EXT4_FC_TAG_DEL_RANGE? Unlike ext4_punch_hole(), which inserts an EXTENT_STATUS_HOLE entry into i_es_tree after removing extents, ext4_ext_truncate() only removes extent status entries in [last_block, EXT_MAX_BLOCKS - 1]: fs/ext4/extents.c:ext4_ext_truncate() { ... last_block =3D (inode->i_size + sb->s_blocksize - 1) >> EXT4_BLOCK_SIZE_BITS(sb); ext4_es_remove_extent(inode, last_block, EXT_MAX_BLOCKS - last_block); ... } When ext4_fc_snapshot_inode_data() walks the tracked range and reaches last_block, ext4_es_lookup_extent() finds no extent status entry and returns 0, which records EXT4_FC_SNAP_ERR_ES_MISS and aborts the fast commit into a full journal commit via jbd2_fc_end_commit_fallback(). This also causes a same-size ftruncate() followed by fsync() to fall back to a full commit even when no blocks existed beyond i_size. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201013742.1563= 067-1-maxing.lan@bytedance.com?part=3D2