]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
IMSM: retry reading sync_completed during reshape
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index 6e7d3fb93306bda2403e771a59e36cc689e89f52..2bcb81fa921a9150aa0ab639f9b68529d61ac1ee 100644 (file)
--- a/util.c
+++ b/util.c
@@ -24,7 +24,6 @@
 
 #include       "mdadm.h"
 #include       "md_p.h"
-#include       <sys/poll.h>
 #include       <sys/socket.h>
 #include       <sys/utsname.h>
 #include       <sys/wait.h>
@@ -32,6 +31,7 @@
 #include       <sys/resource.h>
 #include       <sys/vfs.h>
 #include       <linux/magic.h>
+#include       <poll.h>
 #include       <ctype.h>
 #include       <dirent.h>
 #include       <signal.h>
@@ -147,13 +147,7 @@ int cluster_get_dlmlock(int *lockid)
                return -ENOMEM;
        }
 
-       /* Conversions need the lockid in the LKSB */
-       if (flags & LKF_CONVERT)
-               dlm_lock_res->lksb.sb_lkid = *lockid;
-
        snprintf(str, 64, "bitmap%s", cluster_name);
-       /* if flags with LKF_CONVERT causes below return ENOENT which means
-        * "No such file or directory" */
        ret = dlm_hooks->ls_lock(dlm_lock_res->ls, LKM_PWMODE, &dlm_lock_res->lksb,
                          flags, str, strlen(str), 0, dlm_ast,
                          dlm_lock_res, NULL, NULL);
@@ -177,8 +171,6 @@ int cluster_release_dlmlock(int lockid)
        if (!cluster_name)
                return -1;
 
-       /* if flags with LKF_CONVERT causes below return EINVAL which means
-        * "Invalid argument" */
        ret = dlm_hooks->ls_unlock(dlm_lock_res->ls, lockid, 0,
                                     &dlm_lock_res->lksb, dlm_lock_res);
        if (ret) {
@@ -1199,8 +1191,7 @@ struct supertype *super_by_fd(int fd, char **subarrayp)
                        subarray = xstrdup(subarray);
                }
                strcpy(container, dev);
-               if (sra)
-                       sysfs_free(sra);
+               sysfs_free(sra);
                sra = sysfs_read(-1, container, GET_VERSION);
                if (sra && sra->text_version[0])
                        verstr = sra->text_version;
@@ -1211,8 +1202,7 @@ struct supertype *super_by_fd(int fd, char **subarrayp)
        for (i = 0; st == NULL && superlist[i] ; i++)
                st = superlist[i]->match_metadata_desc(verstr);
 
-       if (sra)
-               sysfs_free(sra);
+       sysfs_free(sra);
        if (st) {
                st->sb = NULL;
                if (subarrayp)