Support small chunksize Support chunk sizes as small as 512 bytes. The kernel supports them (for both shared and non-shared snapshots). Snapshots with such small size are very slow, it is not very practical, but it is good for testing snapshot code. Signed-off-by: Mikulas Patocka --- tools/lvconvert.c | 4 ++-- tools/lvcreate.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: LVM2.2.02.60/tools/lvconvert.c =================================================================== --- LVM2.2.02.60.orig/tools/lvconvert.c 2010-02-08 02:05:00.000000000 +0100 +++ LVM2.2.02.60/tools/lvconvert.c 2010-02-08 02:05:32.000000000 +0100 @@ -213,10 +213,10 @@ static int _read_params(struct lvconvert return 0; } lp->chunk_size = arg_uint_value(cmd, chunksize_ARG, 8); - if (lp->chunk_size < 8 || lp->chunk_size > 1024 || + if (lp->chunk_size < 1 || lp->chunk_size > 1024 || (lp->chunk_size & (lp->chunk_size - 1))) { log_error("Chunk size must be a power of 2 in the " - "range 4K to 512K"); + "range 512 to 512K"); return 0; } log_verbose("Setting chunksize to %d sectors.", lp->chunk_size); Index: LVM2.2.02.60/tools/lvcreate.c =================================================================== --- LVM2.2.02.60.orig/tools/lvcreate.c 2010-02-08 02:05:00.000000000 +0100 +++ LVM2.2.02.60/tools/lvcreate.c 2010-02-08 02:05:32.000000000 +0100 @@ -421,10 +421,10 @@ static int _lvcreate_params(struct lvcre return 0; } lp->chunk_size = arg_uint_value(cmd, chunksize_ARG, 8); - if (lp->chunk_size < 8 || lp->chunk_size > 1024 || + if (lp->chunk_size < 1 || lp->chunk_size > 1024 || (lp->chunk_size & (lp->chunk_size - 1))) { log_error("Chunk size must be a power of 2 in the " - "range 4K to 512K"); + "range 512 to 512K"); return 0; } log_verbose("Setting chunksize to %d sectors.", lp->chunk_size);