diff --git a/WHATS_NEW b/WHATS_NEW index c7d3a2d52..b0fa32fd4 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,6 +1,7 @@ Version 2.02.98 ================================= Use 'ignore' discards for thin metadata created with older versions. + Use proper condition to check for unsupported discards settings. Version 2.02.97 - 7th August 2012 ================================= diff --git a/lib/thin/thin.c b/lib/thin/thin.c index 25c1947bf..d95b68ea4 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -276,13 +276,13 @@ static int _thin_pool_add_target_line(struct dev_manager *dm, seg->zero_new_blocks ? 0 : 1)) return_0; - if ((seg->discards != THIN_DISCARDS_PASSDOWN) && (attr & THIN_FEATURE_DISCARDS)) { + if (attr & THIN_FEATURE_DISCARDS) { /* FIXME: Check whether underlying dev supports discards */ if (!dm_tree_node_set_thin_pool_discard(node, seg->discards == THIN_DISCARDS_IGNORE, seg->discards == THIN_DISCARDS_NO_PASSDOWN)) return_0; - } else + } else if (seg->discards != THIN_DISCARDS_IGNORE) log_warn_suppress(_no_discards++, "WARNING: Thin pool target does " "not support discards (needs kernel >= 3.4).");