NetBSD Problem Report #60800

From wiz@netbsd.org  Sat Sep 26 14:31:14 2026
Return-Path: <wiz@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id AD4961A923E
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 26 Sep 2026 14:31:14 +0000 (UTC)
Message-Id: <20260926143114.685978558B@mail.netbsd.org>
Date: Sat, 26 Sep 2026 14:31:14 +0000 (UTC)
From: wiz@NetBSD.org
Reply-To: wiz@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: tmpfs: missing ctime updates
X-Send-Pr-Version: 3.95
X-From4GNATS: "wiz@NetBSD.org via gnats" <gnats-admin@NetBSD.org>

>Number:         60800
>Category:       kern
>Synopsis:       tmpfs: missing ctime updates
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 26 14:35:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Sat Sep 26 22:10:01 +0000 2026
>Originator:     Thomas Klausner
>Release:        NetBSD 11.99.8
>Organization:

>Environment:


Architecture: x86_64
Machine: amd64
>Description:
While testing coreutils 9.12 on -current we noticed that 'touch'
doesn't change the ctime on tmpfs, but does change it on ffs.

The script:

#!/bin/sh
touch a || fail=1
btime=$(stat -f %B a) || fail=1
atime=$(stat -f %a a) || fail=1
ctime=$(stat -f %c a) || fail=1
mtime=$(stat -f %m a) || fail=1
echo $btime $atime $ctime $mtime

Running this twice on tmpfs gives:

# ~/nbtest.sh
1790414618 1790414618 1790414618 1790414618
# ~/nbtest.sh
1790414618 1790414620 1790414618 1790414620

Same ctime.

It's different on ffs:

# ./nbtest.sh
1790414514 1790414604 1790414604 1790414604
# ./nbtest.sh
1790414514 1790414611 1790414611 1790414611

Different ctime.

https://pubs.opengroup.org/onlinepubs/9799919799/functions/futimens.html

has

"Upon successful completion, futimens() and utimensat() shall mark the
last file status change timestamp for update, with the exception that
if both tv_nsec fields are set to UTIME_OMIT, the file status change
timestamp need not be marked for update."

where I think that 'last file status change timestamp' refers to
ctime, and so I think this reads as 'it should be updated as well'.

Either way, it should be consistent between tmpfs and ffs.
>How-To-Repeat:
See above.
>Fix:
gdt said in the thread on current-users:

> I think updating ctime is missing in
> 
>   src/sys/fs/tmpfs_subr.c:tmpfs_chtimes()
> 
> and probably needs
> 
>   tmpfs_update(vp, TMPFS_UPDATE_CTIME);

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 26 Sep 2026 15:42:26 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-11, pullup-10 once the testbed runs


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src/tests/fs/vfs
Date: Sat, 26 Sep 2026 15:40:15 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 15:40:15 UTC 2026

 Modified Files:
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 t_vnops: Verify that utimes updates ctime, if applicable.

 PR kern/60800: tmpfs: missing ctime updates


 To generate a diff of this commit:
 cvs rdiff -u -r1.63 -r1.64 src/tests/fs/vfs/t_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src
Date: Sat, 26 Sep 2026 15:40:55 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 15:40:55 UTC 2026

 Modified Files:
 	src/sys/fs/tmpfs: tmpfs_subr.c
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 tmpfs: Update ctime on utimes(2).

 PR kern/60800: tmpfs: missing ctime updates


 To generate a diff of this commit:
 cvs rdiff -u -r1.117 -r1.118 src/sys/fs/tmpfs/tmpfs_subr.c
 cvs rdiff -u -r1.64 -r1.65 src/tests/fs/vfs/t_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src
Date: Sat, 26 Sep 2026 15:41:14 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 15:41:14 UTC 2026

 Modified Files:
 	src/sys/fs/sysvbfs: sysvbfs_vnops.c
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 sysvbfs: Update ctime on utimes(2).

 PR kern/60800: tmpfs: missing ctime updates


 To generate a diff of this commit:
 cvs rdiff -u -r1.69 -r1.70 src/sys/fs/sysvbfs/sysvbfs_vnops.c
 cvs rdiff -u -r1.65 -r1.66 src/tests/fs/vfs/t_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src
Date: Sat, 26 Sep 2026 15:41:26 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 15:41:26 UTC 2026

 Modified Files:
 	src/sys/fs/v7fs: v7fs_vnops.c
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 v7fs: Update ctime on utimes(2).

 PR kern/60800: tmpfs: missing ctime updates


 To generate a diff of this commit:
 cvs rdiff -u -r1.38 -r1.39 src/sys/fs/v7fs/v7fs_vnops.c
 cvs rdiff -u -r1.66 -r1.67 src/tests/fs/vfs/t_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src/tests/fs
Date: Sat, 26 Sep 2026 15:41:52 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 15:41:52 UTC 2026

 Modified Files:
 	src/tests/fs/puffs/h_dtfs: dtfs_vnops.c
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 dtfs: Update ctime on utimes(2).

 PR kern/60800: tmpfs: missing ctime updates


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.11 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
 cvs rdiff -u -r1.67 -r1.68 src/tests/fs/vfs/t_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src/tests/fs/vfs
Date: Sat, 26 Sep 2026 22:02:30 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 22:02:30 UTC 2026

 Modified Files:
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 t_vnops: Verify ctime changes but birthtime doesn't.

 PR kern/60800: missing ctime updates
 PR kern/60801: confusion of ctime with birthtime


 To generate a diff of this commit:
 cvs rdiff -u -r1.68 -r1.69 src/tests/fs/vfs/t_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src
Date: Sat, 26 Sep 2026 22:02:44 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 22:02:44 UTC 2026

 Modified Files:
 	src/sys/fs/sysvbfs: sysvbfs_vnops.c
 	src/sys/fs/v7fs: v7fs_vnops.c
 	src/tests/fs/vfs: t_vnops.c

 Log Message:
 sysvbfs, v7fs: More ctime fixes.

 PR kern/60800: missing ctime updates


 To generate a diff of this commit:
 cvs rdiff -u -r1.70 -r1.71 src/sys/fs/sysvbfs/sysvbfs_vnops.c
 cvs rdiff -u -r1.39 -r1.40 src/sys/fs/v7fs/v7fs_vnops.c
 cvs rdiff -u -r1.69 -r1.70 src/tests/fs/vfs/t_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60800 CVS commit: src/sys/fs/sysvbfs
Date: Sat, 26 Sep 2026 22:09:28 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Sep 26 22:09:28 UTC 2026

 Modified Files:
 	src/sys/fs/sysvbfs: sysvbfs_vnops.c

 Log Message:
 sysvbfs: Fix mistake in previous ctime fix.

 Third time's the charm, right?

 PR kern/60800: missing ctime updates


 To generate a diff of this commit:
 cvs rdiff -u -r1.71 -r1.72 src/sys/fs/sysvbfs/sysvbfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.