linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs-progs print more informative error when we fail to open a device
@ 2013-02-04 15:57 Gene Czarcinski
  2013-02-04 15:57 ` Gene Czarcinski
  0 siblings, 1 reply; 3+ messages in thread
From: Gene Czarcinski @ 2013-02-04 15:57 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Gene Czarcinski

I believe that this patch may have been lost in the noise and I felt
it made a very small but meaningful change so I shuffled some
test around and made sure it applied to integration-20120201

This patch simply prints more informative message when
we fail to open a device.

Eric Sandeen (1):
  Btrfs-progs print more informative error when we fail to open a device
 utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
1.8.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Btrfs-progs print more informative error when we fail to open a device
  2013-02-04 15:57 [PATCH] Btrfs-progs print more informative error when we fail to open a device Gene Czarcinski
@ 2013-02-04 15:57 ` Gene Czarcinski
  2013-02-06 22:09   ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Gene Czarcinski @ 2013-02-04 15:57 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Eric Sandeen, Gene Czarcinski

From: Eric Sandeen <sandeen@redhat.com>

print more informative error when we fail to open a device

If open() fails, we should let the user know why it failed.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Gene Czarcinski <gene@czarc.net>
---
 utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils.c b/utils.c
index d92f317..b560a49 100644
--- a/utils.c
+++ b/utils.c
@@ -1212,7 +1212,8 @@ scan_again:
 
 		fd = open(fullpath, O_RDONLY);
 		if (fd < 0) {
-			fprintf(stderr, "failed to read %s\n", fullpath);
+			fprintf(stderr, "failed to open %s: %s\n",
+				fullpath, strerror(errno));
 			continue;
 		}
 		ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Btrfs-progs print more informative error when we fail to open a device
  2013-02-04 15:57 ` Gene Czarcinski
@ 2013-02-06 22:09   ` David Sterba
  0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2013-02-06 22:09 UTC (permalink / raw)
  To: Gene Czarcinski; +Cc: linux-btrfs, Eric Sandeen

On Mon, Feb 04, 2013 at 10:57:57AM -0500, Gene Czarcinski wrote:
> From: Eric Sandeen <sandeen@redhat.com>
> 
> print more informative error when we fail to open a device
> 
> If open() fails, we should let the user know why it failed.

Thanks, added to next integration queue.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-06 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-04 15:57 [PATCH] Btrfs-progs print more informative error when we fail to open a device Gene Czarcinski
2013-02-04 15:57 ` Gene Czarcinski
2013-02-06 22:09   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).