diff mbox

[5/5] btrfs-progs: btrfs-find-root should scan backup-sb

Message ID 1365141259-10529-6-git-send-email-anand.jain@oracle.com (mailing list archive)
State Under Review, archived
Headers show

Commit Message

Anand Jain April 5, 2013, 5:54 a.m. UTC
since idea is to scan and report all the sb in the
dev, we should let it so look for backup SB by setting
the flag BTRFS_SCAN_BACKUP_SB

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 find-root.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/find-root.c b/find-root.c
index 27512df..e4ad6ac 100644
--- a/find-root.c
+++ b/find-root.c
@@ -103,7 +103,7 @@  static struct btrfs_root *open_ctree_broken(int fd, const char *device)
 
 	ret = btrfs_scan_one_device(fd, device, &fs_devices,
 				    &total_devs, BTRFS_SUPER_INFO_OFFSET,
-				    0ull);
+				    BTRFS_SCAN_BACKUP_SB);
 
 	if (ret) {
 		fprintf(stderr, "No valid Btrfs found on %s\n", device);
@@ -153,7 +153,7 @@  static struct btrfs_root *open_ctree_broken(int fd, const char *device)
 	disk_super = fs_info->super_copy;
 	ret = btrfs_read_dev_super(fs_devices->latest_bdev,
 				   disk_super, BTRFS_SUPER_INFO_OFFSET,
-				   0ull);
+				   BTRFS_SCAN_BACKUP_SB);
 	if (ret) {
 		printk("No valid btrfs found\n");
 		goto out_devices;