Commit e1d227a
btrfs: Handle unaligned length in extent_same
The extent-same code rejects requests with an unaligned length. This
poses a problem when we want to dedupe the tail extent of files as we
skip cloning the portion between i_size and the extent boundary.
If we don't clone the entire extent, it won't be deleted. So the
combination of these behaviors winds up giving us worst-case dedupe on
many files.
We can fix this by allowing a length that extents to i_size and
internally aligining those to the end of the block. This is what
btrfs_ioctl_clone() so we can just copy that check over.
Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Chris Mason <clm@fb.com>1 parent 070034b commit e1d227a
1 file changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2889 | 2889 | | |
2890 | 2890 | | |
2891 | 2891 | | |
2892 | | - | |
| 2892 | + | |
| 2893 | + | |
2893 | 2894 | | |
| 2895 | + | |
2894 | 2896 | | |
2895 | 2897 | | |
2896 | | - | |
| 2898 | + | |
2897 | 2899 | | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
2898 | 2905 | | |
2899 | 2906 | | |
2900 | 2907 | | |
2901 | 2908 | | |
2902 | 2909 | | |
2903 | 2910 | | |
2904 | 2911 | | |
2905 | | - | |
| 2912 | + | |
2906 | 2913 | | |
2907 | 2914 | | |
2908 | 2915 | | |
| 2916 | + | |
2909 | 2917 | | |
2910 | 2918 | | |
2911 | 2919 | | |
| |||
2920 | 2928 | | |
2921 | 2929 | | |
2922 | 2930 | | |
2923 | | - | |
| 2931 | + | |
2924 | 2932 | | |
2925 | 2933 | | |
2926 | 2934 | | |
2927 | | - | |
| 2935 | + | |
2928 | 2936 | | |
2929 | 2937 | | |
2930 | 2938 | | |
| |||
2937 | 2945 | | |
2938 | 2946 | | |
2939 | 2947 | | |
2940 | | - | |
| 2948 | + | |
2941 | 2949 | | |
2942 | 2950 | | |
2943 | 2951 | | |
| |||
0 commit comments