Three stable fixes (two in btree code used by DM thinp and one to
properly store flags in DM cache metadata's superblock). -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJWKneZAAoJEMUj8QotnQNahVIIAKNJ5kkOLTtlZqKeio0b6DmE utvbNIbcesuBkg4rA67kDBgrTpxFiwaIyC5CBc9dEKzjJY9L+gJ59nXbLWKKu9N1 qBQOlnuYx/fdREDe00HObwZ7Fiw9ofBU71hdrZsHtntHHULEOBqFvnynglZA33Nb vtBiupwO84uMY9eQdBhZudIb+F3PFF5uBkLfwlhaDmCugUdA9bivz0/P+7x6/Lt5 R25+3D0gF2gXU060An2ZBJaenkSMPYBoWGtpK6TJkQzlNMODc8y9opt0hsEwIJT8 A7TsJRXkjWPPA+DlVlqUd3yWpMKlBaC8o+TB1HvpfGqqCxiZQm7PgxNX8d/yd+E= =7+lz -----END PGP SIGNATURE----- Merge tag 'dm-4.3-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: "Three stable fixes (two in btree code used by DM thinp and one to properly store flags in DM cache metadata's superblock)" * tag 'dm-4.3-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm cache: the CLEAN_SHUTDOWN flag was not being set dm btree: fix leak of bufio-backed block in btree_split_beneath error path dm btree remove: fix a bug when rebalancing nodes after removal
This commit is contained in:
Коммит
35df017c4d
|
@ -634,10 +634,10 @@ static int __commit_transaction(struct dm_cache_metadata *cmd,
|
|||
|
||||
disk_super = dm_block_data(sblock);
|
||||
|
||||
disk_super->flags = cpu_to_le32(cmd->flags);
|
||||
if (mutator)
|
||||
update_flags(disk_super, mutator);
|
||||
|
||||
disk_super->flags = cpu_to_le32(cmd->flags);
|
||||
disk_super->mapping_root = cpu_to_le64(cmd->root);
|
||||
disk_super->hint_root = cpu_to_le64(cmd->hint_root);
|
||||
disk_super->discard_root = cpu_to_le64(cmd->discard_root);
|
||||
|
|
|
@ -301,11 +301,16 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent,
|
|||
{
|
||||
int s;
|
||||
uint32_t max_entries = le32_to_cpu(left->header.max_entries);
|
||||
unsigned target = (nr_left + nr_center + nr_right) / 3;
|
||||
BUG_ON(target > max_entries);
|
||||
unsigned total = nr_left + nr_center + nr_right;
|
||||
unsigned target_right = total / 3;
|
||||
unsigned remainder = (target_right * 3) != total;
|
||||
unsigned target_left = target_right + remainder;
|
||||
|
||||
BUG_ON(target_left > max_entries);
|
||||
BUG_ON(target_right > max_entries);
|
||||
|
||||
if (nr_left < nr_right) {
|
||||
s = nr_left - target;
|
||||
s = nr_left - target_left;
|
||||
|
||||
if (s < 0 && nr_center < -s) {
|
||||
/* not enough in central node */
|
||||
|
@ -316,10 +321,10 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent,
|
|||
} else
|
||||
shift(left, center, s);
|
||||
|
||||
shift(center, right, target - nr_right);
|
||||
shift(center, right, target_right - nr_right);
|
||||
|
||||
} else {
|
||||
s = target - nr_right;
|
||||
s = target_right - nr_right;
|
||||
if (s > 0 && nr_center < s) {
|
||||
/* not enough in central node */
|
||||
shift(center, right, nr_center);
|
||||
|
@ -329,7 +334,7 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent,
|
|||
} else
|
||||
shift(center, right, s);
|
||||
|
||||
shift(left, center, nr_left - target);
|
||||
shift(left, center, nr_left - target_left);
|
||||
}
|
||||
|
||||
*key_ptr(parent, c->index) = center->keys[0];
|
||||
|
|
|
@ -523,7 +523,7 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key)
|
|||
|
||||
r = new_block(s->info, &right);
|
||||
if (r < 0) {
|
||||
/* FIXME: put left */
|
||||
unlock_block(s->info, left);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче