linux/drivers/md/persistent-data
ZhangXiaoxu e4f9d60138 dm btree: fix order of block initialization in btree_split_beneath
When btree_split_beneath() splits a node to two new children, it will
allocate two blocks: left and right.  If right block's allocation
failed, the left block will be unlocked and marked dirty.  If this
happened, the left block'ss content is zero, because it wasn't
initialized with the btree struct before the attempot to allocate the
right block.  Upon return, when flushing the left block to disk, the
validator will fail when check this block.  Then a BUG_ON is raised.

Fix this by completely initializing the left block before allocating and
initializing the right block.

Fixes: 4dcb8b57df ("dm btree: fix leak of bufio-backed block in btree_split_beneath error path")
Cc: stable@vger.kernel.org
Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2019-08-22 16:11:23 -04:00
..
dm-array.c dm persistent data: add cursor skip functions to the cursor APIs 2017-02-16 13:12:50 -05:00
dm-array.h dm persistent data: add cursor skip functions to the cursor APIs 2017-02-16 13:12:50 -05:00
dm-bitset.c dm persistent data: add cursor skip functions to the cursor APIs 2017-02-16 13:12:50 -05:00
dm-bitset.h dm persistent data: add cursor skip functions to the cursor APIs 2017-02-16 13:12:50 -05:00
dm-block-manager.c dm persistent data: Simplify stack trace handling 2019-04-29 12:37:52 +02:00
dm-block-manager.h dm block manager: remove an unused argument from dm_block_manager_create() 2017-04-27 17:08:41 -04:00
dm-btree-internal.h dm persistent data: eliminate unnecessary return values 2015-10-31 19:06:02 -04:00
dm-btree-remove.c - Revert a dm-multipath change that caused a regression for unprivledged 2015-11-04 21:19:53 -08:00
dm-btree-spine.c dm persistent data: eliminate unnecessary return values 2015-10-31 19:06:02 -04:00
dm-btree.c dm btree: fix order of block initialization in btree_split_beneath 2019-08-22 16:11:23 -04:00
dm-btree.h dm persistent data: add cursor skip functions to the cursor APIs 2017-02-16 13:12:50 -05:00
dm-persistent-data-internal.h
dm-space-map-common.c dm space map common: zero entire ll_disk 2019-04-18 16:18:32 -04: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: fix some book keeping in the disk space map 2017-05-15 15:09:50 -04:00
dm-space-map-disk.h
dm-space-map-metadata.c dm space map metadata: use ARRAY_SIZE 2017-11-10 15:44:52 -05: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 persistent data: eliminate unnecessary return values 2015-10-31 19:06:02 -04:00
dm-transaction-manager.h dm persistent data: eliminate unnecessary return values 2015-10-31 19:06:02 -04:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00