Commit 85defb9
ext4: fix incorrect punch max_end
[ Upstream commit 29ec9bed2395061350249ae356fb300dd82a78e7 ]
For the extents based inodes, the maxbytes should be sb->s_maxbytes
instead of sbi->s_bitmap_maxbytes. Additionally, for the calculation of
max_end, the -sb->s_blocksize operation is necessary only for
indirect-block based inodes. Correct the maxbytes and max_end value to
correct the behavior of punch hole.
Fixes: 2da3762 ("ext4: limit length to bitmap_maxbytes - blocksize in punch_hole")
Signed-off-by: Zhang Yi <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Reviewed-by: Baokun Li <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: [email protected]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 35bd33e commit 85defb9
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3992 | 3992 | | |
3993 | 3993 | | |
3994 | 3994 | | |
3995 | | - | |
| 3995 | + | |
3996 | 3996 | | |
3997 | 3997 | | |
3998 | 3998 | | |
| |||
4001 | 4001 | | |
4002 | 4002 | | |
4003 | 4003 | | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
4004 | 4011 | | |
4005 | 4012 | | |
4006 | 4013 | | |
4007 | 4014 | | |
4008 | 4015 | | |
4009 | 4016 | | |
4010 | | - | |
4011 | | - | |
| 4017 | + | |
4012 | 4018 | | |
4013 | 4019 | | |
4014 | 4020 | | |
| |||
0 commit comments