summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2014-11-24 14:08:57 (GMT)
committerMike Snitzer <snitzer@redhat.com>2014-12-01 16:30:07 (GMT)
commit8001e87d0ee98787c46f14f5f4f97aced70f119f (patch)
treeff70d07dbafed0b3da8310eb9aff894ef8d4ed18
parenta12f5d48bdfeb5fe10157ac01c3de29269f457c6 (diff)
downloadlinux-8001e87d0ee98787c46f14f5f4f97aced70f119f.tar.xz
dm array: if resizing the array is a noop set the new root to the old one
This could've been quite bad (to return success but not update the new root to point at the old) but in practice the only known consumer of the dm array code is the DM cache target. And the DM cache target passes in the same old root to array_resize() anyway. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r--drivers/md/persistent-data/dm-array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/persistent-data/dm-array.c b/drivers/md/persistent-data/dm-array.c
index 1d75b1d..e64b61ad 100644
--- a/drivers/md/persistent-data/dm-array.c
+++ b/drivers/md/persistent-data/dm-array.c
@@ -645,8 +645,10 @@ static int array_resize(struct dm_array_info *info, dm_block_t root,
int r;
struct resize resize;
- if (old_size == new_size)
+ if (old_size == new_size) {
+ *new_root = root;
return 0;
+ }
resize.info = info;
resize.root = root;