Closed Tuupertunut closed 3 years ago
Version: 2.1
How to reproduce:
rodir
rwdir
mountpoint
foo
-o cow rwdir=rw:rodir=ro
stat mountpoint/foo
echo -n > mountpoint/foo
Expected behavior: The file was not actually written to or accessed, so modify and access timestamps should remain the same.
Actual behavior: The modify and access timestamps are truncated to second precision, the nanosecond part has been lost.
Cause: https://github.com/rpodgorny/unionfs-fuse/blob/30c745ca6614d82b74742f025755982b91b2c41f/src/cow_utils.c#L68-L73 Here the st_atime and st_mtime fields only contain timestamps with second precision. Also the utime() system call only modifies timestamps with second precision.
st_atime
st_mtime
utime()
Version: 2.1
How to reproduce:
rodir
,rwdir
andmountpoint
.foo
insiderodir
.-o cow rwdir=rw:rodir=ro
and mount it tomountpoint
.stat mountpoint/foo
and notice the access and modify timestamps.echo -n > mountpoint/foo
, nowfoo
gets copied torwdir
but is not actually written to or accessed.stat mountpoint/foo
again.Expected behavior: The file was not actually written to or accessed, so modify and access timestamps should remain the same.
Actual behavior: The modify and access timestamps are truncated to second precision, the nanosecond part has been lost.
Cause: https://github.com/rpodgorny/unionfs-fuse/blob/30c745ca6614d82b74742f025755982b91b2c41f/src/cow_utils.c#L68-L73 Here the
st_atime
andst_mtime
fields only contain timestamps with second precision. Also theutime()
system call only modifies timestamps with second precision.