On Tue, May 10, 2016 at 09:16:04AM +0800, Qu Wenruo wrote: > In the recent test for new btrfs-convert backward compatibility, I > found that cmds-fi-du.c uses FIEMAP_EXTENT_SHARED bits, which is not > present in kernel of old distributions like RHEL6 (Sorry, didn't > test on openSUSE equivalent). > > Unlike e2fsprogs, we can check its version with pkgconfig, any idea > to avoid such compiling error? #ifndef FIEMAP_EXTENT_SHARED #define FIEMAP_EXTENT_SHARED 0x00002000 #endif This is what I do in duperemove. Many distributions dind't update their kernel header packages for that bit so even though it's in the kernel userspace programs using it won't compile. > And further more, without kernel support for FIEMAP_EXTENT_SHARED, > will fi-du work anymore? RHEL6 says they're using 2.6.32 which is just before the introduction of SHARED. It couild be that they have it though considering there is an immense number of backports done for distro kernels. I would honestly check the source. What we're really looking to see is what version of btrfs they have. With the above patch we would compile and run everywhere. If someone runs an obsolete version of btrfs then fi du won't report any shared extents. This is unfortunate but so is running btrfs from 2.6.32. --Mark -- Mark Fasheh -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
