]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm space map common: make sure new space is used during extend
authorJoe Thornber <ejt@redhat.com>
Tue, 7 Jan 2014 15:47:59 +0000 (15:47 +0000)
committerMike Snitzer <snitzer@redhat.com>
Tue, 7 Jan 2014 19:13:27 +0000 (14:13 -0500)
commita6beed75ad3d8c0cb5775ec09c0ee11e66683d40
tree50fea3837d4985ea813ea986bfb3317ee37fb668
parentaf7b1e5c767fc895788c971c8f4686402ac8344f
dm space map common: make sure new space is used during extend

When extending a low level space map we should update nr_blocks at
the start so the new space is used for the index entries.

Otherwise extend can fail, e.g.: sm_metadata_extend call sequence
that fails:
 -> sm_ll_extend
    -> dm_tm_new_block -> dm_sm_new_block -> sm_bootstrap_new_block
    => returns -ENOSPC because smm->begin == smm->ll.nr_blocks

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
drivers/md/persistent-data/dm-space-map-common.c