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
32 lines
1003 B
Diff
32 lines
1003 B
Diff
From 4686f96637316b509cb16c657b73b40a329be6db Mon Sep 17 00:00:00 2001
|
|
From: Josef Bacik <josef@redhat.com>
|
|
Date: Thu, 8 Dec 2011 17:24:54 -0500
|
|
Subject: [PATCH 34/35] Btrfs-progs: check return value properly
|
|
|
|
We were checking for a null root coming back from btrfs_read_fs_root but thats
|
|
not right since it returns a ERR_PTR. Thanks,
|
|
|
|
Signed-off-by: Josef Bacik <josef@redhat.com>
|
|
---
|
|
restore.c | 4 ++--
|
|
1 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/restore.c b/restore.c
|
|
index 90d54e4..398c49a 100644
|
|
--- a/restore.c
|
|
+++ b/restore.c
|
|
@@ -831,8 +831,8 @@ static struct btrfs_root *open_fs(const char *dev, u64 root_location, int super_
|
|
key.offset = (u64)-1;
|
|
|
|
root->fs_info->fs_root = btrfs_read_fs_root(root->fs_info, &key);
|
|
- if (!root->fs_info->fs_root) {
|
|
- fprintf(stderr, "Couldn't read fs_root\n");
|
|
+ if (IS_ERR(root->fs_info->fs_root)) {
|
|
+ fprintf(stderr, "Couldn't read fs_root: %d\n", PTR_ERR(root));
|
|
close_ctree(root);
|
|
return NULL;
|
|
}
|
|
--
|
|
1.7.6.233.gd79bc
|
|
|