Replace fiemap_check_flags with a fiemap_prep helper that also takes the inode and mapped range, and performs the sanity check and truncation previously done in fiemap_check_range. This way the validation is inside the file system itself and thus properly works for the stacked overlayfs case as well.
Showing the changes to include/linux (1 of 10 files). Show all
Unified · Split
| @@ -13,9 +13,10 @@ struct fiemap_extent_info { · 12 unmodified lines | |||
| 13 | fiemap_extent array */ | 13 | fiemap_extent array */ |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | int fiemap_prep(struct inode *inode, struct fiemap_extent_info *fieinfo, | ||
| 17 | u64 start, u64 *len, u32 supported_flags); | ||
| 16 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | 18 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, |
| 17 | u64 phys, u64 len, u32 flags); | 19 | u64 phys, u64 len, u32 flags); |
| 18 | int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | ||
| 19 | 20 | ||
| 20 | int generic_block_fiemap(struct inode *inode, | 21 | int generic_block_fiemap(struct inode *inode, |
| 21 | struct fiemap_extent_info *fieinfo, u64 start, u64 len, | 22 | struct fiemap_extent_info *fieinfo, u64 start, u64 len, |