dm space map metadata: fix extending the space map
authorJoe Thornber <ejt@redhat.com>
Tue, 7 Jan 2014 15:49:02 +0000 (15:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:48:01 +0000 (13:48 -0800)
commitf15396a3699d02f863e80623e0771d3f95f08974
treedf9e51bbd0545a42ff1a46a61efcae757304fe35
parent247373410ad9f7f4dfc6a7a9c0bb4bcd0af59491
dm space map metadata: fix extending the space map

commit 7e664b3dec431eebf0c5df5ff704d6197634cf35 upstream.

When extending a metadata space map we should do the first commit whilst
still in bootstrap mode -- a mode where all blocks get allocated in the
new area.

That way the commit overhead is allocated from the newly added space.
Otherwise we risk running out of space.

With this fix, and the previous commit "dm space map common: make sure
new space is used during extend", the following device mapper testsuite
test passes:
 dmtest run --suite thin-provisioning -n /resize_metadata_no_io/

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/persistent-data/dm-space-map-metadata.c