linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 12/18] btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()
@ 2010-03-25 12:34 Miao Xie
  0 siblings, 0 replies; only message in thread
From: Miao Xie @ 2010-03-25 12:34 UTC (permalink / raw)
  To: Chris Mason; +Cc: Linux Btrfs

From: Zhao Lei <zhaolei@cn.fujitsu.com>

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

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/volumes.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3ae1f42..546de6b 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -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];
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-25 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 12:34 [PATCH 12/18] btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree() Miao Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).