On Wed, Aug 19, 2026 at 08:36:49PM +0200, Vincent Lefevre wrote:
> On 2026-08-19 15:51:42 +0100, Ian Collier via Mutt-dev wrote:
> > This seems to mean that the Linux kernel has changed something about
> > how the time is obtained when touching a file;

> In my Debian bug report against the Linux kernel, Salvatore Bonaccorso
> thinks that this is due to

>   
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4e40eff0b5737c
>   "fs: add infrastructure for multigrain timestamps".

Yes, this seems relevant.  According to that, the Linux VFS used to
use coarse timestamps always.  Thus obviously it always agreed with
the value from time(2), which is also a coarse timestamp.  And now it
sometimes uses fine-grained timestamps, compared with which time(2) is
delayed by one to two milliseconds (although I don't fully understand
which "sometimes" will cause the above commit to use fine-grained
timestamps in our particular example).

> However, is it guaranteed to be less or equal to the time given
> by CLOCK_REALTIME? This is not documented.

I don't know if this counts as documentation:
https://www.kernel.org/doc/html/latest/core-api/timekeeping.html#coarse-and-fast-ns-access

...but in any case the mechanisms by which it could be implemented
would always be skewed towards making CLOCK_REALTIME_COARSE less
than CLOCK_REALTIME if not exactly equal.  That is not to say this
is guaranteed.

> So I would say that the fix for Mutt would be
> 
>  void mutt_stamp_attachment(BODY *a)
>  {
> -  a->stamp = time(NULL);
> +  a->stamp = time(NULL) + 1;
>  }
> 
> as suggested by Kevin.

Agreed.

How many paragraphs of text will be required in the comment explaining why
this +1 was added? :-)

Ian Collier.

Reply via email to