Patch "dm thin metadata: fix bug when taking a metadata snapshot" has been added to the 3.14-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
dm thin metadata: fix bug when taking a metadata snapshot
to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
dm-thin-metadata-fix-bug-when-taking-a-metadata-snapshot.patch
and it can be found in the queue-3.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
49e99fc717f624aa75ca755d6e7bc029efd3f0e9Mon Sep 17 00:00:00 2001
From: Joe Thornber <[email protected]>
Date: Wed, 9 Dec 2015 16:23:24 +0000
Subject: dm thin metadata: fix bug when taking a metadata snapshot
From: Joe Thornber <[email protected]>
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.
--- drivers/md/dm-thin-metadata.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/md/dm-thin-metadata.c +6 -0
@@ -1205,6 +1205,12 @@ static int __reserve_metadata_snap(strucdm_block_t held_root;/* +* We commit to ensure the btree roots which we increment in a +* moment are up to date. +*/ +__commit_transaction (pmd); + +/* * Copy the superblock. */ dm_sm_inc_block (pmd->metadata_sm,THIN_SUPERBLOCK_LOCATION );
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/dm-thin-restore-requested-error_if_no_space-setting-on-oods-to-write-transition.patch queue-3.14/dm-thin-metadata-fix-bug-when-taking-a-metadata-snapshot.patch