mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
thin: fix condition for kernels without discards
Report warning if the kernel is not support given discards settings. (In this case the behavior is equal to IGNORE.)
This commit is contained in:
parent
1f1c664b78
commit
b8a6efbcc0
@ -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
|
||||
=================================
|
||||
|
@ -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).");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user