opnsense-src/sys/fs
Alan Somers 739488cc21 fusefs: fix invalid value for st_birthtime.tv_nsec
If a file system's on-disk format does not support st_birthtime, it
isn't clear what value it should return in stat(2).  Neither our man
page nor the OpenGroup specifies.  But our convention for UFS and
msdosfs is to return { .tv_sec = -1, .tv_nsec = 0 }.  fusefs is
different.  It returns { .tv_sec = -1, .tv_nsec = -1 }.  It's done that
ever since the initial import in SVN r241519.

Most software apparently handles this just fine.  It must, because we've
had no complaints.  But the Rust standard library will panic when
reading such a timestamp during std::fs::metadata, even if the caller
doesn't care about that particular value.  That's a separate bug, and
should be fixed.

Change our invalid value to match msdosfs and ufs, pacifying the Rust
standard library.

PR:		276602
Sponsored by:	Axcient
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D43590

(cherry picked from commit 55b80e2ca52c4b27c4920d372a6e71ac9ab7da9e)
2024-02-12 10:43:11 -07:00
..
autofs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cd9660 sys: Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:17 -06:00
cuse sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
deadfs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
devfs kcmp(2): implement for devfs files 2024-01-30 22:24:43 +02:00
ext2fs Fix build with gcc12. 2023-10-31 08:59:28 -07:00
fdescfs sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fifofs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
fuse fusefs: fix invalid value for st_birthtime.tv_nsec 2024-02-12 10:43:11 -07:00
mntfs sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
msdosfs msdosfs_remount_ro(): correct vfs_unbusy() loop 2024-01-25 05:44:55 +02:00
nfs nfscl: Only update atime for Copy when noatime is not specified 2024-01-19 17:44:23 -08:00
nfsclient nfscl: Only update atime for Copy when noatime is not specified 2024-01-19 17:44:23 -08:00
nfsserver Add vnode_pager_clean_{a,}sync(9) 2024-01-18 02:51:33 +02:00
nullfs nullfs: do not allow bypass on copy_file_range() 2023-12-05 02:43:27 +02:00
procfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pseudofs pseudofs: fix off by one in hash iteration in pfs_purge 2023-11-24 17:22:15 +00:00
smbfs Add vnode_pager_clean_{a,}sync(9) 2024-01-18 02:51:33 +02:00
tarfs vfs: use __enum_uint8 for vtype and vstate 2023-07-05 15:06:30 +00:00
tmpfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
udf sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
unionfs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00