mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
thin: fix test for dicards ignore settings
Arghh, this was bad last-minute shortening of if() expression
in the commit 1ef9831018
.
dm_tree_node_set_thin_pool_discard() must not run in the same
expression as check for non-power-2 discard, otherwise
there are 2 calls for dm_tree_node_set_thin_pool_discard
and whole setting of discards is missinterpretted.
In-relase fix it by using proper parentheses {}.
This commit is contained in:
parent
ed65860861
commit
17be6d5210
@ -289,11 +289,11 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
|
||||
/* FIXME: Check whether underlying dev supports discards */
|
||||
if (((!(attr & THIN_FEATURE_DISCARDS_NON_POWER_2) &&
|
||||
(seg->chunk_size & (seg->chunk_size - 1))) ||
|
||||
(seg->discards == THIN_DISCARDS_IGNORE)) &&
|
||||
!dm_tree_node_set_thin_pool_discard(node, 1, 0))
|
||||
return_0;
|
||||
else if (!dm_tree_node_set_thin_pool_discard(node, 0,
|
||||
(seg->discards == THIN_DISCARDS_NO_PASSDOWN)))
|
||||
(seg->discards == THIN_DISCARDS_IGNORE))) {
|
||||
if (!dm_tree_node_set_thin_pool_discard(node, 1, 0))
|
||||
return_0;
|
||||
} else if (!dm_tree_node_set_thin_pool_discard(node, 0,
|
||||
(seg->discards == THIN_DISCARDS_NO_PASSDOWN)))
|
||||
return_0;
|
||||
} else if (seg->discards != THIN_DISCARDS_IGNORE)
|
||||
log_warn_suppress(_no_discards++, "WARNING: Thin pool target does "
|
||||
|
Loading…
Reference in New Issue
Block a user