]> git.baikalelectronics.ru Git - kernel.git/commit
dm table: fix regression from improper dm_dev_internal.count refcount_t conversion
authorMike Snitzer <snitzer@redhat.com>
Sat, 25 Nov 2017 05:27:26 +0000 (00:27 -0500)
committerMike Snitzer <snitzer@redhat.com>
Mon, 4 Dec 2017 15:23:10 +0000 (10:23 -0500)
commit3e2b312bdeb90f9d4a68b75b51d72b8703eb919c
tree8d5abb8627ae852a7dc191ffac9dfb27c58d1635
parent0093d2df02d4e11e0da02e94f52cf63263b16c41
dm table: fix regression from improper dm_dev_internal.count refcount_t conversion

Multiple refcounts are needed if the device was already added.  The
micro-optimization of setting the refcount to 1 on first added (rather
than fall thru to a common refcount_inc) lost sight of the fact that the
refcount_inc is also needed for the case when the device already exists
and the mode need not be upgraded.

Fixes: e63954b1e7 ("dm: convert dm_dev_internal.count from atomic_t to refcount_t")
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-table.c