#990328 Please let "fallocate -d" preserve mtime, and add an option for ctime

Package:
util-linux
Source:
util-linux
Description:
miscellaneous system utilities
Submitter:
Kevin Price
Date:
2021-09-12 12:39:05 UTC
Severity:
wishlist
Tags:
#990328#5
Date:
2021-06-25 20:34:21 UTC
From:
To:
Dear maintainer,

for sparsifying files with blocks of zeros, it's quite convenient to use
"fallocate -d". As of current bullseye util-linux/2.36.1-7 on ext4, this
updates their atime, mtime, and ctime, but preserves their "birth time"
(btime).

I'd like "fallocate -d" to always preserve mtime. To my understanding of
MAC times, mtime should only then be updated when the content of the
file gets modified, which "fallocate -d" definitely never does.

"fallocate -d" should:
 * update atime when reading > 0 bytes (which it does)
 * preserve mtime (which it _falsely_ updates)
 * preserve btime (which it does)
 * ctime: uncertain. (currently it updates it)

Whether "fallocate -d" should update or preserve ctime seems a good
question to me. From my understanding of MAC times, I'd prefer a
command-line switch to preserve or update ctime if desired, and to
update it by default.

So here's my wishlist item for util-linux: Please let "fallocate -d"
adhere to standards and always preserve mtime, and please add a
command-line option to handle ctime as desired by the user. Please bear
in mind that the current behavior regarding mtime counteracts common (or
at least my) understanding.

Please forward this to upstream. Shouldn't be a great deal.

Best
Kevin

#990328#10
Date:
2021-09-09 14:00:42 UTC
From:
To:
* Kevin Price <kp@osnanet.de> [210909 13:59]:

fallocate itself does none of this. It just calls the fallocate
syscall. The kernel decides what to do, and if it considers a
successful fallocate call a modification of the file or not.

If you want this changed, I would suggest you talk to the kernel
folks instead, as it makes no sense for util-linux to override
kernel policy.

  Chris

#990328#15
Date:
2021-09-12 12:26:33 UTC
From:
To:
tags 990328 + wontfix
thanks

Am 09.09.21 um 16:00 schrieb Chris Hofstaedtler:

Thanks for pointing this out to me. I strongly agree that util-linux
should not override kernel policy. Would you please give me hints where
exactly in the kernel community to address this issue?

Best
Kevin