From patchwork Wed Oct 22 00:32:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Janecek X-Patchwork-Id: 5129011 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4367EC11AC for ; Wed, 22 Oct 2014 00:32:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CB5920166 for ; Wed, 22 Oct 2014 00:32:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 929F720158 for ; Wed, 22 Oct 2014 00:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751138AbaJVAcV (ORCPT ); Tue, 21 Oct 2014 20:32:21 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:48323 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbaJVAcU (ORCPT ); Tue, 21 Oct 2014 20:32:20 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 16216) id 3408F81AF4; Wed, 22 Oct 2014 02:32:18 +0200 (CEST) Date: Wed, 22 Oct 2014 02:32:18 +0200 From: Petr Janecek To: dsterba@suse.cz Cc: linux-btrfs@vger.kernel.org Subject: Re: Btrfs-progs release 3.17 Message-ID: <20141022003217.GA15721@atrey.karlin.mff.cuni.cz> References: <20141021212822.GA22009@atrey.karlin.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141021212822.GA22009@atrey.karlin.mff.cuni.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, one more thing: I just overwrote part of one disk. "btrfs filesystem show" could be more helpful diagnosing this: # btrfs fi sh Label: 'BTRFSROOT' uuid: d877125e-9b8d-47ea-b57b-7411292fd26c Total devices 1 FS bytes used 2.91GiB devid 1 size 29.44GiB used 5.04GiB path /dev/sdi1 Label: 'BTR1' uuid: 2ec4b5a1-a2c4-4687-9015-cf5b519297f3 Total devices 3 FS bytes used 2.47TiB devid 1 size 3.64TiB used 1.79TiB path /dev/sdn devid 2 size 3.64TiB used 1.79TiB path /dev/sdo devid 3 size 3.64TiB used 1.79TiB path /dev/sdp Label: 'BTR0' uuid: 0ec83db3-4574-4e40-8d57-ebbe9fe246e1 Total devices 4 FS bytes used 2.41TiB devid 1 size 2.73TiB used 1.21TiB path /dev/sda devid 2 size 2.73TiB used 1.21TiB path /dev/sdb devid 3 size 2.73TiB used 1.21TiB path /dev/sdc devid 4 size 2.73TiB used 1.21TiB path /dev/sdd Label: 'BTR3' uuid: 89f2016b-984f-4811-99d9-df3b8b5ce318 Total devices 4 FS bytes used 896.00KiB devid 1 size 2.73TiB used 2.02GiB path /dev/sde devid 2 size 2.73TiB used 2.00GiB path /dev/sdf devid 3 size 2.73TiB used 1.01GiB path /dev/sdg devid 4 size 2.73TiB used 1.01GiB path /dev/sdh warning, device 3 is missing warning devid 3 not found already Btrfs v3.17 -- there are three disks with devid 3, can't tell which one it is. The fs uuid can be displayed with very little effort: Regards, Petr --- 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 --git a/volumes.c b/volumes.c index 5b007fc..02866bc 100644 --- a/volumes.c +++ b/volumes.c @@ -30,6 +30,7 @@ #include "print-tree.h" #include "volumes.h" #include "math.h" +#include "utils.h" struct stripe { struct btrfs_device *dev; @@ -1625,9 +1626,11 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key, map->stripes[i].dev = btrfs_find_device(root, devid, uuid, NULL); if (!map->stripes[i].dev) { + char uuidbuf[BTRFS_UUID_UNPARSED_SIZE]; + uuid_unparse(root->fs_info->fsid, uuidbuf); map->stripes[i].dev = fill_missing_device(devid); - printf("warning, device %llu is missing\n", - (unsigned long long)devid); + printf("warning, device %llu from fs %s is missing\n", + (unsigned long long)devid, uuidbuf); } } @@ -1720,8 +1723,10 @@ static int read_one_dev(struct btrfs_root *root, device = btrfs_find_device(root, devid, dev_uuid, fs_uuid); if (!device) { - printk("warning devid %llu not found already\n", - (unsigned long long)devid); + char uuidbuf[BTRFS_UUID_UNPARSED_SIZE]; + uuid_unparse(fs_uuid, uuidbuf); + printk("warning devid %llu from fs %s not found already\n", + (unsigned long long)devid, uuidbuf); device = kzalloc(sizeof(*device), GFP_NOFS); if (!device) return -ENOMEM;