title: Is trimming beginning of a file using fallocate with FALLOC_FL_COLLAPSE_RANGE atomic on ext4?
body: <p>I'd like to know what are possible states if system crashes while trimming beginning of a file using fallocate with FALLOC_FL_COLLAPSE_RANGE flag. Is it possible that only part of the blocks we want to trim is absent, and some blocks are still present? If so, are the missing blocks always from the beginning, or can they be somewhere in the middle of range we want to trim?</p>
  <p>The filesystem I'm using is ext4. I tried to get answer to this question from <a href="https://lwn.net/Articles/587819/" rel="nofollow noreferrer">ext4 source code</a>, but I'm not familiar enough with the filesystem to conclude the answer.</p>