diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-03-13 11:05:11 +0530 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2014-03-13 11:05:11 +0530 |
commit | 9a56e248ceed0932efe75287f4fced7d80004fb3 (patch) | |
tree | c9e3804e8c78152778dea2e7343f97926aec8b81 /drivers/md/persistent-data/dm-array.c | |
parent | f83157af2b0ca9214efde0fd92e988d708e0423c (diff) | |
parent | 50a3a706c880500ec305e7af51bd5f2363a8cc44 (diff) |
Merge branch 'linux-3.10.33' into dev-kernel-3.10
Bug 1456092
Change-Id: Ic563f451abb08754fea0e2bbf0ce065ca2e6e770
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Diffstat (limited to 'drivers/md/persistent-data/dm-array.c')
-rw-r--r-- | drivers/md/persistent-data/dm-array.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/md/persistent-data/dm-array.c b/drivers/md/persistent-data/dm-array.c index af96e24ec328..1d75b1dc1e2e 100644 --- a/drivers/md/persistent-data/dm-array.c +++ b/drivers/md/persistent-data/dm-array.c @@ -317,8 +317,16 @@ static int shadow_ablock(struct dm_array_info *info, dm_block_t *root, * The shadow op will often be a noop. Only insert if it really * copied data. */ - if (dm_block_location(*block) != b) + if (dm_block_location(*block) != b) { + /* + * dm_tm_shadow_block will have already decremented the old + * block, but it is still referenced by the btree. We + * increment to stop the insert decrementing it below zero + * when overwriting the old value. + */ + dm_tm_inc(info->btree_info.tm, b); r = insert_ablock(info, index, *block, root); + } return r; } |