db07609875
segfaults from bnc#710486 due to unchecked usage of return value of open_ctree() [fixed compilation warnings] - pull upstream, replace existing patches, spec update - update 'restore' utility - lzo support - tools may now take earlies superblock when opening the fs - other fixes - pull integration-20111030 branch - mkfs: force mkfs if desired - other fixes - add btrfs-dump-super to mkinitrd - other fixes - skip non-existent devices or without media - documentation updates - scrubbing single device - graceful error handling when opening fs fails - updated mkinitrd script to scan devices before mount (bnc#727383) OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=115
33 lines
824 B
Diff
33 lines
824 B
Diff
From 412d4f1fe3a14c7e61efbd0ad4280323de71606a Mon Sep 17 00:00:00 2001
|
|
From: Josef Bacik <josef@redhat.com>
|
|
Date: Wed, 7 Dec 2011 15:54:13 -0500
|
|
Subject: [PATCH 32/35] Btrfs-progs: don't bug out if we can't find the last
|
|
root
|
|
|
|
Return an error instead of BUG()'ing out.
|
|
|
|
Signed-off-by: Josef Bacik <josef@redhat.com>
|
|
---
|
|
root-tree.c | 5 +++++
|
|
1 files changed, 5 insertions(+), 0 deletions(-)
|
|
|
|
diff --git a/root-tree.c b/root-tree.c
|
|
index 782472c..7a6ae0a 100644
|
|
--- a/root-tree.c
|
|
+++ b/root-tree.c
|
|
@@ -43,6 +43,11 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid,
|
|
|
|
BUG_ON(ret == 0);
|
|
l = path->nodes[0];
|
|
+ if (path->slots[0] == 0) {
|
|
+ ret = -ENOENT;
|
|
+ goto out;
|
|
+ }
|
|
+
|
|
BUG_ON(path->slots[0] == 0);
|
|
slot = path->slots[0] - 1;
|
|
btrfs_item_key_to_cpu(l, &found_key, slot);
|
|
--
|
|
1.7.6.233.gd79bc
|
|
|