dm: take care to copy the space map roots before locking the superblock
authorJoe Thornber <ejt@redhat.com>
Thu, 27 Mar 2014 14:13:23 +0000 (14:13 +0000)
committerJiri Slaby <jslaby@suse.cz>
Thu, 15 May 2014 07:56:14 +0000 (09:56 +0200)
commit8038ee15c63c16a64c7ee412bc7dc442ee962f6c
tree8e063e78b1d942c65af7432608aba3a6f24873b5
parent44c13517c67e063f89a1118c3ebdc6ab040b9cb6
dm: take care to copy the space map roots before locking the superblock

commit 5a32083d03fb543f63489b2946c4948398579ba0 upstream.

In theory copying the space map root can fail, but in practice it never
does because we're careful to check what size buffer is needed.

But make certain we're able to copy the space map roots before
locking the superblock.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/md/dm-cache-metadata.c
drivers/md/dm-thin-metadata.c