View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0016079||CentOS-6||filesystem||public||2019-05-14 10:11||2019-05-16 14:38|
|Platform||x86_64||OS||CentOS 6||OS Version||6|
|Target Version||Fixed in Version|
|Summary||0016079: Overwriting a file with an empty string does not update the file's modification timestamp|
|Description||Overwriting 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 Reproduce||In a terminal:|
printf 'hello\n' > hello.txt
printf '' > hello.txt
Now, you can see the modification timestamp before and after overwriting.
|Additional Information||In 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.
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.