Skip to content
  • Alasdair G Kergon's avatar
    [PATCH] dm snapshot: fix kcopyd destructor · 138728dc
    Alasdair G Kergon authored
    
    
    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: default avatarAlasdair G Kergon <agk@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    138728dc