Commit 87b79cef authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Adrian Bunk

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: default avatarMark McLoughlin <markmc@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 970d548a
...@@ -517,14 +517,6 @@ static void persistent_commit(struct exception_store *store, ...@@ -517,14 +517,6 @@ static void persistent_commit(struct exception_store *store,
if (r) if (r)
ps->valid = 0; ps->valid = 0;
for (i = 0; i < ps->callback_count; i++) {
cb = ps->callbacks + i;
cb->callback(cb->context, r == 0 ? 1 : 0);
}
ps->callback_count = 0;
}
/* /*
* Have we completely filled the current area ? * Have we completely filled the current area ?
*/ */
...@@ -534,6 +526,14 @@ static void persistent_commit(struct exception_store *store, ...@@ -534,6 +526,14 @@ static void persistent_commit(struct exception_store *store,
if (r) if (r)
ps->valid = 0; ps->valid = 0;
} }
for (i = 0; i < ps->callback_count; i++) {
cb = ps->callbacks + i;
cb->callback(cb->context, r == 0 ? 1 : 0);
}
ps->callback_count = 0;
}
} }
static void persistent_drop(struct exception_store *store) static void persistent_drop(struct exception_store *store)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment