If we are creating snapshot with memory-stored exception store, fail if the user didn't specify chunk size. Zero chunk size would probably crash a lot of places in the rest of snapshot code. Signed-off-by: Mikulas Patocka --- drivers/md/dm-snap.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6.25.3/drivers/md/dm-snap.c =================================================================== --- linux-2.6.25.3.orig/drivers/md/dm-snap.c 2008-05-23 21:04:38.000000000 +0200 +++ linux-2.6.25.3/drivers/md/dm-snap.c 2008-05-23 21:05:04.000000000 +0200 @@ -649,6 +649,11 @@ static int snapshot_ctr(struct dm_target DMWARN("Snapshot is marked invalid."); } + if (!s->chunk_size) { + ti->error = "Chunk size not set"; + goto bad8; + } + /* Add snapshot to the list of snapshots for this origin */ /* Exceptions aren't triggered till snapshot_resume() is called */ if (register_snapshot(s)) {