diff --git a/lib/thin/thin.c b/lib/thin/thin.c index d7c45ca16..14eb096fd 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -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 "