mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 02:01:18 -04:00
Merge tag 'for-7.1/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fix from Mikulas Patocka: - fix metadata corruption in dm-thin * tag 'for-7.1/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm-thin: fix metadata refcount underflow
This commit is contained in:
@@ -490,12 +490,20 @@ static int rebalance_children(struct shadow_spine *s,
|
||||
|
||||
if (le32_to_cpu(n->header.nr_entries) == 1) {
|
||||
struct dm_block *child;
|
||||
int is_shared;
|
||||
dm_block_t b = value64(n, 0);
|
||||
|
||||
r = dm_tm_block_is_shared(info->tm, b, &is_shared);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = dm_tm_read_lock(info->tm, b, &btree_node_validator, &child);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if (is_shared)
|
||||
inc_children(info->tm, dm_block_data(child), vt);
|
||||
|
||||
memcpy(n, dm_block_data(child),
|
||||
dm_bm_block_size(dm_tm_get_bm(info->tm)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user