Skip to content

Commit 83c5688

Browse files
yangerkuntytso
authored andcommitted
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/[email protected] Signed-off-by: yangerkun <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 39fec68 commit 83c5688

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

fs/ext4/extents.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -714,13 +714,14 @@ ext4_ext_binsearch_idx(struct inode *inode,
714714
r = EXT_LAST_INDEX(eh);
715715
while (l <= r) {
716716
m = l + (r - l) / 2;
717+
ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l,
718+
le32_to_cpu(l->ei_block), m, le32_to_cpu(m->ei_block),
719+
r, le32_to_cpu(r->ei_block));
720+
717721
if (block < le32_to_cpu(m->ei_block))
718722
r = m - 1;
719723
else
720724
l = m + 1;
721-
ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l,
722-
le32_to_cpu(l->ei_block), m, le32_to_cpu(m->ei_block),
723-
r, le32_to_cpu(r->ei_block));
724725
}
725726

726727
path->p_idx = l - 1;
@@ -782,13 +783,14 @@ ext4_ext_binsearch(struct inode *inode,
782783

783784
while (l <= r) {
784785
m = l + (r - l) / 2;
786+
ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l,
787+
le32_to_cpu(l->ee_block), m, le32_to_cpu(m->ee_block),
788+
r, le32_to_cpu(r->ee_block));
789+
785790
if (block < le32_to_cpu(m->ee_block))
786791
r = m - 1;
787792
else
788793
l = m + 1;
789-
ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l,
790-
le32_to_cpu(l->ee_block), m, le32_to_cpu(m->ee_block),
791-
r, le32_to_cpu(r->ee_block));
792794
}
793795

794796
path->p_ext = l - 1;

0 commit comments

Comments
 (0)