aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2006-10-03 04:15:27 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:14 -0400
commit927ffe7c9a156e259aae31c07dd76072c459ec57 (patch)
tree1353a603c32d2bd23331abbac917a0b0574ff6ea /drivers/md
parente4ff496db72473949ddfe29a37471969d2f1d4ee (diff)
[PATCH] dm snapshot: fix metadata writing when suspending
When suspending a device-mapper device, dm_suspend() sleeps until all necessary I/O is completed. This state is triggered by a callback from persistent_commit(). But some I/O can still be issued *after* the callback (to prepare the next metadata area for use if the current one is full). This patch delays the callback until after that I/O is complete. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-exception-store.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index 002417da1224..99cdffa7fbfe 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -536,6 +536,16 @@ static void persistent_commit(struct exception_store *store,
536 if (r) 536 if (r)
537 ps->valid = 0; 537 ps->valid = 0;
538 538
539 /*
540 * Have we completely filled the current area ?
541 */
542 if (ps->current_committed == ps->exceptions_per_area) {
543 ps->current_committed = 0;
544 r = zero_area(ps, ps->current_area + 1);
545 if (r)
546 ps->valid = 0;
547 }
548
539 for (i = 0; i < ps->callback_count; i++) { 549 for (i = 0; i < ps->callback_count; i++) {
540 cb = ps->callbacks + i; 550 cb = ps->callbacks + i;
541 cb->callback(cb->context, r == 0 ? 1 : 0); 551 cb->callback(cb->context, r == 0 ? 1 : 0);
@@ -543,16 +553,6 @@ static void persistent_commit(struct exception_store *store,
543 553
544 ps->callback_count = 0; 554 ps->callback_count = 0;
545 } 555 }
546
547 /*
548 * Have we completely filled the current area ?
549 */
550 if (ps->current_committed == ps->exceptions_per_area) {
551 ps->current_committed = 0;
552 r = zero_area(ps, ps->current_area + 1);
553 if (r)
554 ps->valid = 0;
555 }
556} 556}
557 557
558static void persistent_drop(struct exception_store *store) 558static void persistent_drop(struct exception_store *store)