Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: cem@kernel.org, stable@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/6] xfs: clamp timestamp nanoseconds correctly
Date: Tue, 14 Jul 2026 09:34:31 -0700	[thread overview]
Message-ID: <20260714163431.GD7398@frogsfrogsfrogs> (raw)
In-Reply-To: <20260714061557.GF1072@lst.de>

On Tue, Jul 14, 2026 at 08:15:57AM +0200, Christoph Hellwig wrote:
> On Mon, Jul 13, 2026 at 11:07:15PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > LOLLM noticed an off-by-one error in the nsec clamping; fix that so that
> > we never have tv_nsec == 1e9.
> 
> Hah..  
> 
> >  {
> > -	ts->tv_nsec = clamp_t(long, ts->tv_nsec, 0, NSEC_PER_SEC);
> > +	ts->tv_nsec = clamp_t(long, ts->tv_nsec, 0, NSEC_PER_SEC - 1);
> >  	*ts = timestamp_truncate(*ts, VFS_I(ip));
> 
> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> But I'd really expect this would be handled by core timing/timestamp
> helpers.

I'd have thought so too, but timestamp_truncate doesn't clamp tv_nsec to
[0, 1e9) because it assumes that callers (mostly the vfs) already did
that.

--D

  reply	other threads:[~2026-07-14 16:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  6:04 [PATCHSET 2/2] xfs: LLM-inspired bug fixes, part 2 Darrick J. Wong
2026-07-14  6:06 ` [PATCH 1/6] xfs: set xfarray killable sort correctly Darrick J. Wong
2026-07-14  6:11   ` Christoph Hellwig
2026-07-14 16:42     ` Darrick J. Wong
2026-07-14  6:06 ` [PATCH 2/6] xfs: fix off-by-one error when calling xchk_xref_has_rt_owner Darrick J. Wong
2026-07-14  6:12   ` Christoph Hellwig
2026-07-14  6:06 ` [PATCH 3/6] xfs: handle non-inode owners for rtrmap record checking Darrick J. Wong
2026-07-14  6:14   ` Christoph Hellwig
2026-07-14 16:32     ` Darrick J. Wong
2026-07-14  6:06 ` [PATCH 4/6] xfs: fully check the parent handle when it points to the rootdir Darrick J. Wong
2026-07-14  6:14   ` Christoph Hellwig
2026-07-14  6:07 ` [PATCH 5/6] xfs: clamp timestamp nanoseconds correctly Darrick J. Wong
2026-07-14  6:15   ` Christoph Hellwig
2026-07-14 16:34     ` Darrick J. Wong [this message]
2026-07-14  6:07 ` [PATCH 6/6] xfs: don't zap bmbt forks if they are MAXLEVELS tall Darrick J. Wong
2026-07-14  6:16   ` Christoph Hellwig
2026-07-14 16:40     ` 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=20260714163431.GD7398@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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