From patchwork Mon Feb 7 07:34:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodriues X-Patchwork-Id: 537321 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p177YitT026460 for ; Mon, 7 Feb 2011 07:34:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752505Ab1BGHei (ORCPT ); Mon, 7 Feb 2011 02:34:38 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:60833 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207Ab1BGHeh (ORCPT ); Mon, 7 Feb 2011 02:34:37 -0500 Received: by wyb28 with SMTP id 28so4251552wyb.19 for ; Sun, 06 Feb 2011 23:34:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=6KNCzYCu/Qs6pPRmRxPMwR0YBlNt/R3w9YU52upsoNk=; b=riQ1BlI3HK2FJz9qbeS41eNrZCnIA6lRdVBvwFqIk4RvxvEPOY4XlpCmF22Fvd2e+M fDdM+aQ5pCMwt6ICg2zkZWeBHvArQOVQ46l1HdMX5y/VyaNxx2cQDX+LnzPxjCVgH0fj VWVpcmZ+Zp/Vxql7vNkXn/RX6/Vj30pomR3SY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=TyZ3NbTk/+SUYEO7qQBbXFoD/mpsvw91/XwsLGWzirKEG8YG1q/5Q/XCuFxC3t6nO3 GCNl4dLFy55+f6nmK7pDBLbQQRz5VoZt/ke989LqN47SyluKfZYAAMkChzgVL1WMnjAi 3NnlrbuR/BbVmEtoPVdmCcQBwTiRRZr/WAeTI= MIME-Version: 1.0 Received: by 10.216.19.133 with SMTP id n5mr1921688wen.83.1297064076511; Sun, 06 Feb 2011 23:34:36 -0800 (PST) Received: by 10.216.2.5 with HTTP; Sun, 6 Feb 2011 23:34:36 -0800 (PST) Date: Mon, 7 Feb 2011 01:34:36 -0600 Message-ID: Subject: [PATCH] Btrfs-progs utils Informative errors From: Goldwyn Rodrigues To: linux-btrfs@vger.kernel.org Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 07 Feb 2011 07:34:45 +0000 (UTC) diff --git a/utils.c b/utils.c index fd894f3..589bfd7 100644 --- a/utils.c +++ b/utils.c @@ -867,7 +867,7 @@ again: } dirp = opendir(dirname); if (!dirp) { - fprintf(stderr, "Unable to open /sys/block for scanning\n"); + fprintf(stderr, "Unable to open %s for scanning\n", dirname); return -ENOENT; } while(1) { @@ -902,7 +902,8 @@ again: } fd = open(fullpath, O_RDONLY); if (fd < 0) { - fprintf(stderr, "failed to read %s\n", fullpath); + fprintf(stderr, "failed to read %s: %s\n", fullpath, + strerror(errno)); continue; } ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,