aboutsummaryrefslogtreecommitdiff
path: root/include/linux/root_dev.h
diff options
context:
space:
mode:
authorBenjamin Marzinski <bmarzins@redhat.com>2016-11-30 17:56:14 -0600
committerMister Oyster <oysterized@gmail.com>2017-07-04 11:50:58 +0200
commitce8eb24f7bbf9494ca611c10236ae751ffa23b31 (patch)
tree9412a33f1551774fe8bad609cb26ef77e08955ce /include/linux/root_dev.h
parent240780611f9744c2a0aa6dfdd053a4a6a1b946db (diff)
dm space map metadata: fix 'struct sm_metadata' leak on failed create
commit 314c25c56c1ee5026cf99c570bdfe01847927acb upstream. In dm_sm_metadata_create() we temporarily change the dm_space_map operations from 'ops' (whose .destroy function deallocates the sm_metadata) to 'bootstrap_ops' (whose .destroy function doesn't). If dm_sm_metadata_create() fails in sm_ll_new_metadata() or sm_ll_extend(), it exits back to dm_tm_create_internal(), which calls dm_sm_destroy() with the intention of freeing the sm_metadata, but it doesn't (because the dm_space_map operations is still set to 'bootstrap_ops'). Fix this by setting the dm_space_map operations back to 'ops' if dm_sm_metadata_create() fails when it is set to 'bootstrap_ops'. [js] no nr_blocks test in 3.12 yet Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Acked-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'include/linux/root_dev.h')
0 files changed, 0 insertions, 0 deletions