Skip to contentSkip to conversation

why not break the EOF limit of fallocate

QUESTION Miao Xie 1 participant 1 message Dec 4, 2012 Util-Linux package

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

Hi, everyone.

I have a question about the punch hole function of fallocate. According to the manual of fallocate command, the hole that we want to punch should not exceed the end of the file, so my question is why do we forbid fallocate punching a hole that past EOF?

As we know, we can pre-allocate some space past EOF by fallocate command. I think punch-hole of fallocate is the most natural approach to reclaim that space. Though the manual says truncate command can do the same thing, it is a bit complex, especially we just want to reclaim the front end of that space.

I find the code of fallocate command doesn't has this limit(fallocate code doesn't check the range of hole), so I hope we can remove the limit in the manual if it is possible.

Thanks
Miao