Hello, this is a proposal, followed by implementation, of new fallocate flag I decided to call "query support" (FALLOC_FL_QUERY_SUPPORT). Currently there is not way to tell which subset of fallocate operations are supported by any given file system, so users have to rely on "just knowing" or trying if it works or not. This patchset introduces the new FALLOC_FL_QUERY_SUPPORT fallocate mode implements it in couple of file systems and takes advantage of this new flag in loop driver where we can finally test specifically for punch hole (and zero range) rather than just relying on mere existence of fallocate callback. When FALLOC_FL_QUERY_SUPPORT mode is specified with offset and length set to zero it returns bitmask with all fallocate mode flags supported for a given file. Because of this I also had to introduce additional flag for the original fallocate mode (preallocation: mode = 0). I expect that in many file systems the implementation will be straightforward and once we can agree on this I plan to implement this for other file systems with fallocate support. In ext4 (and this may be true for other file systems as well) supported modes can differ from file to file depending on the features (like extents and encryption). Because of that I decided to make it return all the modes supported by the particular file, not file system. This might complicate implementation for some file systems, however I think this will be beneficial. Thoughts ? Thanks! -Lukas