Benjamin Marzinski 314c25c56c dm space map metadata: fix 'struct sm_metadata' leak on failed create
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'.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
2016-12-08 14:13:14 -05:00
..
2016-09-21 09:09:44 -07:00
2016-07-28 17:38:16 -07:00
2016-06-07 13:41:38 -06:00
2016-08-07 14:41:02 -06:00
2016-08-07 14:41:02 -06:00
2016-07-28 17:38:16 -07:00
2016-08-07 14:41:02 -06:00
2016-08-07 14:41:02 -06:00
2016-07-20 23:49:49 -04:00
2016-08-07 14:41:02 -06:00
2016-09-21 09:09:44 -07:00
2016-08-07 14:41:02 -06:00
2016-08-07 14:41:02 -06:00
2016-10-24 15:28:17 -07:00