1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

clvmd: Update new remove_info INTERNAL_ERRORS.

This commit is contained in:
Alasdair G Kergon 2014-04-04 01:37:43 +01:00
parent 12ddaa5f10
commit c16c1a9f70

View File

@ -180,15 +180,17 @@ static int insert_info(const char *resource, struct lv_info *lvi)
static void remove_info(const char *resource) static void remove_info(const char *resource)
{ {
int num_open;
pthread_mutex_lock(&lv_hash_lock); pthread_mutex_lock(&lv_hash_lock);
dm_hash_remove(lv_hash, resource); dm_hash_remove(lv_hash, resource);
/* When last lock is remove, validate there are not left opened devices */ /* When last lock is remove, validate there are not left opened devices */
if (!dm_hash_get_first(lv_hash)) { if (!dm_hash_get_first(lv_hash)) {
if (dev_cache_check_for_open_devices())
log_error(INTERNAL_ERROR "Nothing is locked however there are still opened devices.");
if (critical_section()) if (critical_section())
log_error(INTERNAL_ERROR "Nothing is locked however clvmd is left in critical section."); log_error(INTERNAL_ERROR "No volumes are locked however clvmd is in activation mode critical section.");
if ((num_open = dev_cache_check_for_open_devices()))
log_error(INTERNAL_ERROR "No volumes are locked however %d devices are still open.", num_open);
} }
pthread_mutex_unlock(&lv_hash_lock); pthread_mutex_unlock(&lv_hash_lock);