diff mbox series

[v2,01/13] btrfs-progs: check: fix set_extent_dirty range

Message ID b5b74e0a49f0400c4d05e7a2dec8838aed5f612d.1636574767.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: extent tree v2 global root support prep work | expand

Commit Message

Josef Bacik Nov. 10, 2021, 8:07 p.m. UTC
I screwed up a fix where we're setting the bytenr range as dirty when
marking all tree blocks used, I was looking at btrfs_pin_extent and put
->nodesize for end instead of the actual end, which is bytenr +
->nodesize - 1.  Fix this up so it's correct.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/mode-common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/check/mode-common.c b/check/mode-common.c
index 0059672c..02807101 100644
--- a/check/mode-common.c
+++ b/check/mode-common.c
@@ -664,7 +664,10 @@  static int traverse_tree_blocks(struct extent_buffer *eb, int tree_root, int pin
 			if (ret)
 				return ret;
 		} else {
+			u64 end;
+
 			bytenr = btrfs_node_blockptr(eb, i);
+			end = bytenr + gfs_info->nodesize - 1;
 
 			/* If we aren't the tree root don't read the block */
 			if (level == 1 && !tree_root) {
@@ -672,8 +675,7 @@  static int traverse_tree_blocks(struct extent_buffer *eb, int tree_root, int pin
 					btrfs_pin_extent(gfs_info, bytenr,
 							 gfs_info->nodesize);
 				else
-					set_extent_dirty(tree, bytenr,
-							 gfs_info->nodesize);
+					set_extent_dirty(tree, bytenr, end);
 				continue;
 			}