From 0f2adcc9efc8621fa5cf3a1871f2294fa7da7f1f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 21 Sep 2014 23:07:02 +0200 Subject: [PATCH] activate: lv_check_not_in_use no check of closed Don't perform expensive sysfs tests when the device is closed. (having open_count == 0). --- WHATS_NEW | 1 + lib/activate/activate.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index c5ba9fa52..b4ee93494 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.112 - ===================================== + Do not scan sysfs in lv_check_not_in_use() when device is closed. Backup final metadata after resync of mirror/raid. Unify handling of --persistent option for lvcreate and lvchange. Validate major and minor numbers stored in metadata. diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 2091fa12d..7f3a71127 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -700,7 +700,7 @@ int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv, { unsigned int open_count_check_retries; - if (!info->exists) + if (!info->exists || !info->open_count) return 1; /* If sysfs is not used, use open_count information only. */ -- 2.43.5