public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix typo: s/Coult/Could/
@ 2009-01-23 21:14 Thadeu Lima de Souza Cascardo
  2009-01-23 21:14 ` [PATCH] Add error message explaining why opening a device failed Thadeu Lima de Souza Cascardo
  0 siblings, 1 reply; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2009-01-23 21:14 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Thadeu Lima de Souza Cascardo

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
 disk-io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/disk-io.c b/disk-io.c
index e49c220..9e0cfe8 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -530,7 +530,7 @@ struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, int writes)
 
 	fp = open(filename, flags, 0600);
 	if (fp < 0) {
-		fprintf (stderr, "Coult not open %s\n", filename);
+		fprintf (stderr, "Could not open %s\n", filename);
 		return NULL;
 	}
 	root = open_ctree_fd(fp, filename, sb_bytenr, writes);
-- 
1.6.0.6


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

* [PATCH] Add error message explaining why opening a device failed
  2009-01-23 21:14 [PATCH] Fix typo: s/Coult/Could/ Thadeu Lima de Souza Cascardo
@ 2009-01-23 21:14 ` Thadeu Lima de Souza Cascardo
  2009-01-24  3:39   ` [PATCH] btrfs_progs/mkfs.c more input data verification cleanup ashford
  0 siblings, 1 reply; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2009-01-23 21:14 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Thadeu Lima de Souza Cascardo

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
 disk-io.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/disk-io.c b/disk-io.c
index 9e0cfe8..5986709 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -530,7 +530,8 @@ struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, int writes)
 
 	fp = open(filename, flags, 0600);
 	if (fp < 0) {
-		fprintf (stderr, "Could not open %s\n", filename);
+		fprintf (stderr, "Could not open %s: %s\n", filename,
+			 strerror (errno));
 		return NULL;
 	}
 	root = open_ctree_fd(fp, filename, sb_bytenr, writes);
-- 
1.6.0.6


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

* [PATCH] btrfs_progs/mkfs.c more input data verification cleanup
  2009-01-23 21:14 ` [PATCH] Add error message explaining why opening a device failed Thadeu Lima de Souza Cascardo
@ 2009-01-24  3:39   ` ashford
  0 siblings, 0 replies; 3+ messages in thread
From: ashford @ 2009-01-24  3:39 UTC (permalink / raw)
  To: linux-btrfs

Yet another patch for mkfs input data verification.

# diff -u mkfs.c- mkfs.c
--- mkfs.c-     2009-01-23 19:26:33.000000000 -0800
+++ mkfs.c      2009-01-23 19:33:07.000000000 -0800
@@ -406,13 +406,23 @@
                exit(1);
        }

-       if (leafsize < sectorsize || (leafsize & (sectorsize - 1))) {
-               fprintf(stderr, "Illegal leafsize %u\n", leafsize);
+       if (leafsize < sectorsize) {
+               printf("Leafsize %u smaller than sectorsize %u - corrected\n",
+                       leafsize, (u32)getpagesize());
+               leafsize = sectorsize;
+       } else if ((leafsize & (sectorsize - 1))) {
+               fprintf(stderr, "Leafsize %u not a multiple of sectorsize %u\n",
+                       leafsize, sectorsize);
                exit(1);
        }

-       if (nodesize < sectorsize || (nodesize & (sectorsize - 1))) {
-               fprintf(stderr, "Illegal nodesize %u\n", nodesize);
+       if (nodesize < sectorsize) {
+               printf("Nodesize %u smaller than sectorsize %u - corrected\n",
+                       nodesize, (u32)getpagesize());
+               nodesize = sectorsize;
+       } else if ((nodesize & (sectorsize - 1))) {
+               fprintf(stderr, "Nodesize %u not a multiple of sectorsize %u\n",
+                       nodesize, sectorsize);
                exit(1);
        }


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

end of thread, other threads:[~2009-01-24  3:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-23 21:14 [PATCH] Fix typo: s/Coult/Could/ Thadeu Lima de Souza Cascardo
2009-01-23 21:14 ` [PATCH] Add error message explaining why opening a device failed Thadeu Lima de Souza Cascardo
2009-01-24  3:39   ` [PATCH] btrfs_progs/mkfs.c more input data verification cleanup ashford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox