Message ID | 20211012082137.1476078-3-nborisov@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Make real_root used only in ref-verify | expand |
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index 53a80163c1d7..7c725379b8ca 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -906,7 +906,9 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans, u64 parent = generic_ref->parent; u8 ref_type; - is_system = (generic_ref->real_root == BTRFS_CHUNK_TREE_OBJECTID); + is_system = (generic_ref->tree_ref.owning_root + == BTRFS_CHUNK_TREE_OBJECTID); + ASSERT(generic_ref->type == BTRFS_REF_METADATA && generic_ref->action); BUG_ON(extent_op && extent_op->is_data);
real_root field is going to be used only by ref-verify tool so limit its use outside of it. Blocks belonging to the chunk root will always have it as an owner so the check is equivalent. Signed-off-by: Nikolay Borisov <nborisov@suse.com> --- fs/btrfs/delayed-ref.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)