Skip to contentSkip to conversation

Btrfs: check root_key's offset instead

PATCH In review liubo 2 participants 2 messages Jun 8, 2011 Btrfs file system

lore
Share & tools
lore

liubo

author
#0 lore raw

PATCH 1/1 Btrfs: check root_key's offset instead

When we use reloc root to cow or copy a tree block, we do not set the block's owner, instead we set its header's flag with BTRFS_HEADER_FLAG_RELOC.

So here we should check for root_key's offset.

---
 fs/btrfs/extent-tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/extent-tree.c +1 -1
index 5b9b6b6..0bda273 100644
@@ -6160,7 +6160,7 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
 		if (wc->flags[level + 1] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
 			parent = path->nodes[level + 1]->start;
 		else
-			BUG_ON(root->root_key.objectid !=
+			BUG_ON(root->root_key.offset !=
 			       btrfs_header_owner(path->nodes[level + 1]));
 	}
 
Signature · 1 line
1.6.5.2
#1 lore raw
Quoted 1 line · liubo

When we use reloc root to cow or copy a tree block, we do not set the=

block's

fs/btrfs/extent-tree.c static noinline int walk_up_proc(struct btrfs_t=

Quoted 14 lines

owner, instead we set its header's flag with BTRFS_HEADER_FLAG_RELOC.

So here we should check for root_key's offset.

---
=A0fs/btrfs/extent-tree.c | =A0 =A02 +- =A01 files changed, 1 insertions(+), 1 deletions(-)

fs/btrfs/extent-tree.c +0 -0
index 5b9b6b6..0bda273 100644
@@ -6160,7 +6160,7 @@ static noinline int walk_up_proc(struct btrfs_t=

rans_handle *trans,

Quoted 1 line

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (wc->flags[level + 1] & BTRFS_BLOCK=

_FLAG_FULL_BACKREF)

Quoted 1 line

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0parent =3D path->nodes=

[level + 1]->start;

Quoted 2 lines

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BUG_ON(root->root_key.o=

bjectid !=3D

Quoted 1 line

+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BUG_ON(root->root_key.o=

ffset !=3D

Quoted 1 line

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 btrfs_hea=

der_owner(path->nodes[level + 1]));

Quoted 2 lines

=A0 =A0 =A0 =A0}

This is wrong, all blocks with BTRFS_HEADER_FLAG_RELOC flag set should uss full back references.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html