Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #93785

Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency

From Vincent Lefevre <vincent@vinc17.net>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency
Date 2026-08-19 14:00 +0200
Message-ID <NtN7z-bSDS-1@gated-at.bofh.it> (permalink)
References <NsTI5-bnRg-1@gated-at.bofh.it> <NsTI5-bnRg-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


Here's a simple program to reproduce the issue. On my machine,
a difference is output many times every second (apparently,
when the clock is very close to an integer number of seconds).

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/stat.h>

const char fname[] = "timetest.txt";

int main(void)
{
  while (1)
    {
      struct stat st;
      FILE *f;
      time_t t;

      f = fopen(fname, "w");
      if (f == NULL)
        exit(1);
      fclose(f);
      t = time(NULL);
      if (stat(fname, &st) != 0)
        exit(1);
      if (t < st.st_mtime)
        printf("%ld %ld\n", (long) t, (long) st.st_mtime);
    }
}

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Back to linux.debian.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency Vincent Lefevre <vincent@vinc17.net> - 2026-08-19 14:00 +0200
  Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency Vincent Lefevre <vincent@vinc17.net> - 2026-08-19 14:30 +0200
    Processed: Re: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and  time() inconsistency "Debian Bug Tracking System" <owner@bugs.debian.org> - 2026-08-19 14:30 +0200
    Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency Salvatore Bonaccorso <carnil@debian.org> - 2026-08-19 16:00 +0200
      Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency Vincent Lefevre <vincent@vinc17.net> - 2026-08-19 16:30 +0200
        Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency Vincent Lefevre <vincent@vinc17.net> - 2026-08-19 17:20 +0200
          Bug#1144613: linux-image-7.1.6+deb14-amd64: ext4 st_mtime and time() inconsistency Vincent Lefevre <vincent@vinc17.net> - 2026-08-19 19:20 +0200

csiph-web