Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 00/13] Btrfs-progs: more patches for integration
I have done some additional scraping of the mailing list to identify some "low hanging fruit" which I consider should be merged into the btrfs-progs repository. All of the patches below were applied on top of the 19 bugfix patches pulled together by David Sterba and the 6 patches now part of the Fedora 18 btrfs-progs package. All of this compiles but further testing is obviously needed. For the most part, these patches are bugfixes and they all appeared resonable but inspection by other eyes would be appreciated. There is also one "simple" function addition in the form or the btrfs-show-super command. Arvin Schnell (1): trivial patch for btrfs-progs Chen Yang (1): Btrfs-progs: Fix a segmentation fault in btrfstune when <device> is invalid. Gene Czarcinski (1): btrfs-show-super.c Goffredo Baroncelli (1): Add btrfs-show-super Jan Schmidt (2): Btrfs-progs: correcting misnamed parameter options for btrfs send Btrfs-progs: bugfix for subvolume parent determination in btrfs send Nageswara R Sastry (1): btrfs-progs: btrfs-image.c: Added NULL pointer check. Nirbheek Chauhan (1): Btrfs-progs: fix resolving of loop devices Ulrik (1): Btrfs-progs: correct btrfs receive usage string Wang Shilong (4): Btrfs-progs: fix arg parsing for btrfs qgroup limit commands Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull Btrfs-progs: check the relation of two group by real level numbers Btrfs-progs: disable qgroupid 0 for quota_tree -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 01/13] btrfs-progs: btrfs-image.c: Added NULL pointer check.
From: Nageswara R Sastry <nasastry@in.ibm.com> Check for the return value of ''open_ctree()'' before dereferencing it. Signed-off-by: Nageswara R Sastry <nasastry@in.ibm.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- btrfs-image.c | 1 + 1 file changed, 1 insertion(+) diff --git a/btrfs-image.c b/btrfs-image.c index f2bbcc8..2a33a55 100644 --- a/btrfs-image.c +++ b/btrfs-image.c @@ -491,6 +491,7 @@ static int create_metadump(const char *input, FILE *out, int num_threads, int ret; root = open_ctree(input, 0, 0); + BUG_ON(!root); BUG_ON(root->nodesize != root->leafsize); ret = metadump_init(&metadump, root, out, num_threads, -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 02/13] Btrfs-progs: fix resolving of loop devices
From: Nirbheek Chauhan <nirbheek.chauhan@collabora.co.uk> The LOOP_GET_STATUS ioctl truncates filenames to 64 characters. We should get the backing file for a given loop device from /sys/. This is how losetup does it as well. Signed-off-by: Gene Czarcinski <gene@czarc.net> --- utils.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/utils.c b/utils.c index 51b78d5..7953ef9 100644 --- a/utils.c +++ b/utils.c @@ -20,6 +20,7 @@ #define __USE_XOPEN2K #include <stdio.h> #include <stdlib.h> +#include <string.h> #ifndef __CHECKER__ #include <sys/ioctl.h> #include <sys/mount.h> @@ -653,21 +654,22 @@ int is_loop_device (const char* device) { * the associated file (e.g. /images/my_btrfs.img) */ int resolve_loop_device(const char* loop_dev, char* loop_file, int max_len) { - int loop_fd; - int ret_ioctl; - struct loop_info loopinfo; + int ret; + FILE *f; + char fmt[20]; + char p[PATH_MAX]; + char real_loop_dev[PATH_MAX]; - if ((loop_fd = open(loop_dev, O_RDONLY)) < 0) + if (!realpath(loop_dev, real_loop_dev)) + return -errno; + snprintf(p, PATH_MAX, "/sys/block/%s/loop/backing_file", strrchr(real_loop_dev, ''/'')); + if (!(f = fopen(p, "r"))) return -errno; - ret_ioctl = ioctl(loop_fd, LOOP_GET_STATUS, &loopinfo); - close(loop_fd); - - if (ret_ioctl == 0) { - strncpy(loop_file, loopinfo.lo_name, max_len); - if (max_len > 0) - loop_file[max_len-1] = 0; - } else + snprintf(fmt, 20, "%%%i[^\n]", max_len-1); + ret = fscanf(f, fmt, loop_file); + fclose(f); + if (ret == EOF) return -errno; return 0; -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 03/13] Btrfs-progs: correct btrfs receive usage string
From: Ulrik <ulrik.sverdrup@gmail.com> Fix the usage string to specify the correct ''-f'' option for input file, not ''-i''. Signed-off-by: Ulrik Sverdrup <ulrik.sverdrup@gmail.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-receive.c b/cmds-receive.c index 37d07db..2fae299 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -882,7 +882,7 @@ static const char * const receive_cmd_group_usage[] = { }; static const char * const cmd_receive_usage[] = { - "btrfs receive [-v] [-i <infile>] <mount>", + "btrfs receive [-v] [-f <infile>] <mount>", "Receive subvolumes from stdin.", "Receives one or more subvolumes that were previously ", "sent with btrfs send. The received subvolumes are stored", -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 04/13] Btrfs-progs: Fix a segmentation fault in btrfstune when <device> is invalid.
From: Chen Yang <chenyang.fnst@cn.fujitsu.com> When open_ctree(device, ...) failed, the return value should be checked. Signed-off-by: Cheng Yang <chenyang.fnst@cn.fujitsu.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- btrfstune.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/btrfstune.c b/btrfstune.c index 47830c5..07648d5 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -107,6 +107,8 @@ int main(int argc, char *argv[]) } root = open_ctree(device, 0, 1); + if (!root) + return 1; if (seeding_flag) { ret = update_seeding_flag(root, seeding_value); -- 1.8.1 -- 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
From: Goffredo Baroncelli <kreijack@inwind.it> Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- Makefile | 5 +- btrfs-show-super.c | 284 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 btrfs-show-super.c diff --git a/Makefile b/Makefile index c7fd97d..d524f69 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ RESTORE_LIBS=-lz progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \ btrfs btrfs-map-logical btrfs-image btrfs-zero-log btrfs-convert \ - btrfs-find-root btrfs-restore btrfstune + btrfs-find-root btrfs-restore btrfstune btrfs-show-super # make C=1 to enable sparse ifdef C @@ -75,6 +75,9 @@ btrfs-debug-tree: $(objects) debug-tree.o btrfs-zero-log: $(objects) btrfs-zero-log.o $(CC) $(CFLAGS) -o btrfs-zero-log $(objects) btrfs-zero-log.o $(LDFLAGS) $(LIBS) +btrfs-show-super: $(objects) btrfs-show-super.o + $(CC) $(CFLAGS) -o btrfs-show-super $(objects) btrfs-show-super.o $(LDFLAGS) $(LIBS) + btrfs-select-super: $(objects) btrfs-select-super.o $(CC) $(CFLAGS) -o btrfs-select-super $(objects) btrfs-select-super.o $(LDFLAGS) $(LIBS) diff --git a/btrfs-show-super.c b/btrfs-show-super.c new file mode 100644 index 0000000..a9e2524 --- /dev/null +++ b/btrfs-show-super.c @@ -0,0 +1,284 @@ +/* + * Copyright (C) 2012 STRATO AG. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License v2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 021110-1307, USA. + */ + +#define _XOPEN_SOURCE 500 +#define _GNU_SOURCE 1 +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <ctype.h> +#include <uuid/uuid.h> +#include <errno.h> + +#include "kerncompat.h" +#include "ctree.h" +#include "disk-io.h" +#include "print-tree.h" +#include "transaction.h" +#include "list.h" +#include "version.h" +#include "utils.h" +#include "crc32c.h" + +static void print_usage(void); +static void dump_superblock(struct btrfs_super_block *sb); +int main(int argc, char **argv); +static int load_and_dump_sb(char *, int fd, u64 sb_bytenr); + + +static void print_usage(void) +{ + fprintf(stderr, + "usage: btrfs-show-super [-i super_mirror|-a] dev [dev..]\n"); + fprintf(stderr, "\tThe super_mirror number is between 0 and %d.\n", + BTRFS_SUPER_MIRROR_MAX - 1); + fprintf(stderr, "\tIf -a is passed all the superblocks are showed.\n", + BTRFS_SUPER_MIRROR_MAX - 1); + fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION); +} + +int main(int argc, char **argv) +{ + int opt; + int all = 0; + char *filename; + int fd = -1; + int arg, i; + u64 sb_bytenr = btrfs_sb_offset(0); + + while ((opt = getopt(argc, argv, "ai:")) != -1) { + switch (opt) { + case ''i'': + arg = atoi(optarg); + + if (arg < 0 || arg >= BTRFS_SUPER_MIRROR_MAX) { + fprintf(stderr, + "Illegal super_mirror %d\n", + arg); + print_usage(); + exit(1); + } + sb_bytenr = btrfs_sb_offset(arg); + break; + + case ''a'': + all = 1; + break; + + default: + print_usage(); + exit(1); + } + } + + if (argc < optind + 1) { + print_usage(); + exit(1); + } + + for (i = optind ; i < argc ; i++) { + filename = argv[i]; + fd = open(filename, O_RDONLY, 0666); + if (fd < 0) { + fprintf(stderr, "Could not open %s\n", filename); + close(fd); + exit(1); + } + + if (all) { + int idx; + for (idx = 0 ; idx < BTRFS_SUPER_MIRROR_MAX ; idx++) { + sb_bytenr = btrfs_sb_offset(idx); + if (load_and_dump_sb(filename, fd, sb_bytenr)) { + close(fd); + exit(1); + } + + putchar(''\n''); + } + } else { + load_and_dump_sb(filename, fd, sb_bytenr); + putchar(''\n''); + } + close(fd); + } + + exit(0); +} + +static int load_and_dump_sb(char *filename, int fd, u64 sb_bytenr) +{ + u8 super_block_data[BTRFS_SUPER_INFO_SIZE]; + struct btrfs_super_block *sb; + u64 ret; + + sb = (struct btrfs_super_block *)super_block_data; + + ret = pread64(fd, super_block_data, BTRFS_SUPER_INFO_SIZE, sb_bytenr); + if (ret != BTRFS_SUPER_INFO_SIZE) { + int e = errno; + + /* check if the disk if too short for further superblock */ + if (ret == 0 && e == 0) + return 0; + + fprintf(stderr, + "ERROR: Failed to read the superblock on %s at %llu\n", + filename, (unsigned long long)sb_bytenr); + fprintf(stderr, + "ERROR: error = ''%s'', errno = %d\n", strerror(e), e); + return 1; + } + printf("superblock: bytenr=%llu, device=%s\n", sb_bytenr, filename); + printf("---------------------------------------------------------\n"); + dump_superblock(sb); + return 0; +} + +static int check_csum_sblock(void *sb, int csum_size) +{ + char result[csum_size]; + u32 crc = ~(u32)0; + + crc = btrfs_csum_data(NULL, (char *)sb + BTRFS_CSUM_SIZE, + crc, BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE); + btrfs_csum_final(crc, result); + + return !memcmp(sb, &result, csum_size); +} + +static void dump_superblock(struct btrfs_super_block *sb) +{ + int i; + char *s, buf[36+1]; + u8 *p; + + printf("csum\t\t\t0x"); + for (i = 0, p = sb->csum ; i < btrfs_super_csum_size(sb) ; i++) + printf("%02x", p[i]); + if (check_csum_sblock(sb, btrfs_super_csum_size(sb))) + printf(" [match]"); + else + printf(" [DON''T MATCH]"); + putchar(''\n''); + + printf("bytenr\t\t\t%llu\n", + (unsigned long long)btrfs_super_bytenr(sb)); + printf("flags\t\t\t0x%llx\n", + (unsigned long long)btrfs_super_flags(sb)); + + printf("magic\t\t\t"); + s = (char *) &sb->magic; + for (i = 0 ; i < 8 ; i++) + putchar(isprint(s[i]) ? s[i] : ''.''); + if (!memcmp(BTRFS_MAGIC, &sb->magic, 8)) + printf(" [match]\n"); + else + printf(" [DON''T MATCH]\n"); + + uuid_unparse(sb->fsid, buf); + printf("fsid\t\t\t%s\n", buf); + + printf("label\t\t\t"); + s = sb->label; + for (i = 0 ; i < BTRFS_LABEL_SIZE && s[i] ; i++) + putchar(isprint(s[i]) ? s[i] : ''.''); + putchar(''\n''); + + printf("generation\t\t%llu\n", + (unsigned long long)btrfs_super_generation(sb)); + printf("root\t\t\t%llu\n", (unsigned long long)btrfs_super_root(sb)); + printf("sys_array_size\t\t%llu\n", + (unsigned long long)btrfs_super_sys_array_size(sb)); + printf("chunk_root_generation\t%llu\n", + (unsigned long long)btrfs_super_chunk_root_generation(sb)); + printf("root_level\t\t%llu\n", + (unsigned long long)btrfs_super_root_level(sb)); + printf("chunk_root\t\t%llu\n", + (unsigned long long)btrfs_super_chunk_root(sb)); + printf("chunk_root_level\t%llu\n", + (unsigned long long)btrfs_super_chunk_root_level(sb)); + printf("log_root\t\t%llu\n", + (unsigned long long)btrfs_super_log_root(sb)); + printf("log_root_transid\t%llu\n", + (unsigned long long)btrfs_super_log_root_transid(sb)); + printf("log_root_level\t\t%llu\n", + (unsigned long long)btrfs_super_log_root_level(sb)); + printf("total_bytes\t\t%llu\n", + (unsigned long long)btrfs_super_total_bytes(sb)); + printf("bytes_used\t\t%llu\n", + (unsigned long long)btrfs_super_bytes_used(sb)); + printf("sectorsize\t\t%llu\n", + (unsigned long long)btrfs_super_sectorsize(sb)); + printf("nodesize\t\t%llu\n", + (unsigned long long)btrfs_super_nodesize(sb)); + printf("leafsize\t\t%llu\n", + (unsigned long long)btrfs_super_leafsize(sb)); + printf("stripesize\t\t%llu\n", + (unsigned long long)btrfs_super_stripesize(sb)); + printf("root_dir\t\t%llu\n", + (unsigned long long)btrfs_super_root_dir(sb)); + printf("num_devices\t\t%llu\n", + (unsigned long long)btrfs_super_num_devices(sb)); + printf("compat_flags\t\t0x%llx\n", + (unsigned long long)btrfs_super_compat_flags(sb)); + printf("compat_ro_flags\t\t0x%llx\n", + (unsigned long long)btrfs_super_compat_ro_flags(sb)); + printf("incompat_flags\t\t0x%llx\n", + (unsigned long long)btrfs_super_incompat_flags(sb)); + printf("csum_type\t\t%llu\n", + (unsigned long long)btrfs_super_csum_type(sb)); + printf("csum_size\t\t%llu\n", + (unsigned long long)btrfs_super_csum_size(sb)); + printf("cache_generation\t%llu\n", + (unsigned long long)btrfs_super_cache_generation(sb)); + + uuid_unparse(sb->dev_item.uuid, buf); + printf("dev_item.uuid\t\t%s\n", buf); + + uuid_unparse(sb->dev_item.fsid, buf); + printf("dev_item.fsid\t\t%s %s\n", buf, + !memcmp(sb->dev_item.fsid, sb->fsid, BTRFS_FSID_SIZE) ? + "[match]" : "[DON''T MATCH]"); + + printf("dev_item.type\t\t%llu\n", (unsigned long long) + btrfs_stack_device_type(&sb->dev_item)); + printf("dev_item.total_bytes\t%llu\n", (unsigned long long) + btrfs_stack_device_total_bytes(&sb->dev_item)); + printf("dev_item.bytes_used\t%llu\n", (unsigned long long) + btrfs_stack_device_bytes_used(&sb->dev_item)); + printf("dev_item.io_align\t%u\n", (unsigned int) + btrfs_stack_device_io_align(&sb->dev_item)); + printf("dev_item.io_width\t%u\n", (unsigned int) + btrfs_stack_device_io_width(&sb->dev_item)); + printf("dev_item.sector_size\t%u\n", (unsigned int) + btrfs_stack_device_sector_size(&sb->dev_item)); + printf("dev_item.devid\t\t%llu\n", + btrfs_stack_device_id(&sb->dev_item)); + printf("dev_item.dev_group\t%u\n", (unsigned int) + btrfs_stack_device_group(&sb->dev_item)); + printf("dev_item.seek_speed\t%u\n", (unsigned int) + btrfs_stack_device_seek_speed(&sb->dev_item)); + printf("dev_item.bandwidth\t%u\n", (unsigned int) + btrfs_stack_device_bandwidth(&sb->dev_item)); + printf("dev_item.generation\t%llu\n", (unsigned long long) + btrfs_stack_device_generation(&sb->dev_item)); +} + -- 1.8.1 -- 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
remove extra blank line at EOF Signed-off-by: Gene Czarcinski <gene@czarc.net> --- btrfs-show-super.c | 1 - man/Makefile | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index a9e2524..7c66d84 100644 --- a/btrfs-show-super.c +++ b/btrfs-show-super.c @@ -281,4 +281,3 @@ static void dump_superblock(struct btrfs_super_block *sb) printf("dev_item.generation\t%llu\n", (unsigned long long) btrfs_stack_device_generation(&sb->dev_item)); } - diff --git a/man/Makefile b/man/Makefile index 4a90b75..f7b57f7 100644 --- a/man/Makefile +++ b/man/Makefile @@ -1,4 +1,4 @@ -GZIP=gzip +GZIPCMD=gzip INSTALL= install prefix ?= /usr/local @@ -12,22 +12,22 @@ MANPAGES = mkfs.btrfs.8.gz btrfsctl.8.gz btrfsck.8.gz btrfs-image.8.gz \ all: $(MANPAGES) mkfs.btrfs.8.gz: mkfs.btrfs.8.in - $(GZIP) -n -c mkfs.btrfs.8.in > mkfs.btrfs.8.gz + $(GZIPCMD) -n -c mkfs.btrfs.8.in > mkfs.btrfs.8.gz btrfs.8.gz: btrfs.8.in - $(GZIP) -n -c btrfs.8.in > btrfs.8.gz + $(GZIPCMD) -n -c btrfs.8.in > btrfs.8.gz btrfsctl.8.gz: btrfsctl.8.in - $(GZIP) -n -c btrfsctl.8.in > btrfsctl.8.gz + $(GZIPCMD) -n -c btrfsctl.8.in > btrfsctl.8.gz btrfsck.8.gz: btrfsck.8.in - $(GZIP) -n -c btrfsck.8.in > btrfsck.8.gz + $(GZIPCMD) -n -c btrfsck.8.in > btrfsck.8.gz btrfs-image.8.gz: btrfs-image.8.in - $(GZIP) -n -c btrfs-image.8.in > btrfs-image.8.gz + $(GZIPCMD) -n -c btrfs-image.8.in > btrfs-image.8.gz btrfs-show.8.gz: btrfs-show.8.in - $(GZIP) -n -c btrfs-show.8.in > btrfs-show.8.gz + $(GZIPCMD) -n -c btrfs-show.8.in > btrfs-show.8.gz clean : rm -f $(MANPAGES) -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 07/13] Btrfs-progs: correcting misnamed parameter options for btrfs send
From: Jan Schmidt <list.btrfs@jan-o-sch.net> Unfortunately, the command line options for btrfs send were misnamed. The -i option should not be used to give "clone sources", we''ll be using -c instead. Compatibily note: -i option was broken anyway, which makes it less critical renaming it. For potential users of the old option style, we emit a fatal warning if the -i option is used. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-send.c | 74 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 9b47e70..3e2fcbe 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -234,7 +234,7 @@ out: return ERR_PTR(ret); } -static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root) +static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root_id) { int ret; pthread_t t_read; @@ -286,7 +286,7 @@ static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root) io_send.clone_sources = (__u64*)send->clone_sources; io_send.clone_sources_count = send->clone_sources_count; - io_send.parent_root = parent_root; + io_send.parent_root = parent_root_id; ret = ioctl(subvol_fd, BTRFS_IOC_SEND, &io_send); if (ret) { ret = -errno; @@ -423,16 +423,17 @@ int cmd_send_start(int argc, char **argv) char *snapshot_parent = NULL; u64 root_id; u64 parent_root_id = 0; + int full_send = 1; memset(&send, 0, sizeof(send)); send.dump_fd = fileno(stdout); - while ((c = getopt(argc, argv, "vf:i:p:")) != -1) { + while ((c = getopt(argc, argv, "vc:f:i:p:")) != -1) { switch (c) { case ''v'': g_verbose++; break; - case ''i'': { + case ''c'': subvol = realpath(optarg, NULL); if (!subvol) { ret = -errno; @@ -454,12 +455,16 @@ int cmd_send_start(int argc, char **argv) } add_clone_source(&send, root_id); free(subvol); + full_send = 0; break; - } case ''f'': outname = optarg; break; case ''p'': + if (snapshot_parent) { + fprintf(stderr, "ERROR: you cannot have more than one parent (-p)\n"); + return 1; + } snapshot_parent = realpath(optarg, NULL); if (!snapshot_parent) { ret = -errno; @@ -467,7 +472,12 @@ int cmd_send_start(int argc, char **argv) "%s\n", optarg, strerror(-ret)); goto out; } + full_send = 0; break; + case ''i'': + fprintf(stderr, + "ERROR: -i was removed, use -c instead\n"); + return 1; case ''?'': default: fprintf(stderr, "ERROR: send args invalid.\n"); @@ -573,10 +583,13 @@ int cmd_send_start(int argc, char **argv) goto out; } - if (!parent_root_id) { + if (!full_send && !parent_root_id) { ret = find_good_parent(&send, root_id, &parent_root_id); - if (ret < 0) - parent_root_id = 0; + if (ret < 0) { + fprintf(stderr, "ERROR: parent determination failed for %lld\n", + root_id); + goto out; + } } ret = is_subvol_ro(&send, subvol); @@ -597,6 +610,7 @@ int cmd_send_start(int argc, char **argv) add_clone_source(&send, root_id); parent_root_id = 0; + full_send = 0; free(subvol); } @@ -614,32 +628,28 @@ static const char * const send_cmd_group_usage[] = { }; static const char * const cmd_send_usage[] = { - "btrfs send [-v] [-i <subvol>] [-p <parent>] <subvol>", + "btrfs send [-v] [-p <parent>] [-c <clone-src>] <subvol>", "Send the subvolume to stdout.", "Sends the subvolume specified by <subvol> to stdout.", - "By default, this will send the whole subvolume. To do", - "an incremental send, one or multiple ''-i <clone_source>''", - "arguments have to be specified. A ''clone source'' is", - "a subvolume that is known to exist on the receiving", - "side in exactly the same state as on the sending side.\n", - "Normally, a good snapshot parent is searched automatically", - "in the list of ''clone sources''. To override this, use", - "''-p <parent>'' to manually specify a snapshot parent.", - "A manually specified snapshot parent is also regarded", - "as ''clone source''.\n", - "-v Enable verbose debug output. Each", - " occurrency of this option increases the", - " verbose level more.", - "-i <subvol> Informs btrfs send that this subvolume,", - " can be taken as ''clone source''. This can", - " be used for incremental sends.", - "-p <subvol> Disable automatic snaphot parent", - " determination and use <subvol> as parent.", - " This subvolume is also added to the list", - " of ''clone sources'' (see -i).", - "-f <outfile> Output is normally written to stdout.", - " To write to a file, use this option.", - " An alternative would be to use pipes.", + "By default, this will send the whole subvolume. To do an incremental", + "send, use ''-p <parent>''. If you want to allow btrfs to clone from", + "any additional local snapshots, use -c <clone-src> (multiple times", + "where applicable). You must not specify clone sources unless you", + "guarantee that these snapshots are exactly in the same state on both", + "sides, the sender and the receiver. It is allowed to omit the", + "''-p <parent>'' option when ''-c <clone-src>'' options are given, in", + "which case ''btrfs send'' will determine a suitable parent among the", + "clone sources itself.", + "\n", + "-v Enable verbose debug output. Each occurrency of", + " this option increases the verbose level more.", + "-p <parent> Send an incremental stream from <parent> to", + " <subvol>.", + "-c <clone-src> Use this snapshot as a clone source for an ", + " incremental send (multiple allowed)", + "-f <outfile> Output is normally written to stdout. To write to", + " a file, use this option. An alternative would be to", + " use pipes.", NULL }; -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 08/13] Btrfs-progs: bugfix for subvolume parent determination in btrfs send
From: Jan Schmidt <list.btrfs@jan-o-sch.net> We missed to add the default subvolume, because it has no ROOT_BACKREF_ITEM. This made get_parent always fail for direct decendants of the default subvolume, resulting in lots of full streams where incremental streams were requested. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Reviewed-by: Alexander Block <ablock84@googlemail.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- send-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/send-utils.c b/send-utils.c index fcde5c2..d8d3972 100644 --- a/send-utils.c +++ b/send-utils.c @@ -240,7 +240,8 @@ int subvol_uuid_search_init(int mnt_fd, struct subvol_uuid_search *s) memcpy(&root_item, root_item_ptr, sizeof(root_item)); root_item_valid = 1; - } else if (sh->type == BTRFS_ROOT_BACKREF_KEY) { + } else if (sh->type == BTRFS_ROOT_BACKREF_KEY || + root_item_valid) { if (!root_item_valid) goto skip; @@ -274,7 +275,6 @@ int subvol_uuid_search_init(int mnt_fd, struct subvol_uuid_search *s) subvol_uuid_search_add(s, si); root_item_valid = 0; } else { - root_item_valid = 0; goto skip; } -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 09/13] Btrfs-progs: fix arg parsing for btrfs qgroup limit commands
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com> We can use this command in two ways. 1. btrfs qgroup limit size qgroupid path 2. btrfs qgroup limit size path Before applying this patch, we differentiate them by check the parsing result of the second argument. It is not so good because it may make some mistakes, For example: btrfs qgroup limit 1M 123456 ^ It is a subvolume name. In fact, we can differentiate them just by the number of arguments, so fix it by this way. Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-qgroup.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 1525c11..129a4f0 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -383,7 +383,6 @@ static int cmd_qgroup_limit(int argc, char **argv) } memset(&args, 0, sizeof(args)); - args.qgroupid = parse_qgroupid(argv[optind + 1]); if (size) { if (compressed) args.lim.flags |= BTRFS_QGROUP_LIMIT_RFER_CMPR | @@ -397,9 +396,8 @@ static int cmd_qgroup_limit(int argc, char **argv) } } - if (args.qgroupid == 0) { - if (check_argc_exact(argc - optind, 2)) - usage(cmd_qgroup_limit_usage); + if (argc - optind == 2) { + args.qgroupid = 0; path = argv[optind + 1]; ret = test_issubvolume(path); if (ret < 0) { @@ -415,11 +413,11 @@ static int cmd_qgroup_limit(int argc, char **argv) * keep qgroupid at 0, this indicates that the subvolume the * fd refers to is to be limited */ - } else { - if (check_argc_exact(argc - optind, 3)) - usage(cmd_qgroup_limit_usage); + } else if (argc - optind == 3) { + args.qgroupid = parse_qgroupid(argv[optind + 1]); path = argv[optind + 2]; - } + } else + usage(cmd_qgroup_limit_usage); fd = open_file_or_dir(path); if (fd < 0) { -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 10/13] Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com> 1. parse_qgroupid() is implemented twice, clean up the reduplicate code. 2. atoi() can not detect errors, so use strtoull() instead of it. Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-qgroup.c | 15 +-------------- qgroup.c | 22 ++++++++++++++++++---- qgroup.h | 2 ++ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 129a4f0..c4122bf 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -24,26 +24,13 @@ #include "ioctl.h" #include "commands.h" +#include "qgroup.h" static const char * const qgroup_cmd_group_usage[] = { "btrfs qgroup <command> [options] <path>", NULL }; -static u64 parse_qgroupid(char *p) -{ - char *s = strchr(p, ''/''); - u64 level; - u64 id; - - if (!s) - return atoll(p); - level = atoll(p); - id = atoll(s + 1); - - return (level << 48) | id; -} - static int qgroup_assign(int assign, int argc, char **argv) { int ret = 0; diff --git a/qgroup.c b/qgroup.c index 4083b57..dafde12 100644 --- a/qgroup.c +++ b/qgroup.c @@ -22,15 +22,29 @@ u64 parse_qgroupid(char *p) { char *s = strchr(p, ''/''); + char *ptr_src_end = p + strlen(p); + char *ptr_parse_end = NULL; u64 level; u64 id; - if (!s) - return atoll(p); - level = atoll(p); - id = atoll(s + 1); + if (!s) { + id = strtoull(p, &ptr_parse_end, 10); + if (ptr_parse_end != ptr_src_end) + goto err; + return id; + } + level = strtoull(p, &ptr_parse_end, 10); + if (ptr_parse_end != s) + goto err; + + id = strtoull(s+1, &ptr_parse_end, 10); + if (ptr_parse_end != ptr_src_end) + goto err; return (level << 48) | id; +err: + fprintf(stderr, "ERROR:invalid qgroupid\n"); + exit(-1); } int qgroup_inherit_size(struct btrfs_qgroup_inherit *p) diff --git a/qgroup.h b/qgroup.h index f7af8c5..ad14c88 100644 --- a/qgroup.h +++ b/qgroup.h @@ -20,7 +20,9 @@ #define _BTRFS_QGROUP_H #include "ioctl.h" +#include "kerncompat.h" +u64 parse_qgroupid(char *p); int qgroup_inherit_size(struct btrfs_qgroup_inherit *p); int qgroup_inherit_realloc(struct btrfs_qgroup_inherit **inherit, int incgroups, int inccopies); -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 11/13] Btrfs-progs: check the relation of two group by real level numbers
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Comparing qgroupid is not good way to check the relationship of two groups, the right way is to compare the real level numbers. Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-qgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index c4122bf..70019d0 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -50,7 +50,7 @@ static int qgroup_assign(int assign, int argc, char **argv) /* * FIXME src should accept subvol path */ - if (args.src >= args.dst) { + if ((args.src >> 48) >= (args.dst >> 48)) { fprintf(stderr, "ERROR: bad relation requested ''%s''\n", path); return 12; } -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:04 UTC
[PATCH 12/13] Btrfs-progs: disable qgroupid 0 for quota_tree
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com> In kernel, qgroupid 0 is a special number when we run the quota group limit command. So, we should not be able to create a quota group whose id is 0, otherwise the kernel can''t deal with it. Fix it. Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-qgroup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 70019d0..dfff1b9 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -86,6 +86,10 @@ static int qgroup_create(int create, int argc, char **argv) args.create = create; args.qgroupid = parse_qgroupid(argv[1]); + if (!args.qgroupid) { + fprintf(stderr, "ERROR: qgroup 0 is not supported\n"); + return 30; + } fd = open_file_or_dir(path); if (fd < 0) { fprintf(stderr, "ERROR: can''t access ''%s''\n", path); -- 1.8.1 -- 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
From: Arvin Schnell <aschnell@suse.de> Hi, please find attached a trivial patch for btrfs-progs. Likely not strictly needed but I noticed valgrind complaining about uninitialised memory in the ioctl call. Regards, Arvin Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-send.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-send.c b/cmds-send.c index b33c802..595a5d0 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -273,6 +273,7 @@ static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root) goto out; } + memset(&io_send, 0, sizeof(io_send)); io_send.send_fd = pipefd[1]; send->send_fd = pipefd[0]; -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-20 21:49 UTC
Re: [PATCH 07/13] Btrfs-progs: correcting misnamed parameter options for btrfs send
Bad patch ... working on fix On 01/20/2013 04:04 PM, Gene Czarcinski wrote:> From: Jan Schmidt <list.btrfs@jan-o-sch.net> > > Unfortunately, the command line options for btrfs send were misnamed. The > -i option should not be used to give "clone sources", we''ll be using -c > instead. > > Compatibily note: -i option was broken anyway, which makes it less critical > renaming it. For potential users of the old option style, we emit a fatal > warning if the -i option is used. > > Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> > Signed-off-by: Gene Czarcinski <gene@czarc.net> ><snip> -- 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
Gene Czarcinski
2013-Jan-20 23:59 UTC
[PATCH] Btrfs-progs: correcting misnamed parameter options for btrfs send
This is a hand refit of the patch but otherwise the same. Unfortunately, the command line options for btrfs send were misnamed. The -i option should not be used to give "clone sources", we''ll be using -c instead. Compatibily note: -i option was broken anyway, which makes it less critical renaming it. For potential users of the old option style, we emit a fatal warning if the -i option is used. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Gene Czarcinski <gene@czarc.net> --- cmds-send.c | 74 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 5607f2a..d2f7691 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -236,7 +236,7 @@ out: return ERR_PTR(ret); } -static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root) +static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root_id) { int ret; pthread_t t_read; @@ -289,7 +289,7 @@ static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root) io_send.clone_sources = (__u64*)send->clone_sources; io_send.clone_sources_count = send->clone_sources_count; - io_send.parent_root = parent_root; + io_send.parent_root = parent_root_id; ret = ioctl(subvol_fd, BTRFS_IOC_SEND, &io_send); if (ret) { ret = -errno; @@ -426,6 +426,7 @@ int cmd_send_start(int argc, char **argv) char *snapshot_parent = NULL; u64 root_id; u64 parent_root_id = 0; + int full_send = 1; memset(&send, 0, sizeof(send)); send.dump_fd = fileno(stdout); @@ -435,12 +436,12 @@ int cmd_send_start(int argc, char **argv) return 1; } - while ((c = getopt(argc, argv, "vf:i:p:")) != -1) { + while ((c = getopt(argc, argv, "vc:f:i:p:")) != -1) { switch (c) { case ''v'': g_verbose++; break; - case ''i'': { + case ''c'': subvol = realpath(optarg, NULL); if (!subvol) { ret = -errno; @@ -462,12 +463,16 @@ int cmd_send_start(int argc, char **argv) } add_clone_source(&send, root_id); free(subvol); + full_send = 0; break; - } case ''f'': outname = optarg; break; case ''p'': + if (snapshot_parent) { + fprintf(stderr, "ERROR: you cannot have more than one parent (-p)\n"); + return 1; + } snapshot_parent = realpath(optarg, NULL); if (!snapshot_parent) { ret = -errno; @@ -475,7 +480,12 @@ int cmd_send_start(int argc, char **argv) "%s\n", optarg, strerror(-ret)); goto out; } + full_send = 0; break; + case ''i'': + fprintf(stderr, + "ERROR: -i was removed, use -c instead\n"); + return 1; case ''?'': default: fprintf(stderr, "ERROR: send args invalid.\n"); @@ -581,10 +591,13 @@ int cmd_send_start(int argc, char **argv) goto out; } - if (!parent_root_id) { + if (!full_send && !parent_root_id) { ret = find_good_parent(&send, root_id, &parent_root_id); - if (ret < 0) - parent_root_id = 0; + if (ret < 0) { + fprintf(stderr, "ERROR: parent determination failed for %lld\n", + root_id); + goto out; + } } ret = is_subvol_ro(&send, subvol); @@ -605,6 +618,7 @@ int cmd_send_start(int argc, char **argv) add_clone_source(&send, root_id); parent_root_id = 0; + full_send = 0; free(subvol); } @@ -622,32 +636,28 @@ static const char * const send_cmd_group_usage[] = { }; static const char * const cmd_send_usage[] = { - "btrfs send [-v] [-i <subvol>] [-p <parent>] <subvol>", + "btrfs send [-v] [-p <parent>] [-c <clone-src>] <subvol>", "Send the subvolume to stdout.", "Sends the subvolume specified by <subvol> to stdout.", - "By default, this will send the whole subvolume. To do", - "an incremental send, one or multiple ''-i <clone_source>''", - "arguments have to be specified. A ''clone source'' is", - "a subvolume that is known to exist on the receiving", - "side in exactly the same state as on the sending side.\n", - "Normally, a good snapshot parent is searched automatically", - "in the list of ''clone sources''. To override this, use", - "''-p <parent>'' to manually specify a snapshot parent.", - "A manually specified snapshot parent is also regarded", - "as ''clone source''.\n", - "-v Enable verbose debug output. Each", - " occurrency of this option increases the", - " verbose level more.", - "-i <subvol> Informs btrfs send that this subvolume,", - " can be taken as ''clone source''. This can", - " be used for incremental sends.", - "-p <subvol> Disable automatic snaphot parent", - " determination and use <subvol> as parent.", - " This subvolume is also added to the list", - " of ''clone sources'' (see -i).", - "-f <outfile> Output is normally written to stdout.", - " To write to a file, use this option.", - " An alternative would be to use pipes.", + "By default, this will send the whole subvolume. To do an incremental", + "send, use ''-p <parent>''. If you want to allow btrfs to clone from", + "any additional local snapshots, use -c <clone-src> (multiple times", + "where applicable). You must not specify clone sources unless you", + "guarantee that these snapshots are exactly in the same state on both", + "sides, the sender and the receiver. It is allowed to omit the", + "''-p <parent>'' option when ''-c <clone-src>'' options are given, in", + "which case ''btrfs send'' will determine a suitable parent among the", + "clone sources itself.", + "\n", + "-v Enable verbose debug output. Each occurrency of", + " this option increases the verbose level more.", + "-p <parent> Send an incremental stream from <parent> to", + " <subvol>.", + "-c <clone-src> Use this snapshot as a clone source for an ", + " incremental send (multiple allowed)", + "-f <outfile> Output is normally written to stdout. To write to", + " a file, use this option. An alternative would be to", + " use pipes.", NULL }; -- 1.8.1 -- 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
Gene Czarcinski
2013-Jan-21 14:11 UTC
Re: [PATCH 12/13] Btrfs-progs: disable qgroupid 0 for quota_tree
At the request of the patch''s author, this should be dropped as it has been addressed by a patch to the kernel. On 01/20/2013 04:04 PM, Gene Czarcinski wrote:> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com> > > In kernel, qgroupid 0 is a special number when we run the quota group limit command. > > So, we should not be able to create a quota group whose id is 0, otherwise the kernel > can''t deal with it. Fix it. > > Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> > Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> > Signed-off-by: Gene Czarcinski <gene@czarc.net> > --- > cmds-qgroup.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/cmds-qgroup.c b/cmds-qgroup.c > index 70019d0..dfff1b9 100644 > --- a/cmds-qgroup.c > +++ b/cmds-qgroup.c > @@ -86,6 +86,10 @@ static int qgroup_create(int create, int argc, char **argv) > args.create = create; > args.qgroupid = parse_qgroupid(argv[1]); > > + if (!args.qgroupid) { > + fprintf(stderr, "ERROR: qgroup 0 is not supported\n"); > + return 30; > + } > fd = open_file_or_dir(path); > if (fd < 0) { > fprintf(stderr, "ERROR: can''t access ''%s''\n", path);-- 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
David Sterba
2013-Jan-21 15:56 UTC
Re: [PATCH 01/13] btrfs-progs: btrfs-image.c: Added NULL pointer check.
On Sun, Jan 20, 2013 at 04:04:06PM -0500, Gene Czarcinski wrote:> From: Nageswara R Sastry <nasastry@in.ibm.com> > > Check for the return value of ''open_ctree()'' before dereferencing it. > > --- a/btrfs-image.c > +++ b/btrfs-image.c > @@ -491,6 +491,7 @@ static int create_metadump(const char *input, FILE *out, int num_threads, > int ret; > > root = open_ctree(input, 0, 0); > + BUG_ON(!root);Bug_on is not the right fix here, I prefer a more extensive fix http://permalink.gmane.org/gmane.comp.file-systems.btrfs/15305 which prints a message and exits.> BUG_ON(root->nodesize != root->leafsize); > > ret = metadump_init(&metadump, root, out, num_threads,-- 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
David Sterba
2013-Jan-21 16:14 UTC
Re: [PATCH 02/13] Btrfs-progs: fix resolving of loop devices
On Sun, Jan 20, 2013 at 04:04:07PM -0500, Gene Czarcinski wrote:> From: Nirbheek Chauhan <nirbheek.chauhan@collabora.co.uk> > > The LOOP_GET_STATUS ioctl truncates filenames to 64 characters. We should get > the backing file for a given loop device from /sys/. This is how losetup does it > as well. > > Signed-off-by: Gene Czarcinski <gene@czarc.net>I''d expect Nirbheek''s signed off here as well and I''ve noticed Tested-By: Hector Oron <hector.oron@collabora.co.uk> (https://patchwork.kernel.org/patch/1629581/) Are you guys ok with adding them? david -- 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
On Sun, Jan 20, 2013 at 04:04:11PM -0500, Gene Czarcinski wrote:> remove extra blank line at EOFThe patch contents and description do not match.> --- a/man/Makefile > +++ b/man/Makefile > @@ -1,4 +1,4 @@ > -GZIP=gzip > +GZIPCMD=gzipI''m not sure if this change is needed, does it stick to some well-known or established style in makefiles? david -- 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
On Sun, Jan 20, 2013 at 04:04:18PM -0500, Gene Czarcinski wrote:> From: Arvin Schnell <aschnell@suse.de> > > Hi, > > please find attached a trivial patch for btrfs-progs. Likely not > strictly needed but I noticed valgrind complaining about > uninitialised memory in the ioctl call. > > Regards, > Arvin > > Signed-off-by: Gene Czarcinski <gene@czarc.net>I''ve updated the changelog to say --- btrfs-progs: initialize data before send ioctl Likely not strictly needed but I noticed valgrind complaining about uninitialised memory in the ioctl call. Signed-off-by: Arvin Schnell <aschnell@suse.de> --- is it ok for both of you? david -- 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
On Sun, Jan 20, 2013 at 04:04:10PM -0500, Gene Czarcinski wrote:> From: Goffredo Baroncelli <kreijack@inwind.it> >What I''m missing here is Stefan''s S-o-B line, as he''s the original author of the tool, adding it, JFYI.> Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> > Signed-off-by: Gene Czarcinski <gene@czarc.net>david -- 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
David Sterba
2013-Jan-21 18:40 UTC
Re: [PATCH 00/13] Btrfs-progs: more patches for integration (integration-20130121)
On Sun, Jan 20, 2013 at 04:04:05PM -0500, Gene Czarcinski wrote:> I have done some additional scraping of the mailing list to > identify some "low hanging fruit" which I consider should > be merged into the btrfs-progs repository.Thanks, I went through them and put together into an integration branch git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130121 I''ve modified the signed-off-by lines when I knew who was the author or contributed to the patch. Please let me know if I''ve messed the credits and fame attribution. There are three more patches that I''ve picked from my distro patch queue (and were sent to the list long ago) they''re placed at the top of the shortlog. Arne Jansen (1): Btrfs-progs: bugfix for scrubbing single devices Wang Sheng-Hui (1): btrfs-progs: add malloc check in transaction.h/btrfs_start_transaction Goffredo Baroncelli (1): Ignore the error ENXIO and ENOMEDIUM during a devs scan Arvin Schnell (1): btrfs-progs: initialize data before send ioctl Danny Kukawka (1): btrfs-progs: Handle errors returned from open_ctree Jan Schmidt (2): Btrfs-progs: correcting misnamed parameter options for btrfs send Btrfs-progs: bugfix for subvolume parent determination in btrfs send Josef Bacik (2): Btrfs-progs: detect if the disk we are formatting is a ssd Btrfs-progs: add btrfs device ready command Nirbheek Chauhan (1): Btrfs-progs: fix resolving of loop devices Stefan Behrens (1): btrfs-progs: Add btrfs-show-super Ulrik (1): Btrfs-progs: correct btrfs receive usage string Wang Shilong (3): Btrfs-progs: fix arg parsing for btrfs qgroup limit commands Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull Btrfs-progs: check the relation of two group by real level numbers david -- 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
On 01/21/2013 07:04 PM, David Sterba wrote:> On Sun, Jan 20, 2013 at 04:04:10PM -0500, Gene Czarcinski wrote: >> From: Goffredo Baroncelli<kreijack@inwind.it> >> > > What I''m missing here is Stefan''s S-o-B line, as he''s the original > author of the tool, adding it, JFYI.I am not sure if he want to Sign it. During the review he blamed about some style issues. But for time constraints I was not able to update the patches. So before adding Stefen''s S-o-B we need an ack from him.>> Signed-off-by: Goffredo Baroncelli<kreijack@inwind.it> >> Signed-off-by: Gene Czarcinski<gene@czarc.net> > > david > -- > 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 >-- gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it> Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5 -- 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
On 01/21/2013 20:54, Goffredo Baroncelli wrote:> On 01/21/2013 07:04 PM, David Sterba wrote: >> On Sun, Jan 20, 2013 at 04:04:10PM -0500, Gene Czarcinski wrote: >>> From: Goffredo Baroncelli<kreijack@inwind.it> >>> >> What I''m missing here is Stefan''s S-o-B line, as he''s the original >> author of the tool, adding it, JFYI. > > I am not sure if he want to Sign it. During the review he blamed about > some style issues. But for time constraints I was not able to update the > patches. > > So before adding Stefen''s S-o-B we need an ack from him.For the record, all the extra spaces are not from me. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>>>> Signed-off-by: Goffredo Baroncelli<kreijack@inwind.it> >>> Signed-off-by: Gene Czarcinski<gene@czarc.net>-- 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
On Mon, Jan 21, 2013 at 11:22:01PM +0100, Stefan Behrens wrote:> On 01/21/2013 20:54, Goffredo Baroncelli wrote: > >On 01/21/2013 07:04 PM, David Sterba wrote: > >>On Sun, Jan 20, 2013 at 04:04:10PM -0500, Gene Czarcinski wrote: > >>>From: Goffredo Baroncelli<kreijack@inwind.it> > >>> > >>What I''m missing here is Stefan''s S-o-B line, as he''s the original > >>author of the tool, adding it, JFYI. > > > >I am not sure if he want to Sign it. During the review he blamed about > >some style issues. But for time constraints I was not able to update the > >patches. > > > >So before adding Stefen''s S-o-B we need an ack from him. > > For the record, all the extra spaces are not from me.Thanks, s-o-b is there and I''ve removed them and added @@ -125,7 +125,7 @@ int main(int argc, char **argv) static int load_and_dump_sb(char *filename, int fd, u64 sb_bytenr) { - u8 super_block_data[BTRFS_SUPER_INFO_SIZE]; + u8 super_block_data[BTRFS_SUPER_INFO_SIZE]; struct btrfs_super_block *sb; u64 ret; @@ -166,12 +166,12 @@ static int check_csum_sblock(void *sb, int csum_size) static void dump_superblock(struct btrfs_super_block *sb) { - int i; - char *s, buf[36+1]; - u8 *p; + int i; + char *s, buf[36+1]; + u8 *p; --- also a whitespace change, that sticks to the common style in progs. david -- 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
praneeth u
2013-Jan-22 17:03 UTC
Fwd: [PATCH 00/13] Btrfs-progs: more patches for integration (integration-20130121)
Hello, We are team of 5 students, interns at Green turtles technologies, interested in contributing to btrfs. Any space for contribution for btrfs testing ? we will be updating pogress twice in a week. Need suggestions on how to proceed. On Tue, Jan 22, 2013 at 12:10 AM, David Sterba <dsterba@suse.cz> wrote:> On Sun, Jan 20, 2013 at 04:04:05PM -0500, Gene Czarcinski wrote: >> I have done some additional scraping of the mailing list to >> identify some "low hanging fruit" which I consider should >> be merged into the btrfs-progs repository. > > Thanks, I went through them and put together into an integration branch > > git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130121 > > I''ve modified the signed-off-by lines when I knew who was the author or > contributed to the patch. Please let me know if I''ve messed the credits > and fame attribution. > > There are three more patches that I''ve picked from my distro patch queue (and > were sent to the list long ago) they''re placed at the top of the shortlog. > > Arne Jansen (1): > Btrfs-progs: bugfix for scrubbing single devices > > Wang Sheng-Hui (1): > btrfs-progs: add malloc check in transaction.h/btrfs_start_transaction > > Goffredo Baroncelli (1): > Ignore the error ENXIO and ENOMEDIUM during a devs scan > > Arvin Schnell (1): > btrfs-progs: initialize data before send ioctl > > Danny Kukawka (1): > btrfs-progs: Handle errors returned from open_ctree > > Jan Schmidt (2): > Btrfs-progs: correcting misnamed parameter options for btrfs send > Btrfs-progs: bugfix for subvolume parent determination in btrfs send > > Josef Bacik (2): > Btrfs-progs: detect if the disk we are formatting is a ssd > Btrfs-progs: add btrfs device ready command > > Nirbheek Chauhan (1): > Btrfs-progs: fix resolving of loop devices > > Stefan Behrens (1): > btrfs-progs: Add btrfs-show-super > > Ulrik (1): > Btrfs-progs: correct btrfs receive usage string > > Wang Shilong (3): > Btrfs-progs: fix arg parsing for btrfs qgroup limit commands > Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull > Btrfs-progs: check the relation of two group by real level numbers > > david > -- > 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-- Praneeth U 9448804728 -- Praneeth U 9448804728 -- 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
Gene Czarcinski
2013-Jan-22 17:34 UTC
Re: [PATCH 01/13] btrfs-progs: btrfs-image.c: Added NULL pointer check.
On 01/21/2013 10:56 AM, David Sterba wrote:> On Sun, Jan 20, 2013 at 04:04:06PM -0500, Gene Czarcinski wrote: >> From: Nageswara R Sastry <nasastry@in.ibm.com> >> >> Check for the return value of ''open_ctree()'' before dereferencing it. >> >> --- a/btrfs-image.c >> +++ b/btrfs-image.c >> @@ -491,6 +491,7 @@ static int create_metadump(const char *input, FILE *out, int num_threads, >> int ret; >> >> root = open_ctree(input, 0, 0); >> + BUG_ON(!root); > Bug_on is not the right fix here, I prefer a more extensive fix > > http://permalink.gmane.org/gmane.comp.file-systems.btrfs/15305 > > which prints a message and exits. > >> BUG_ON(root->nodesize != root->leafsize); >> >> ret = metadump_init(&metadump, root, out, num_threads,I missed this better fix because I only started looking for outstanding patches starting in June/July 2012. Besides, I suspect you are a lot more knowledgeable to make the judgment as to a "good" fix. Gene -- 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
David Sterba
2013-Jan-22 17:50 UTC
Re: [PATCH 02/13] Btrfs-progs: fix resolving of loop devices
On Sun, Jan 20, 2013 at 04:04:07PM -0500, Gene Czarcinski wrote:> From: Nirbheek Chauhan <nirbheek.chauhan@collabora.co.uk> > > The LOOP_GET_STATUS ioctl truncates filenames to 64 characters. We should get > the backing file for a given loop device from /sys/. This is how losetup does it > as well.For the record, there was another patch fixing a loop device issue https://patchwork.kernel.org/patch/1861831/ from Michael (CCed), that switched from LOOP_GET_STATUS to LOOP_GET_STATUS64, but afaics both types of the ioctl return at most 64 characters, so parsing /sys appears to be the way to go. david -- 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
On 01/21/2013 11:46 AM, David Sterba wrote:> On Sun, Jan 20, 2013 at 04:04:11PM -0500, Gene Czarcinski wrote: >> remove extra blank line at EOF > The patch contents and description do not match.First of all, this patch should have been 2 separate patches. Too late to fix that. The patch which created btrfs-show-super.c had an extra line at the end and I got annoyed at git-am complaining about it. This first patch fixes that. This should have been a separate commit. The other patch (which should have been its own commit) addresses this problem: http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg19264.html I could not see that it did any harm and it helped on at least one system type I am not sure how it happened that I combined them. If you want, I will resubmit them the way it should be ... two separate patches with two separate commits. Gene> >> --- a/man/Makefile >> +++ b/man/Makefile >> @@ -1,4 +1,4 @@ >> -GZIP=gzip >> +GZIPCMD=gzip > I''m not sure if this change is needed, does it stick to some well-known > or established style in makefiles? > > david > >-- 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
Gene Czarcinski
2013-Jan-22 18:09 UTC
Re: [PATCH 00/13] Btrfs-progs: more patches for integration (integration-20130121)
Thanks. I am currently running with all of my submissions and everything is working. I will pull your integration branch and switch to that instead of 13 patch set so I can test them. This will be on top of the "original" two sets of patches. Gene On 01/21/2013 01:40 PM, David Sterba wrote:> On Sun, Jan 20, 2013 at 04:04:05PM -0500, Gene Czarcinski wrote: >> I have done some additional scraping of the mailing list to >> identify some "low hanging fruit" which I consider should >> be merged into the btrfs-progs repository. > Thanks, I went through them and put together into an integration branch > > git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130121 > > I''ve modified the signed-off-by lines when I knew who was the author or > contributed to the patch. Please let me know if I''ve messed the credits > and fame attribution. > > There are three more patches that I''ve picked from my distro patch queue (and > were sent to the list long ago) they''re placed at the top of the shortlog. > > Arne Jansen (1): > Btrfs-progs: bugfix for scrubbing single devices > > Wang Sheng-Hui (1): > btrfs-progs: add malloc check in transaction.h/btrfs_start_transaction > > Goffredo Baroncelli (1): > Ignore the error ENXIO and ENOMEDIUM during a devs scan > > Arvin Schnell (1): > btrfs-progs: initialize data before send ioctl > > Danny Kukawka (1): > btrfs-progs: Handle errors returned from open_ctree > > Jan Schmidt (2): > Btrfs-progs: correcting misnamed parameter options for btrfs send > Btrfs-progs: bugfix for subvolume parent determination in btrfs send > > Josef Bacik (2): > Btrfs-progs: detect if the disk we are formatting is a ssd > Btrfs-progs: add btrfs device ready command > > Nirbheek Chauhan (1): > Btrfs-progs: fix resolving of loop devices > > Stefan Behrens (1): > btrfs-progs: Add btrfs-show-super > > Ulrik (1): > Btrfs-progs: correct btrfs receive usage string > > Wang Shilong (3): > Btrfs-progs: fix arg parsing for btrfs qgroup limit commands > Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull > Btrfs-progs: check the relation of two group by real level numbers > > david > >-- 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
On 01/21/2013 12:40 PM, David Sterba wrote:> On Sun, Jan 20, 2013 at 04:04:18PM -0500, Gene Czarcinski wrote: >> From: Arvin Schnell <aschnell@suse.de> >> >> Hi, >> >> please find attached a trivial patch for btrfs-progs. Likely not >> strictly needed but I noticed valgrind complaining about >> uninitialised memory in the ioctl call. >> >> Regards, >> Arvin >> >> Signed-off-by: Gene Czarcinski <gene@czarc.net> > I''ve updated the changelog to say > --- > btrfs-progs: initialize data before send ioctl > > Likely not strictly needed but I noticed valgrind complaining about > uninitialised memory in the ioctl call. > > Signed-off-by: Arvin Schnell <aschnell@suse.de> > --- > > is it ok for both of you? > > david >Of course. It is usually a good thing to not make assumptions where you do not have to. Gene -- 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
Gene Czarcinski
2013-Jan-22 20:14 UTC
Re: [PATCH 00/13] Btrfs-progs: more patches for integration (integration-20130121)
On 01/21/2013 01:40 PM, David Sterba wrote:> On Sun, Jan 20, 2013 at 04:04:05PM -0500, Gene Czarcinski wrote: >> >I have done some additional scraping of the mailing list to >> >identify some "low hanging fruit" which I consider should >> >be merged into the btrfs-progs repository. > Thanks, I went through them and put together into an integration branch > > git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130121There is a problem with one of the patches: detect if the disk we are formatting is a ssd The commit comments appear to come from the patch I submitted. However, as I said in the submission, the patch for mkfs.c has to be "refitted" because of a conflict. The conflict is a result of the patch: Fix compiler warnings on PPC64 which relocated the include "kerncompat.h" to a different line in the mkfs.c file. It appears that you used the original patch. I noticed that you merged from a different branch and I suspect that that branch did not have the "Fix compiler warnings" patch applied first. I suggest you use the patch I submitted. Gene -- 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
This is the patch that "6 of 13" should have been and was not. Here is the original posting: http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg19264.html Christian Hesse (1): fix btrfs-progs build man/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 1.8.1 -- 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
From: Christian Hesse <list@eworm.de> Hello everybody, man pages for btrfs-progs are compressed by gzip by default. In Makefile the variable GZIP is use, this evaluates to ''gzip gzip'' on my system. From man gzip:> The environment variable GZIP can hold a set of default options for gzip. > These options are interpreted first and can be overwritten by explicit > command line parameters.So using any other variable name fixes this. Patch is attached. Signed-off-by: Gene Czarcinski <gene@czarc.net> --- man/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/man/Makefile b/man/Makefile index 4a90b75..f7b57f7 100644 --- a/man/Makefile +++ b/man/Makefile @@ -1,4 +1,4 @@ -GZIP=gzip +GZIPCMD=gzip INSTALL= install prefix ?= /usr/local @@ -12,22 +12,22 @@ MANPAGES = mkfs.btrfs.8.gz btrfsctl.8.gz btrfsck.8.gz btrfs-image.8.gz \ all: $(MANPAGES) mkfs.btrfs.8.gz: mkfs.btrfs.8.in - $(GZIP) -n -c mkfs.btrfs.8.in > mkfs.btrfs.8.gz + $(GZIPCMD) -n -c mkfs.btrfs.8.in > mkfs.btrfs.8.gz btrfs.8.gz: btrfs.8.in - $(GZIP) -n -c btrfs.8.in > btrfs.8.gz + $(GZIPCMD) -n -c btrfs.8.in > btrfs.8.gz btrfsctl.8.gz: btrfsctl.8.in - $(GZIP) -n -c btrfsctl.8.in > btrfsctl.8.gz + $(GZIPCMD) -n -c btrfsctl.8.in > btrfsctl.8.gz btrfsck.8.gz: btrfsck.8.in - $(GZIP) -n -c btrfsck.8.in > btrfsck.8.gz + $(GZIPCMD) -n -c btrfsck.8.in > btrfsck.8.gz btrfs-image.8.gz: btrfs-image.8.in - $(GZIP) -n -c btrfs-image.8.in > btrfs-image.8.gz + $(GZIPCMD) -n -c btrfs-image.8.in > btrfs-image.8.gz btrfs-show.8.gz: btrfs-show.8.in - $(GZIP) -n -c btrfs-show.8.in > btrfs-show.8.gz + $(GZIPCMD) -n -c btrfs-show.8.in > btrfs-show.8.gz clean : rm -f $(MANPAGES) -- 1.8.1 -- 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
David Sterba
2013-Jan-23 16:35 UTC
Re: [PATCH 01/13] btrfs-progs: btrfs-image.c: Added NULL pointer check.
On Tue, Jan 22, 2013 at 12:34:01PM -0500, Gene Czarcinski wrote:> I missed this better fix because I only started looking for outstanding > patches starting in June/July 2012.No problem, there are multuple patches for some longstanging bugs, or several versions of patch series. This is something we need to be able to deal with anyway. david -- 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
On Tue, Jan 22, 2013 at 01:00:56PM -0500, Gene Czarcinski wrote:> The patch which created btrfs-show-super.c had an extra line at the end and > I got annoyed at git-am complaining about it. This first patch fixes that. > This should have been a separate commit.No need to send separate patches for whitespaces if the number of places to fix is small.> The other patch (which should have been its own commit) addresses this > problem: > http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg19264.html > > I could not see that it did any harm and it helped on at least one system > typeNow I remember I saw that patch fly by; added to the queue. david -- 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
On Tue, Jan 22, 2013 at 03:51:19PM -0500, Gene Czarcinski wrote:> From: Christian Hesse <list@eworm.de> > > Hello everybody, > > man pages for btrfs-progs are compressed by gzip by default. In Makefile the > variable GZIP is use, this evaluates to ''gzip gzip'' on my system. From man > gzip: > > > The environment variable GZIP can hold a set of default options for gzip. > > These options are interpreted first and can be overwritten by explicit > > command line parameters. > > So using any other variable name fixes this. Patch is attached.I''ve added Christian''s Signed-off-by: Christian Hesse <list@eworm.de> and modified the subject line to say "btrfs-progs: fix build, manpage compression command" david -- 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
Gene Czarcinski
2013-Jan-23 18:16 UTC
Re: [PATCH 01/13] btrfs-progs: btrfs-image.c: Added NULL pointer check.
On 01/21/2013 10:56 AM, David Sterba wrote:> On Sun, Jan 20, 2013 at 04:04:06PM -0500, Gene Czarcinski wrote: >> >From: Nageswara R Sastry<nasastry@in.ibm.com> >> > >> >Check for the return value of ''open_ctree()'' before dereferencing it. >> > >> >--- a/btrfs-image.c >> >+++ b/btrfs-image.c >> >@@ -491,6 +491,7 @@ static int create_metadump(const char *input, FILE *out, int num_threads, >> > int ret; >> > >> > root = open_ctree(input, 0, 0); >> >+ BUG_ON(!root); > Bug_on is not the right fix here, I prefer a more extensive fix > > http://permalink.gmane.org/gmane.comp.file-systems.btrfs/15305 > > which prints a message and exits. >The above patch is 1 of 4 that were submitted. Should those other three be included also. I did a couple of spot checks and the changes were not picked up in another patch. A couple of things bother me about these 4 patches. First of all, nobody commented about them on this mailing list --- either good or bad. Second, if the descriptions and code is at all accurate, why were these patches not included in the "flury" of patches applied later in the year to bring btrfs-progs more up-to-date? These patches may "look good" but almost none of the changes will apply to "integration-20130121" or "91d9eec". So some effort will be needed to refit/rebase these patches. I am willing to do that if there is some agreement that this should be done. Of the 4 patches, the one addressing segfaults is the most serious. The others deal with simple problems including one which changes spaces to tab characters. Gene -- 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
David Sterba
2013-Jan-24 18:13 UTC
Re: [PATCH 00/13] Btrfs-progs: more patches for integration (integration-20130121)
On Tue, Jan 22, 2013 at 03:14:35PM -0500, Gene Czarcinski wrote:> On 01/21/2013 01:40 PM, David Sterba wrote: > >On Sun, Jan 20, 2013 at 04:04:05PM -0500, Gene Czarcinski wrote: > >>>I have done some additional scraping of the mailing list to > >>>identify some "low hanging fruit" which I consider should > >>>be merged into the btrfs-progs repository. > >Thanks, I went through them and put together into an integration branch > > > > git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130121 > There is a problem with one of the patches: > detect if the disk we are formatting is a ssd > > The commit comments appear to come from the patch I submitted. However, as I > said in the submission, the patch for mkfs.c has to be "refitted" because of > a conflict. The conflict is a result of the patch: > Fix compiler warnings on PPC64 > which relocated the include "kerncompat.h" to a different line in the mkfs.c > file.These merge conflicts are inevitable and normal (though sometimes not that trivial). My initial aim was to build one linear branch only with fixes and git-merge the patches that add features, but this will not be easy to merge for much longer, so I''m going to do a linear integration branch so others can take them as checkpoint to base the various patchsets. david -- 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
Gene Czarcinski
2013-Jan-24 21:07 UTC
Re: [PATCH 00/13] Btrfs-progs: more patches for integration (integration-20130121)
On 01/24/2013 01:13 PM, David Sterba wrote:> On Tue, Jan 22, 2013 at 03:14:35PM -0500, Gene Czarcinski wrote: >> On 01/21/2013 01:40 PM, David Sterba wrote: >>> On Sun, Jan 20, 2013 at 04:04:05PM -0500, Gene Czarcinski wrote: >>>>> I have done some additional scraping of the mailing list to >>>>> identify some "low hanging fruit" which I consider should >>>>> be merged into the btrfs-progs repository. >>> Thanks, I went through them and put together into an integration branch >>> >>> git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130121 >> There is a problem with one of the patches: >> detect if the disk we are formatting is a ssd >> >> The commit comments appear to come from the patch I submitted. However, as I >> said in the submission, the patch for mkfs.c has to be "refitted" because of >> a conflict. The conflict is a result of the patch: >> Fix compiler warnings on PPC64 >> which relocated the include "kerncompat.h" to a different line in the mkfs.c >> file. > These merge conflicts are inevitable and normal (though sometimes not > that trivial). My initial aim was to build one linear branch only with > fixes and git-merge the patches that add features, but this will not be > easy to merge for much longer, so I''m going to do a linear integration > branch so others can take them as checkpoint to base the various > patchsets. >Yes, trying to merge branches with lots of changes are effectively impossible (impractical?) as far as I am concerned. Unless it is simple I I understand exactly what is happening, I have found it easier/better to apply a set of patches one at a time and resolve problems manually. I just got the subvol show patches applied. I tried putting it into a separate branch and then doing a merge but I could not trust my results when I ran mergetool. And, BTW they subvol show patches to apply with not very many problems. My working branch currently has 44 commits over 91d9eec and subvol show added another ten. Gene -- 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