From: "Darrick J. Wong" <djwong@kernel.org>
To: Long Li <leo.lilong@huawei.com>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org, david@fromorbit.com,
yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com,
lonuxli.64@gmail.com
Subject: Re: [PATCH 1/4] xfs: only assert new size for datafork during truncate extents
Date: Mon, 9 Mar 2026 09:39:38 -0700 [thread overview]
Message-ID: <20260309163938.GH6033@frogsfrogsfrogs> (raw)
In-Reply-To: <20260309082752.2039861-2-leo.lilong@huawei.com>
On Mon, Mar 09, 2026 at 04:27:49PM +0800, Long Li wrote:
> The assertion functions properly because we currently only truncate the
> attr to a zero size. Any other new size of the attr is not preempted.
> Make this assertion is specific to the datafork, preparing for
> subsequent patches to truncate the attribute to a non-zero size.
>
> Signed-off-by: Long Li <leo.lilong@huawei.com>
LGTM
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_inode.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 50c0404f9064..beaa26ec62da 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -1048,7 +1048,8 @@ xfs_itruncate_extents_flags(
> xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
> if (icount_read(VFS_I(ip)))
> xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL);
> - ASSERT(new_size <= XFS_ISIZE(ip));
> + if (whichfork == XFS_DATA_FORK)
> + ASSERT(new_size <= XFS_ISIZE(ip));
> ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
> ASSERT(ip->i_itemp != NULL);
> ASSERT(ip->i_itemp->ili_lock_flags == 0);
> --
> 2.39.2
>
>
next prev parent reply other threads:[~2026-03-09 16:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 8:27 [PATCH 0/4] xfs: close crash window in attr dabtree inactivation Long Li
2026-03-09 8:27 ` [PATCH 1/4] xfs: only assert new size for datafork during truncate extents Long Li
2026-03-09 16:39 ` Darrick J. Wong [this message]
2026-03-09 8:27 ` [PATCH 2/4] xfs: factor out xfs_da3_node_entry_remove Long Li
2026-03-09 16:42 ` Darrick J. Wong
2026-03-10 2:15 ` Long Li
2026-03-10 11:58 ` Long Li
2026-03-10 14:38 ` Darrick J. Wong
2026-03-09 8:27 ` [PATCH 3/4] xfs: factor out xfs_attr3_leaf_init Long Li
2026-03-09 16:44 ` Darrick J. Wong
2026-03-10 7:42 ` Long Li
2026-03-09 8:27 ` [PATCH 4/4] xfs: close crash window in attr dabtree inactivation Long Li
2026-03-09 16:59 ` Darrick J. Wong
2026-03-10 8:19 ` Long Li
2026-03-10 14:46 ` Darrick J. Wong
2026-03-11 2:34 ` Long Li
2026-03-13 14:46 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260309163938.GH6033@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=david@fromorbit.com \
--cc=houtao1@huawei.com \
--cc=leo.lilong@huawei.com \
--cc=linux-xfs@vger.kernel.org \
--cc=lonuxli.64@gmail.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox