]> git.baikalelectronics.ru Git - kernel.git/commit
dm thin metadata: fix bug when taking a metadata snapshot
authorJoe Thornber <ejt@redhat.com>
Wed, 9 Dec 2015 16:23:24 +0000 (16:23 +0000)
committerMike Snitzer <snitzer@redhat.com>
Wed, 9 Dec 2015 18:18:12 +0000 (13:18 -0500)
commit210d959e960df1abbe4de06a4458a757a7c12f05
treed4bf6148e45a044eaf8cba9c5e827efff06a7f1b
parent327fa6ae9be1c4432f04bcd5348da81cb652983a
dm thin metadata: fix bug when taking a metadata snapshot

When you take a metadata snapshot the btree roots for the mapping and
details tree need to have their reference counts incremented so they
persist for the lifetime of the metadata snap.

The roots being incremented were those currently written in the
superblock, which could possibly be out of date if concurrent IO is
triggering new mappings, breaking of sharing, etc.

Fix this by performing a commit with the metadata lock held while taking
a metadata snapshot.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
drivers/md/dm-thin-metadata.c