Use sector_div to properly handle 64-bit modulo on 32-bit machines. Signed-off-by: Mikulas Patocka --- drivers/md/dm-exception-store.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6.26-fast/drivers/md/dm-exception-store.c =================================================================== --- linux-2.6.26-fast.orig/drivers/md/dm-exception-store.c 2008-07-23 21:21:50.000000000 +0200 +++ linux-2.6.26-fast/drivers/md/dm-exception-store.c 2008-07-23 22:34:54.000000000 +0200 @@ -520,6 +520,7 @@ static int persistent_prepare(struct exc { struct pstore *ps = get_info(store); uint32_t stride; + chunk_t next_free; sector_t size = get_dev_size(store->snap->cow->bdev); /* Is there enough room ? */ @@ -533,7 +534,8 @@ static int persistent_prepare(struct exc * into account the location of the metadata chunks. */ stride = (ps->exceptions_per_area + 1); - if ((++ps->next_free % stride) == 1) + next_free = ++ps->next_free; + if (sector_div(next_free, stride) == 1) ps->next_free++; atomic_inc(&ps->pending_count);