View Issue Details

IDProjectCategoryView StatusLast Update
0016079CentOS-6filesystempublic2019-05-16 14:38
Reporterhisakatha 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSCentOS 6OS Version6
Product Version6.9 
Target VersionFixed in Version 
Summary0016079: Overwriting a file with an empty string does not update the file's modification timestamp
DescriptionOverwriting a file (either empty or non-empty file) with an empty string does not update the file's modification timestamp (mtime), which can be viewed using `ls -l` or `stat` commands. I think this is a bug. I reproduced the problem in CentOS 6.9 using
(1) system bash (4.1.2(2)) and glibc (2.12)
(2) bash (5.0.3(1)) and glibc (2.23) installed with linuxbrew

The problem was NOT reproduced in
(3) CentOS 7.3.1611, bash (4.2.46(1)), and glibc (2.17) (provided by linuxzoo.net)
(4) Red Hat Enterprise Linux Server release 7.4, bash (4.2.46(2)), and glibc (2.17)
(5) macOS Mojave 10.14.4

Therefore, the problem seems to originate from the kernel (or other libraries?) of CentOS 6.

This problem harms rebuilds with `make`.
Steps To ReproduceIn a terminal:

printf 'hello\n' > hello.txt
stat hello.txt
sleep 5
printf '' > hello.txt
stat hello.txt

Now, you can see the modification timestamp before and after overwriting.
Additional InformationIn my CentOS 6.9, the attribution change time (ctime) was changed after overwriting only if the original file was not empty.

I could not find similar problems at the bug trackers of CentOS, Linux kernel, or glibc.

I don't know which category or severity are correct.
Tagsnfs, NFSv4

Activities

hisakatha

hisakatha

2019-05-16 14:37

reporter   ~0034474

UPDATE:
I've noticed that, even in CentOS 6.9, the problem was NOT reproduced for files in local disks (ext4 or xfs filesystem), while it was reproduced for files in nfs4 disks. Also, I confirmed that the problem was NOT reproduced for files in nfs disks in RHEL 7.4 (env. 4 listed above).
Thus, the problem seems to originate from the nfs library.
Currently, I'm consulting my server administrator about updating the nfs library.
Anyway, I would appreciate it if you would give me helpful information to solve the problem.

Issue History

Date Modified Username Field Change
2019-05-14 10:11 hisakatha New Issue
2019-05-16 14:37 hisakatha Note Added: 0034474
2019-05-16 14:38 hisakatha Tag Attached: nfs
2019-05-16 14:38 hisakatha Tag Attached: NFSv4