Commit 4fbf8bc
ext4: correct best extent lstart adjustment logic
When yangerkun review commit 93cdf49 ("ext4: Fix best extent lstart
adjustment logic in ext4_mb_new_inode_pa()"), it was found that the best
extent did not completely cover the original request after adjusting the
best extent lstart in ext4_mb_new_inode_pa() as follows:
original request: 2/10(8)
normalized request: 0/64(64)
best extent: 0/9(9)
When we check if best ex can be kept at start of goal, ac_o_ex.fe_logical
is 2 less than the adjusted best extent logical end 9, so we think the
adjustment is done. But obviously 0/9(9) doesn't cover 2/10(8), so we
should determine here if the original request logical end is less than or
equal to the adjusted best extent logical end.
In addition, add a comment stating when adjusted best_ex will not cover
the original request, and remove the duplicate assertion because adjusting
lstart makes no change to b_ex.fe_len.
Link: https://lore.kernel.org/r/3630fa7f-b432-7afd-5f79-781bc3b2c5ea@huawei.com
Fixes: 93cdf49 ("ext4: Fix best extent lstart adjustment logic in ext4_mb_new_inode_pa()")
Cc: <stable@kernel.org>
Signed-off-by: yangerkun <yangerkun@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20240201141845.1879253-1-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent d8b945f commit 4fbf8bc
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5172 | 5172 | | |
5173 | 5173 | | |
5174 | 5174 | | |
| 5175 | + | |
5175 | 5176 | | |
5176 | | - | |
5177 | | - | |
5178 | | - | |
| 5177 | + | |
| 5178 | + | |
| 5179 | + | |
| 5180 | + | |
| 5181 | + | |
| 5182 | + | |
| 5183 | + | |
| 5184 | + | |
5179 | 5185 | | |
5180 | 5186 | | |
5181 | 5187 | | |
| |||
5187 | 5193 | | |
5188 | 5194 | | |
5189 | 5195 | | |
5190 | | - | |
| 5196 | + | |
5191 | 5197 | | |
5192 | 5198 | | |
5193 | 5199 | | |
| |||
5197 | 5203 | | |
5198 | 5204 | | |
5199 | 5205 | | |
5200 | | - | |
| 5206 | + | |
5201 | 5207 | | |
5202 | 5208 | | |
5203 | 5209 | | |
5204 | 5210 | | |
5205 | 5211 | | |
5206 | 5212 | | |
5207 | 5213 | | |
5208 | | - | |
5209 | 5214 | | |
5210 | 5215 | | |
5211 | 5216 | | |
| |||
0 commit comments