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/tools/lvconvert.c =================================================================== --- lvm2.orig/tools/lvconvert.c +++ lvm2/tools/lvconvert.c @@ -216,10 +216,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/tools/lvcreate.c =================================================================== --- lvm2.orig/tools/lvcreate.c +++ lvm2/tools/lvcreate.c @@ -431,10 +431,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);