OSDN Git Service

dm thin: fix a race in thin_dtr
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 5 Nov 2014 22:00:13 +0000 (17:00 -0500)
committerMike Snitzer <snitzer@redhat.com>
Thu, 13 Nov 2014 01:15:04 +0000 (20:15 -0500)
commit17181fb7a0c3a279196c0eeb2caba65a1519614b
treee8f9d8b7b2134f55e75fca41b9d4fa0165e2f088
parentd1d9220cbaeecce910f3ecfeb71cc897a678eb68
dm thin: fix a race in thin_dtr

As long as struct thin_c is in the list, anyone can grab a reference of
it.  Consequently, we must wait for the reference count to drop to zero
*after* we remove the structure from the list, not before.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-thin.c