]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Mar 2016 11:45:52 +0000 (12:45 +0100)
commitac1c97af50cea184619281620520e76bee15cfdf
tree20cf5e4a64de4f9da710076c21be785259e1d030
parent22481d15ed990d6c00be6dc0097cfc93279bfec9
dm thin metadata: fix bug when taking a metadata snapshot

commit 49e99fc717f624aa75ca755d6e7bc029efd3f0e9 upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/md/dm-thin-metadata.c