diff options
author | ZhangXiaoxu <zhangxiaoxu5@huawei.com> | 2019-08-17 13:32:40 +0800 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2019-08-22 16:11:23 -0400 |
commit | e4f9d6013820d1eba1432d51dd1c5795759aa77f (patch) | |
tree | e7d3f420754a270eb34f67d6af0187909821aba9 /drivers/gpio | |
parent | dc1a3e8e0cc6b2293b48c044710e63395aeb4fb4 (diff) | |
download | linux-e4f9d6013820d1eba1432d51dd1c5795759aa77f.tar.bz2 |
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: 4dcb8b57df359 ("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>
Diffstat (limited to 'drivers/gpio')
0 files changed, 0 insertions, 0 deletions