diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index e594e3812..c3e8e1594 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.73 - ==================================== + Drop unsupported TRIM message for thin pool. Improve logging for fifo startup in dmeventd. Add few pointer validation in dmsetup. Support dm_task_get_driver_version() query without version string. diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index f66917c70..0c00e7a6a 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -70,7 +70,6 @@ int detach_pool_lv(struct lv_segment *seg) switch (tmsg->type) { case DM_THIN_MESSAGE_CREATE_SNAP: case DM_THIN_MESSAGE_CREATE_THIN: - case DM_THIN_MESSAGE_TRIM: if (tmsg->u.lv == seg->lv) { log_debug("Discarding message for LV %s.", tmsg->u.lv->name); @@ -151,7 +150,6 @@ int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type, switch (type) { case DM_THIN_MESSAGE_CREATE_SNAP: case DM_THIN_MESSAGE_CREATE_THIN: - case DM_THIN_MESSAGE_TRIM: tmsg->u.lv = lv; break; case DM_THIN_MESSAGE_DELETE: @@ -173,7 +171,6 @@ int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type, log_debug("Added %s message", (type == DM_THIN_MESSAGE_CREATE_SNAP || type == DM_THIN_MESSAGE_CREATE_THIN) ? "create" : - (type == DM_THIN_MESSAGE_TRIM) ? "trim" : (type == DM_THIN_MESSAGE_DELETE) ? "delete" : "unknown"); return 1; @@ -200,7 +197,6 @@ int pool_has_message(const struct lv_segment *seg, switch (tmsg->type) { case DM_THIN_MESSAGE_CREATE_SNAP: case DM_THIN_MESSAGE_CREATE_THIN: - case DM_THIN_MESSAGE_TRIM: if (tmsg->u.lv == lv) return 1; break; diff --git a/lib/thin/thin.c b/lib/thin/thin.c index 65b130b8e..c04577371 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -62,15 +62,6 @@ static int _thin_pool_add_message(struct lv_segment *seg, type = DM_THIN_MESSAGE_CREATE_THIN; } - if (dm_config_get_str(sn, "trim", &lv_name)) { - if (lv) - return SEG_LOG_ERROR("Unsupported message format in"); - if (!(lv = find_lv(seg->lv->vg, lv_name))) - return SEG_LOG_ERROR("Unknown LV %s for trim message in", - lv_name); - type = DM_THIN_MESSAGE_TRIM; - } - if (!dm_config_get_uint32(sn, "delete", &delete_id)) { if (!lv) return SEG_LOG_ERROR("Unknown message in"); @@ -169,7 +160,6 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter switch (tmsg->type) { case DM_THIN_MESSAGE_CREATE_SNAP: case DM_THIN_MESSAGE_CREATE_THIN: - case DM_THIN_MESSAGE_TRIM: if (!lv_is_thin_volume(tmsg->u.lv)) { log_error(INTERNAL_ERROR "LV %s is not a thin volume.", @@ -192,9 +182,6 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter case DM_THIN_MESSAGE_CREATE_THIN: outf(f, "create = \"%s\"", tmsg->u.lv->name); break; - case DM_THIN_MESSAGE_TRIM: - outf(f, "trim = \"%s\"", tmsg->u.lv->name); - break; case DM_THIN_MESSAGE_DELETE: outf(f, "delete = %d", tmsg->u.delete_id); break; @@ -302,10 +289,6 @@ static int _thin_pool_add_target_line(struct dev_manager *dm, lmsg->u.delete_id, 0)) return_0; break; - case DM_THIN_MESSAGE_TRIM: - /* FIXME: to be implemented */ - log_error("Sorry TRIM is not yet supported."); - return 0; default: log_error(INTERNAL_ERROR "Unsupported message."); return 0; diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index ce8b2bb16..dfbadaa27 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -650,7 +650,6 @@ typedef enum { DM_THIN_MESSAGE_CREATE_THIN, /* device_id */ DM_THIN_MESSAGE_DELETE, /* device_id */ DM_THIN_MESSAGE_SET_TRANSACTION_ID, /* current_id, new_id */ - DM_THIN_MESSAGE_TRIM /* device_id, new_size */ } dm_thin_message_t; int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node, diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 061331630..e80db2fee 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -1404,11 +1404,6 @@ static int _thin_pool_node_message(struct dm_tree_node *dnode, struct thin_messa r = dm_snprintf(buf, sizeof(buf), "delete %u", m->u.m_delete.device_id); break; - case DM_THIN_MESSAGE_TRIM: - r = dm_snprintf(buf, sizeof(buf), "trim %u %" PRIu64, - m->u.m_trim.device_id, - m->u.m_trim.new_size); - break; case DM_THIN_MESSAGE_SET_TRANSACTION_ID: r = dm_snprintf(buf, sizeof(buf), "set_transaction_id %" PRIu64 " %" PRIu64, @@ -3051,12 +3046,6 @@ int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node, tm->message.u.m_delete.device_id = id1; tm->expected_errno = ENODATA; break; - case DM_THIN_MESSAGE_TRIM: - if (!_thin_validate_device_id(id1)) - return_0; - tm->message.u.m_trim.device_id = id1; - tm->message.u.m_trim.new_size = id2; - break; case DM_THIN_MESSAGE_SET_TRANSACTION_ID: if ((id1 + 1) != id2) { log_error("New transaction id must be sequential.");