summaryrefslogtreecommitdiff
path: root/fs/ext4/xattr.c
diff options
context:
space:
mode:
authorBaokun Li <libaokun1@huawei.com>2024-02-01 22:18:45 +0800
committerTheodore Ts'o <tytso@mit.edu>2024-02-21 22:46:39 -0500
commit4fbf8bc733d14bceb16dda46a3f5e19c6a9621c5 (patch)
tree4919ce933ae0246407313c816b76de3c43f636da /fs/ext4/xattr.c
parentd8b945fa475f13d787df00c26a6dc45a3e2e1d1d (diff)
downloadlwn-4fbf8bc733d14bceb16dda46a3f5e19c6a9621c5.tar.gz
lwn-4fbf8bc733d14bceb16dda46a3f5e19c6a9621c5.zip
ext4: correct best extent lstart adjustment logic
When yangerkun review commit 93cdf49f6eca ("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: 93cdf49f6eca ("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>
Diffstat (limited to 'fs/ext4/xattr.c')
0 files changed, 0 insertions, 0 deletions