diff options
author | yangerkun <yangerkun@huawei.com> | 2021-09-03 14:27:46 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-11-04 10:33:24 -0400 |
commit | 83c5688b8977b1cd495a05ca0455e4353c8f6655 (patch) | |
tree | 7b926393a1f87e9ee92315237fd52c1c483d7e6d /fs | |
parent | 39fec6889d15a658c3a3ebb06fd69d3584ddffd3 (diff) |
ext4: correct the left/middle/right debug message for binsearch
The debuginfo for binsearch want to show the left/middle/right extent
while the process search for the goal block. However we show this info
after we change right or left.
Link: https://lore.kernel.org/r/20210903062748.4118886-2-yangerkun@huawei.com
Signed-off-by: yangerkun <yangerkun@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/extents.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 0e02571f2f82..c59426f1e1d2 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -714,13 +714,14 @@ ext4_ext_binsearch_idx(struct inode *inode, r = EXT_LAST_INDEX(eh); while (l <= r) { m = l + (r - l) / 2; + ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, + le32_to_cpu(l->ei_block), m, le32_to_cpu(m->ei_block), + r, le32_to_cpu(r->ei_block)); + if (block < le32_to_cpu(m->ei_block)) r = m - 1; else l = m + 1; - ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, - le32_to_cpu(l->ei_block), m, le32_to_cpu(m->ei_block), - r, le32_to_cpu(r->ei_block)); } path->p_idx = l - 1; @@ -782,13 +783,14 @@ ext4_ext_binsearch(struct inode *inode, while (l <= r) { m = l + (r - l) / 2; + ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, + le32_to_cpu(l->ee_block), m, le32_to_cpu(m->ee_block), + r, le32_to_cpu(r->ee_block)); + if (block < le32_to_cpu(m->ee_block)) r = m - 1; else l = m + 1; - ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, - le32_to_cpu(l->ee_block), m, le32_to_cpu(m->ee_block), - r, le32_to_cpu(r->ee_block)); } path->p_ext = l - 1; |