Re: [ANNOUNCE] Btrfs v0.10 (online growing/shrinking, ext3 conversion, and more)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kyle McMartin
Date: Tuesday, January 15, 2008 - 9:55 am

On Tue, Jan 15, 2008 at 10:52:38AM -0500, Chris Mason wrote:

Looks like fun. btrfsck fails to check if it actually received a
dev argument though, so if you don't pass a device, we get a nice
segfault.

Signed-off-by: Kyle McMartin <kmcmartin@redhat.com>

---
diff -Nur btrfs-progs-0.10/btrfsck.c btrfs-progs-0.10-kyle/btrfsck.c
--- btrfs-progs-0.10/btrfsck.c	2008-01-15 10:33:32.000000000 -0500
+++ btrfs-progs-0.10-kyle/btrfsck.c	2008-01-15 11:49:24.000000000 -0500
@@ -709,6 +709,11 @@
 	return err;
 }
 
+void print_usage(void) {
+	fprintf(stderr, "usage: btrfsck dev\n");
+	exit(1);
+}
+
 int main(int ac, char **av) {
 	struct btrfs_root *root;
 	struct cache_tree extent_cache;
@@ -727,6 +732,9 @@
 	int slot;
 	struct btrfs_root_item ri;
 
+	if (ac < 2)
+		print_usage();
+
 	radix_tree_init();
 	cache_tree_init(&extent_cache);
 	cache_tree_init(&seen);
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [ANNOUNCE] Btrfs v0.10 (online growing/shrinking, ext3 ..., Kyle McMartin, (Tue Jan 15, 9:55 am)