Prepare for rereading exceptions. Make "dm_insert_exceptions" and "read_exceptions" continue where they last stopped. In the beginning, this is zero, so the patch doesn't change any functionality. Signed-off-by: Mikulas Patocka --- drivers/md/dm-snap-persistent.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6.31-fast-new-2/drivers/md/dm-snap-persistent.c =================================================================== --- linux-2.6.31-fast-new-2.orig/drivers/md/dm-snap-persistent.c 2009-10-16 21:51:41.000000000 +0200 +++ linux-2.6.31-fast-new-2/drivers/md/dm-snap-persistent.c 2009-10-16 21:53:04.000000000 +0200 @@ -437,7 +437,7 @@ static int insert_exceptions(struct psto /* presume the area is full */ *full = 1; - for (i = 0; i < ps->exceptions_per_area; i++) { + for (i = ps->current_committed; i < ps->exceptions_per_area; i++) { read_exception(ps, i, &de); /* @@ -465,6 +465,7 @@ static int insert_exceptions(struct psto if (r) return r; } + ps->current_committed = 0; return 0; } @@ -480,7 +481,7 @@ static int read_exceptions(struct pstore * Keeping reading chunks and inserting exceptions until * we find a partially full area. */ - for (ps->current_area = 0; full; ps->current_area++) { + for (; full; ps->current_area++) { r = area_io(ps, READ); if (r) return r;