When the snapshot is empty, return 0 as the number of allocated sectors. This will be needed for userspace to notify it that merging is finished. Signed-off-by: Mikulas Patocka --- drivers/md/dm-exception-store.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) Index: linux-2.6.25.3/drivers/md/dm-exception-store.c =================================================================== --- linux-2.6.25.3.orig/drivers/md/dm-exception-store.c 2008-05-23 21:05:12.000000000 +0200 +++ linux-2.6.25.3/drivers/md/dm-exception-store.c 2008-05-23 21:05:26.000000000 +0200 @@ -435,8 +435,12 @@ static struct pstore *get_info(struct ex static void persistent_fraction_full(struct exception_store *store, sector_t *numerator, sector_t *denominator) { - *numerator = get_info(store)->next_free * store->snap->chunk_size; - *denominator = get_dev_size(store->snap->cow->bdev); + /* + * Compensate for the first two chunks that are always allocated. + * Make sure that we return 0 when there are no exceptions. + */ + *numerator = get_info(store)->next_free * store->snap->chunk_size - 2 * store->snap->chunk_size; + *denominator = get_dev_size(store->snap->cow->bdev) - 2 * store->snap->chunk_size; } static void persistent_destroy(struct exception_store *store)