summaryrefslogtreecommitdiff
path: root/root-tree.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2017-07-31 14:54:24 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2017-07-31 14:54:24 +0100
commit6a0440391da7a99ffab94ccc66264af9b5f3ce34 (patch)
tree1c7cf4f07b08c4965ab19819ebce367be16fb980 /root-tree.c
parent5f2e2384443a09e3f1fec71940e9e32b70789102 (diff)
New upstream release.
Diffstat (limited to 'root-tree.c')
-rw-r--r--root-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/root-tree.c b/root-tree.c
index ab01a140..6b8f8c1c 100644
--- a/root-tree.c
+++ b/root-tree.c
@@ -51,7 +51,8 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid,
l = path->nodes[0];
slot = path->slots[0] - 1;
btrfs_item_key_to_cpu(l, &found_key, slot);
- if (found_key.objectid != objectid) {
+ if (found_key.type != BTRFS_ROOT_ITEM_KEY ||
+ found_key.objectid != objectid) {
ret = -ENOENT;
goto out;
}