]> git.hungrycats.org Git - linux/commit
dm thin: fix a race in thin_dtr
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 5 Nov 2014 22:00:13 +0000 (17:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:30:19 +0000 (10:30 -0800)
commitffcc89dbcbe470f537aa104bb84cbf3eed77d67d
tree383ade16885ebf63df4534aa4195a59f82e97988
parent2409f5131d09a7a1e2a0a69ee4fb7788954de5cf
dm thin: fix a race in thin_dtr

commit 17181fb7a0c3a279196c0eeb2caba65a1519614b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-thin.c