]> www.infradead.org Git - users/dwmw2/linux.git/commit
dm thin metadata: use pool locking at end of dm_pool_metadata_close
authorMike Snitzer <snitzer@redhat.com>
Mon, 13 Jan 2020 16:18:51 +0000 (11:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:36:57 +0000 (04:36 -0800)
commit1ebada600cf56ab58f533279392373a0b22e53b6
tree1f3900c0ef6fbb26cd64e797d115eb910daf1381
parentf371110c43903b0c430b3af04b899edccbd4aa67
dm thin metadata: use pool locking at end of dm_pool_metadata_close

commit 44d8ebf436399a40fcd10dd31b29d37823d62fcc upstream.

Ensure that the pool is locked during calls to __commit_transaction and
__destroy_persistent_data_objects.  Just being consistent with locking,
but reality is dm_pool_metadata_close is called once pool is being
destroyed so access to pool shouldn't be contended.

Also, use pmd_write_lock_in_core rather than __pmd_write_lock in
dm_pool_commit_metadata and rename __pmd_write_lock to
pmd_write_lock_in_core -- there was no need for the alias.

In addition, verify that the pool is locked in __commit_transaction().

Fixes: 873f258becca ("dm thin metadata: do not write metadata if no changes occurred")
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-thin-metadata.c