Skip to contentSkip to conversation

btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()

PATCH In review Miao Xie 1 participant 1 message Mar 25, 2010 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH 12/18 btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()

From: Zhao Lei <[email protected]>

We need to check return value of btrfs_search_slot() in btrfs_read_chunk_tree() and do corresponding error handing.

---
 fs/btrfs/volumes.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/btrfs/volumes.c +2 -0
index 3ae1f42..546de6b 100644
@@ -3389,6 +3389,8 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
 	key.type = 0;
 again:
 	ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
+	if (ret < 0)
+		goto error;
 	while (1) {
 		leaf = path->nodes[0];
 		slot = path->slots[0];
Signature · 1 line
1.6.5.2