Re: [PATCH] xfs: use xfs_csn_t for xlog_cil_push_now() push_seq parameter

From: Darrick J. Wong

Date: Thu Jul 02 2026 - 11:58:29 EST


On Thu, Jul 02, 2026 at 07:56:11PM +0800, alexjlzheng@xxxxxxxxx wrote:
> From: Jinliang Zheng <alexjlzheng@xxxxxxxxxxx>
>
> The push_seq argument to xlog_cil_push_now() carries a CIL checkpoint
> sequence number, not a log sequence number (LSN).
>
> Change the parameter type from xfs_lsn_t to xfs_csn_t to correctly
> reflect its semantics and match the surrounding types. Both types are
> int64_t under the hood, so this is a type-annotation fix with no
> behavioural change.
>
> Signed-off-by: Jinliang Zheng <alexjlzheng@xxxxxxxxxxx>

I wonder, did you find with some tool? And would it be useful to add
__bitwise to the typedef so that static checkers will find the places
where we screw this up?

Regardless, this is correct so
Reviewed-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>

--D

> ---
> fs/xfs/xfs_log_cil.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
> index edc368938f30..639f875a8fb2 100644
> --- a/fs/xfs/xfs_log_cil.c
> +++ b/fs/xfs/xfs_log_cil.c
> @@ -1710,7 +1710,7 @@ xlog_cil_push_background(
> static void
> xlog_cil_push_now(
> struct xlog *log,
> - xfs_lsn_t push_seq,
> + xfs_csn_t push_seq,
> bool async)
> {
> struct xfs_cil *cil = log->l_cilp;
> --
> 2.43.7
>
>