From: Mike Snitzer <[email-masked]>

I reviewed the patch and had a few suggestions; please see the following
small incremental patch (Alasdair please feel free to fold these nits
into Joe's original patch).

The switch from dm_tm_unlock() to dm_bm_unlock() in 2 places was done
because the block was locked with the block-manager (rather than a tm
wrapper).

There are still remnants of "held root" but I didn't feel that strongly
to change the superblock's variable name, clean up the header comment,
etc.

Signed-Off-By: Mike Snitzer <[email-masked]>
Acked-by: Mike Snitzer <[email-masked]>

---
 Documentation/device-mapper/thin-provisioning.txt |    2 +-
 drivers/md/dm-thin-metadata.c                     |   10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

Index: linux-3.4/Documentation/device-mapper/thin-provisioning.txt
===================================================================
--- linux-3.4.orig/Documentation/device-mapper/thin-provisioning.txt
+++ linux-3.4/Documentation/device-mapper/thin-provisioning.txt
@@ -292,7 +292,7 @@ iii) Messages
         Reserve a copy of the data mapping btree for use by userland.
         This allows userland to inspect the mappings as they were when
         this message was executed.  Use the pool's status command to
-        get the root block.
+        get the root block associated with the metadata snapshot.
 
     release_metadata_snap
 
Index: linux-3.4/drivers/md/dm-thin-metadata.c
===================================================================
--- linux-3.4.orig/drivers/md/dm-thin-metadata.c
+++ linux-3.4/drivers/md/dm-thin-metadata.c
@@ -1093,7 +1093,8 @@ static int __reserve_metadata_snap(struc
 	 * Copy the superblock.
 	 */
 	dm_sm_inc_block(pmd->metadata_sm, THIN_SUPERBLOCK_LOCATION);
-	r = dm_tm_shadow_block(pmd->tm, THIN_SUPERBLOCK_LOCATION, &sb_validator, &copy, &inc);
+	r = dm_tm_shadow_block(pmd->tm, THIN_SUPERBLOCK_LOCATION,
+			       &sb_validator, &copy, &inc);
 	if (r)
 		return r;
 	BUG_ON(!inc);
@@ -1111,7 +1112,8 @@ static int __reserve_metadata_snap(struc
 	/*
 	 * Wipe the spacemap since we're not publishing this.
 	 */
-	memset(&disk_super->data_space_map_root, 0, sizeof(disk_super->data_space_map_root));
+	memset(&disk_super->data_space_map_root, 0,
+	       sizeof(disk_super->data_space_map_root));
 	memset(&disk_super->metadata_space_map_root, 0,
 	       sizeof(disk_super->metadata_space_map_root));
 
@@ -1135,7 +1137,7 @@ static int __reserve_metadata_snap(struc
 
 	disk_super = dm_block_data(sblock);
 	disk_super->held_root = cpu_to_le64(held_root);
-	dm_tm_unlock(pmd->tm, sblock);
+	dm_bm_unlock(sblock);
 
 	pmd->need_commit = 1;
 	return 0;
@@ -1169,7 +1171,7 @@ static int __release_metadata_snap(struc
 	disk_super->held_root = cpu_to_le64(0);
 	pmd->need_commit = 1;
 
-	dm_tm_unlock(pmd->tm, sblock);
+	dm_bm_unlock(sblock);
 
 	if (!held_root) {
 		DMWARN("pool has no metadata snap");