linux/drivers/md/persistent-data
Benjamin Marzinski 5782a811cb dm space map metadata: fix 'struct sm_metadata' leak on failed create
commit 314c25c56c 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'.

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: Ben Hutchings <ben@decadent.org.uk>
History 2017-03-16 02:26:31 +00:00
..
dm-array.c dm array: fix a reference counting bug in shadow_ablock 2013-12-13 14:22:10 -05:00
dm-array.h dm persistent data: add transactional array 2013-03-01 22:45:51 +00:00
dm-bitset.c dm bitset: only flush the current word if it has been dirtied 2014-03-27 16:56:23 -04:00
dm-bitset.h dm bitset: only flush the current word if it has been dirtied 2014-03-27 16:56:23 -04:00
dm-block-manager.c dm transaction manager: fix corruption due to non-atomic transaction commit 2014-03-27 16:56:23 -04:00
dm-block-manager.h dm transaction manager: fix corruption due to non-atomic transaction commit 2014-03-27 16:56:23 -04:00
dm-btree-internal.h dm btree: add ref counting ops for the leaves of top level btrees 2015-09-03 13:29:48 +01:00
dm-btree-remove.c dm btree remove: fix a bug when rebalancing nodes after removal 2015-11-16 11:27:07 +00:00
dm-btree-spine.c dm btree: add ref counting ops for the leaves of top level btrees 2015-09-03 13:29:48 +01:00
dm-btree.c dm btree: fix bufio buffer leaks in dm_btree_del() error path 2016-01-18 22:27:26 +00:00
dm-btree.h dm btree: add dm_btree_find_lowest_key 2014-01-09 16:29:17 -05:00
dm-persistent-data-internal.h dm: add persistent data library 2011-10-31 20:19:11 +00:00
dm-space-map-common.c dm space map common: make sure new space is used during extend 2014-01-07 21:05:17 -05:00
dm-space-map-common.h dm persistent data: only commit space map if index changed 2012-07-27 15:08:06 +01:00
dm-space-map-disk.c dm space map disk: optimise sm_disk_dec_block 2013-11-09 18:20:24 -05:00
dm-space-map-disk.h dm: add persistent data library 2011-10-31 20:19:11 +00:00
dm-space-map-metadata.c dm space map metadata: fix 'struct sm_metadata' leak on failed create 2017-03-16 02:26:31 +00:00
dm-space-map-metadata.h dm thin: allow metadata space larger than supported to go unused 2014-02-27 11:49:08 -05:00
dm-space-map.h dm persistent data: add threshold callback to space map 2013-05-10 14:37:20 +01:00
dm-transaction-manager.c dm transaction manager: fix corruption due to non-atomic transaction commit 2014-03-27 16:56:23 -04:00
dm-transaction-manager.h dm transaction manager: fix corruption due to non-atomic transaction commit 2014-03-27 16:56:23 -04:00
Kconfig dm: fix Kconfig indentation 2014-03-03 17:31:07 -05:00
Makefile dm persistent data: add bitset 2013-03-01 22:45:51 +00:00