dm snapshot: allow live exception store handover between tables
authorMike Snitzer <snitzer@redhat.com>
Thu, 10 Dec 2009 23:52:24 +0000 (23:52 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 10 Dec 2009 23:52:24 +0000 (23:52 +0000)
commitc1f0c183f6acc6d32c5a1d0249ec68bf783af7b1
treef8e8e88e5403a9dbbebff14dc4afd6d475d1c03a
parent042d2a9bcd80fe12d4b0871706aa9dd2231e8238
dm snapshot: allow live exception store handover between tables

Permit in-use snapshot exception data to be 'handed over' from one
snapshot instance to another.  This is a pre-requisite for patches
that allow the changes made in a snapshot device to be merged back into
its origin device and also allows device resizing.

The basic call sequence is:

  dmsetup load new_snapshot (referencing the existing in-use cow device)
     - the ctr code detects that the cow is already in use and allows the
       two snapshot target instances to be linked together
  dmsetup suspend original_snapshot
  dmsetup resume new_snapshot
     - the new_snapshot becomes live, and if anything now tries to access
       the original one it will receive -EIO
  dmsetup remove original_snapshot

(There can only be two snapshot targets referencing the same cow device
simultaneously.)

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-snap.c