The patch 7ee06ddc4038f936b0d4459d37a7d4d844fb03db ("dm snapshot: fix a
crash when an origin has no snapshots") introduced a regression in
snapshot merging - the test lvcreate-cache-snapshot.sh got stuck in an
infinite loop.

This patch reverts it.

Signed-off-by: Mikulas Patocka <[email protected]>

Index: linux-2.6/drivers/md/dm-snap.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-snap.c
+++ linux-2.6/drivers/md/dm-snap.c
@@ -855,11 +855,12 @@ static int dm_add_exception(void *contex
 static uint32_t __minimum_chunk_size(struct origin *o)
 {
        struct dm_snapshot *snap;
-       unsigned chunk_size = rounddown_pow_of_two(UINT_MAX);
+       unsigned chunk_size = 0;
 
        if (o)
                list_for_each_entry(snap, &o->snapshots, list)
-                       chunk_size = min(chunk_size, snap->store->chunk_size);
+                       chunk_size = min_not_zero(chunk_size,
+                                                 snap->store->chunk_size);
 
        return (uint32_t) chunk_size;
 }

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to