diff mbox

[RFC,00/12] Btrfs-progs: introduce chunk recover function

Message ID 20130704040646.GA3577@localhost.localdomain (mailing list archive)
State Under Review, archived
Headers show

Commit Message

Liu Bo July 4, 2013, 4:06 a.m. UTC
On Wed, Jul 03, 2013 at 04:36:44PM -0400, Chris Mason wrote:
> Quoting Miao Xie (2013-07-03 09:25:08)
> > This patchset introduced chunk recover function, which was implemented by
> > scanning the whoel disks in the filesystem. Now, we can recover Single,
> > Dup, RAID1 chunks, and RAID0, RAID10, RAID5, RAID6 metadata chunks.
> 
> Really nice.  I've integrated this with Liu Bo's btrfs-image fixes and
> put it into a branch called integration.  I've tested both repair and
> image here, but if you could please double check the merge I'd
> appreciate it.

We still need another patch to make image work(actually we need to initialize
missing device's uuid to NULL).

It's the read_one_dev() part in

https://patchwork.kernel.org/patch/2787291/


-liubo
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Chris Mason July 5, 2013, 2 p.m. UTC | #1
Quoting Liu Bo (2013-07-04 00:06:47)
> On Wed, Jul 03, 2013 at 04:36:44PM -0400, Chris Mason wrote:
> > Quoting Miao Xie (2013-07-03 09:25:08)
> > > This patchset introduced chunk recover function, which was implemented by
> > > scanning the whoel disks in the filesystem. Now, we can recover Single,
> > > Dup, RAID1 chunks, and RAID0, RAID10, RAID5, RAID6 metadata chunks.
> > 
> > Really nice.  I've integrated this with Liu Bo's btrfs-image fixes and
> > put it into a branch called integration.  I've tested both repair and
> > image here, but if you could please double check the merge I'd
> > appreciate it.
> 
> We still need another patch to make image work(actually we need to initialize
> missing device's uuid to NULL).
> 
> It's the read_one_dev() part in
> 
> https://patchwork.kernel.org/patch/2787291/

Got it, thanks!

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/volumes.c b/volumes.c
index d6f81f8..061f094 100644
--- a/volumes.c
+++ b/volumes.c
@@ -116,6 +116,7 @@  static int device_list_add(const char *path,
 			/* we can safely leave the fs_devices entry around */
 			return -ENOMEM;
 		}
+		device->fd = -1;
 		device->devid = devid;
 		memcpy(device->uuid, disk_super->dev_item.uuid,
 		       BTRFS_UUID_SIZE);
@@ -1628,10 +1629,10 @@  static int read_one_dev(struct btrfs_root *root,
 	if (!device) {
 		printk("warning devid %llu not found already\n",
 			(unsigned long long)devid);
-		device = kmalloc(sizeof(*device), GFP_NOFS);
+		device = kzalloc(sizeof(*device), GFP_NOFS);
 		if (!device)
 			return -ENOMEM;
-		device->total_ios = 0;
+		device->fd = -1;
 		list_add(&device->dev_list,
 			 &root->fs_info->fs_devices->devices);
 	}