Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8001e87d authored by Joe Thornber's avatar Joe Thornber Committed by Mike Snitzer
Browse files

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: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent a12f5d48
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;