Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
According to the Linux documentation, the FALLOC_FL_KEEP_SIZE flag must be set in conjunction with the FALLOC_FL_PUNCH_HOLE flag. The previous logic caused a failure whenever FALLOC_FL_KEEP_SIZE was present. Also, mimic the behavior of other native file systems such as ext4 in cases where the file might be extended. If the offset is beyond the end of the file, return success without changing the file. If the extent of the punched hole would extend the file, only the existing tail of the file is punched. References: https://git.kernel.org/cgit/docs/man-pages/man-pages.git/tree/man2/fallocate.2#n102
- Loading branch information