[lvm-devel] [patch review] miss adopt orphaned resources

张欢 zhanghuan at chinac.com
Wed Jun 14 12:07:52 UTC 2017


commit afcabe14eab9eb9722ab0715aec15f0375416a35
Author: Huan Zhang <zhanghuan at chinac.com>
Date:   Wed Jun 14 19:51:07 2017 +0800

    miss adopt orphaned resources

    1. dm_uuid is 68 byte length, but buf is 64 which
       will cause miss match uuid from lv lock manager
    2. no lv lock_type path in dm config, use lock_args instead

    Signed-off-by: Zhang Huan <zhanghuan at chinac.com>

diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index 4d96e67..b6f3df9 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -4907,14 +4907,10 @@ static int get_lockd_vgs(struct list_head *vg_lockd)
                                continue;

                        for (lv_cn = md_cn->child; lv_cn; lv_cn = lv_cn->sib) {
-                               snprintf(find_str_path, PATH_MAX, "%s/lock_type", lv_cn->key);
-                               lock_type = dm_config_find_str(lv_cn, find_str_path, NULL);
-
-                               if (!lock_type)
-                                       continue;
-
                                snprintf(find_str_path, PATH_MAX, "%s/lock_args", lv_cn->key);
                                lock_args = dm_config_find_str(lv_cn, find_str_path, NULL);
+                               if (!lock_args)
+                                       continue;

                                snprintf(find_str_path, PATH_MAX, "%s/id", lv_cn->key);
                                lv_uuid = dm_config_find_str(lv_cn, find_str_path, NULL);
@@ -4960,7 +4956,7 @@ out:
        return rv;
 }

-static char _dm_uuid[64];
+static char _dm_uuid[72];

 static char *get_dm_uuid(char *dm_name)
 {
> 张欢
> 基础平台产品线
> 手机: 17798706680






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20170614/8ca288c6/attachment.htm>


More information about the lvm-devel mailing list