[lvm-devel] master - activate: lv_check_not_in_use no check of closed

Zdenek Kabelac zkabelac at fedoraproject.org
Wed Sep 24 08:56:39 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0f2adcc9efc8621fa5cf3a1871f2294fa7da7f1f
Commit:        0f2adcc9efc8621fa5cf3a1871f2294fa7da7f1f
Parent:        392bb6f46eb73dcf725566fbdf006a4e02ae7502
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Sun Sep 21 23:07:02 2014 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Wed Sep 24 10:47:00 2014 +0200

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 deletions(-)

diff --git a/WHATS_NEW b/WHATS_NEW
index c5ba9fa..b4ee934 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 2091fa1..7f3a711 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. */




More information about the lvm-devel mailing list