]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] dm snapshot: fix kcopyd destructor
authorAlasdair G Kergon <agk@redhat.com>
Mon, 24 Apr 2006 20:36:06 +0000 (13:36 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 1 May 2006 19:03:43 +0000 (12:03 -0700)
commitf6a731290ca18b31fd447989319eb913d9c308d8
tree914bdca0b4ef6adc7cf24e3573f02b200dd4a136
parent5667cc6c6ddf816527a04ea9b0c6fc9bee6f8ed3
[PATCH] dm snapshot: fix kcopyd destructor

Before removing a snapshot, wait for the completion of any kcopyd jobs using
it.

Do this by maintaining a count (nr_jobs) of how many outstanding jobs each
kcopyd_client has.

The snapshot destructor first unregisters the snapshot so that no new kcopyd
jobs (created by writes to the origin) will reference that particular
snapshot.  kcopyd_client_destroy() is now run next to wait for the completion
of any outstanding jobs before the snapshot exception structures (that those
jobs reference) are freed.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-snap.c
drivers/md/kcopyd.c