+ r = _dm_create_device(name, type, dmd->data_device, dmd_flags,
+ dmd->uuid, dmd->size, table_params, reload);
+
+ /* If discard not supported try to load without discard */
+ if (!reload && r && dmd->target == DM_CRYPT &&
+ (dmd->flags & CRYPT_ACTIVATE_ALLOW_DISCARDS) &&
+ !(dm_flags() & DM_DISCARDS_SUPPORTED)) {
+ log_dbg("Discard/TRIM is not supported, retrying activation.");
+ dmd_flags = dmd_flags & ~CRYPT_ACTIVATE_ALLOW_DISCARDS;
+ crypt_safe_free(table_params);
+ table_params = get_dm_crypt_params(dmd, dmd_flags);
+ r = _dm_create_device(name, type, dmd->data_device, dmd_flags,
+ dmd->uuid, dmd->size, table_params, reload);
+ }