もっと詳しく

Filesystem developers tend to disagree with each other about many things,
but they are nearly unanimous in their dislike for the truncate()
system call, which chops data off the end of a file. Implementing
truncate() tends to be full of traps for the unwary — the kind of
traps that can lead to lost data. But it turns out that a similar
operation, called “hole punching”, may be worse. This operation has been
subject to difficult-to-hit but real race conditions in many filesystems
for years; this
patch set from Jan Kara
may finally be at a point where it can fill the
hole in hole punching.