Skip to contentSkip to conversation

Btrfs-progs: pass properly formated key to read_fs_root

PATCH New Josef Bacik 1 participant 1 message May 2, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs-progs: pass properly formated key to read_fs_root

We have a BUG_ON() in read_fs_root that expects key->offset == (u64)-1. Restore will just pass in the location it reads out of the inode if it has a subvol reference and pass that in, which doesn't have offset == (u64)-1, so it causes restore blow up. This was reported in bugzilla and this patch fixed the problem. Thanks,

---
 cmds-restore.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
cmds-restore.c +1 -0
index 12b2188..aada7d0 100644
@@ -612,6 +612,7 @@ static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
 					goto next;
 				}
 
+				location.offset = (u64)-1;
 				search_root = btrfs_read_fs_root(root->fs_info,
 								 &location);
 				if (IS_ERR(search_root)) {
Signature · 1 line
1.7.7.6