-
In the posix code for zero, there is a snippet of code in a #ifdef section for linux where you attempt a fallocate call, and if that fails, you return an error. But if it succeeds, the code follows that with actual writing of zeros to the file. I stepped through this in the debugger, after attempting a zero() call and discovering afterwards that the extents() call just returned a single extent for the file. Explicitly writing zeros to those parts of the file will "revive" those sections of the file. It seems like the check is backwards in that #ifdef section, i.e. it should return out of the function on success, and only on failure should it fall back to the explicit writing of zeros. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes you're right. The current implementation is just plain wrong on Linux. I've opened a bug, I'll fix it soon. |
Beta Was this translation helpful? Give feedback.
Yes you're right. The current implementation is just plain wrong on Linux. I've opened a bug, I'll fix it soon.