diff options
-rw-r--r-- | drivers/md/dm-thin.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 922aa553e9e0..493478989dbd 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -3832,6 +3832,8 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
3832 | r = -EINVAL; | 3832 | r = -EINVAL; |
3833 | goto bad; | 3833 | goto bad; |
3834 | } | 3834 | } |
3835 | atomic_set(&tc->refcount, 1); | ||
3836 | init_completion(&tc->can_destroy); | ||
3835 | list_add_tail_rcu(&tc->list, &tc->pool->active_thins); | 3837 | list_add_tail_rcu(&tc->list, &tc->pool->active_thins); |
3836 | spin_unlock_irqrestore(&tc->pool->lock, flags); | 3838 | spin_unlock_irqrestore(&tc->pool->lock, flags); |
3837 | /* | 3839 | /* |
@@ -3844,9 +3846,6 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
3844 | 3846 | ||
3845 | dm_put(pool_md); | 3847 | dm_put(pool_md); |
3846 | 3848 | ||
3847 | atomic_set(&tc->refcount, 1); | ||
3848 | init_completion(&tc->can_destroy); | ||
3849 | |||
3850 | return 0; | 3849 | return 0; |
3851 | 3850 | ||
3852 | bad: | 3851 | bad: |