Skip to contentSkip to conversation

Fifteen multipath-tools patches

PATCH In review Bart Van Assche 3 participants 20 messages Oct 21, 2016 – Oct 24, 2016 Device mapper

lore
Share & tools
lore
#0 lore raw

cover Fifteen multipath-tools patches

Hello Christophe,

It would be appreciated if you would consider this patch series for inclusion in the multipath-tools repository. The changes in this patch series are:
- A build fix for musl-libc.
- A fix for a deadlock during shutdown.
- A bunch of patches that address warnings reported by the sparse
static analyzer.

Thanks,

Bart.

#1 lore raw

PATCH 1/15 libmultipath: Make building against musl-libc again possible

musl-libc does not support PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP.

This patch reverts commit 7884bde302ad ("multipathd: Avoid that a deadlock is triggered sporadically during shutdown").

---
 libmultipath/uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/uevent.c +1 -1
index 85fd2fb..6247898 100644
@@ -52,7 +52,7 @@ typedef int (uev_trigger)(struct uevent *, void * trigger_data);
 
 pthread_t uevq_thr;
 LIST_HEAD(uevq);
-pthread_mutex_t uevq_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+pthread_mutex_t uevq_lock = PTHREAD_MUTEX_INITIALIZER;
 pthread_mutex_t *uevq_lockp = &uevq_lock;
 pthread_cond_t uev_cond = PTHREAD_COND_INITIALIZER;
 pthread_cond_t *uev_condp = &uev_cond;
Signature · 1 line
2.10.1
#2 lore raw

PATCH 2/15 libmultipath: Avoid that thread cancellation causes a hang

In reply to Bart Van Assche

Apparently uevq_stop() hangs every now and then in pthread_mutex_lock() if the udev listener thread is canceled. Avoid this hang by removing code from uevq_stop(). This is safe because uevq_stop() is only called just before uevent_listen() returns and in that case neither clearing my_uev_trigger nor signaling uev_condp is needed. Additionally, rename uevq_stop() into uevent_cleanup() to make clear that its purpose is to clean up resources and not to stop the uevent listener.

---
 libmultipath/uevent.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
libmultipath/uevent.c +3 -7
index 6247898..0f32dbc 100644
@@ -124,15 +124,11 @@ service_uevq(struct list_head *tmpq)
 	}
 }
 
-static void uevq_stop(void *arg)
+static void uevent_cleanup(void *arg)
 {
 	struct udev *udev = arg;
 
-	condlog(3, "Stopping uev queue");
-	pthread_mutex_lock(uevq_lockp);
-	my_uev_trigger = NULL;
-	pthread_cond_signal(uev_condp);
-	pthread_mutex_unlock(uevq_lockp);
+	condlog(3, "Releasing uevent_listen() resources");
 	udev_unref(udev);
 }
 
@@ -495,7 +491,7 @@ int uevent_listen(struct udev *udev)
 		return 1;
 	}
 	udev_ref(udev);
-	pthread_cleanup_push(uevq_stop, udev);
+	pthread_cleanup_push(uevent_cleanup, udev);
 
 	monitor = udev_monitor_new_from_netlink(udev, "udev");
 	if (!monitor) {
Signature · 1 line
2.10.1
#3 lore raw

PATCH 3/15 libmultipath: Remove an incorrect comment

In reply to Bart Van Assche

It is easy to see that uevq_lockp is not held while service_uevq() is called. Since no other code accesses the list that is processed by this function calling service_uevq() without holding uevq_lockp is safe. Hence remove the comment about locking above service_uevq().

---
 libmultipath/uevent.c | 3 ---
 1 file changed, 3 deletions(-)
libmultipath/uevent.c +0 -3
index 0f32dbc..f844294 100644
@@ -104,9 +104,6 @@ setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached)
 	}
 }
 
-/*
- * Called with uevq_lockp held
- */
 void
 service_uevq(struct list_head *tmpq)
 {
Signature · 1 line
2.10.1
#4 lore raw

PATCH 4/15 libmultipath: Move setup_thread_attr() from uevent.c into util.c

In reply to Bart Van Assche

The setup_thread_attr() is not called by any code in source file uevent.c. Hence move that function to source file util.c.

---
 libmultipath/checkers/rbd.c |  2 +-
 libmultipath/checkers/tur.c |  2 +-
 libmultipath/uevent.c       | 25 -------------------------
 libmultipath/uevent.h       |  1 -
 libmultipath/util.c         | 25 +++++++++++++++++++++++--
 libmultipath/util.h         |  1 +
 6 files changed, 26 insertions(+), 30 deletions(-)
libmultipath/checkers/rbd.c +1 -1
index c920cbb..f60914e 100644
@@ -26,7 +26,7 @@
 #include "checkers.h"
 
 #include "../libmultipath/debug.h"
-#include "../libmultipath/uevent.h"
+#include "../libmultipath/util.h"
 #include "../libmultipath/time-util.h"
 
 struct rbd_checker_context;
libmultipath/checkers/tur.c +1 -1
index 81206e4..92200aa 100644
@@ -19,7 +19,7 @@
 
 #include "../libmultipath/debug.h"
 #include "../libmultipath/sg_include.h"
-#include "../libmultipath/uevent.h"
+#include "../libmultipath/util.h"
 #include "../libmultipath/time-util.h"
 #include "../libmultipath/util.h"
 
libmultipath/uevent.c +0 -25
index f844294..7bc5837 100644
@@ -37,7 +37,6 @@
 #include <linux/types.h>
 #include <linux/netlink.h>
 #include <pthread.h>
-#include <limits.h>
 #include <sys/mman.h>
 #include <libudev.h>
 #include <errno.h>
@@ -81,30 +80,6 @@ struct uevent * alloc_uevent (void)
 }
 
 void
-setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached)
-{
-	if (pthread_attr_init(attr)) {
-		fprintf(stderr, "can't initialize thread attr: %s\n",
-			strerror(errno));
-		exit(1);
-	}
-	if (stacksize < PTHREAD_STACK_MIN)
-		stacksize = PTHREAD_STACK_MIN;
-
-	if (pthread_attr_setstacksize(attr, stacksize)) {
-		fprintf(stderr, "can't set thread stack size to %lu: %s\n",
-			(unsigned long)stacksize, strerror(errno));
-		exit(1);
-	}
-	if (detached && pthread_attr_setdetachstate(attr,
-						    PTHREAD_CREATE_DETACHED)) {
-		fprintf(stderr, "can't set thread to detached: %s\n",
-			strerror(errno));
-		exit(1);
-	}
-}
-
-void
 service_uevq(struct list_head *tmpq)
 {
 	struct uevent *uev, *tmp;
libmultipath/uevent.h +0 -1
index e5fdfcc..9d22dcd 100644
@@ -27,7 +27,6 @@ struct uevent {
 };
 
 int is_uevent_busy(void);
-void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached);
 
 int uevent_listen(struct udev *udev);
 int uevent_dispatch(int (*store_uev)(struct uevent *, void * trigger_data),
libmultipath/util.c +23 -2
index ac0d1b2..0a136b4 100644
@@ -1,7 +1,10 @@
-#include <string.h>
+#include <assert.h>
 #include <ctype.h>
-#include <sys/types.h>
+#include <limits.h>
+#include <pthread.h>
+#include <string.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <unistd.h>
 
 #include "debug.h"
@@ -258,3 +261,21 @@ dev_t parse_devt(const char *dev_t)
 
 	return makedev(maj, min);
 }
+
+void
+setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached)
+{
+	int ret;
+
+	ret = pthread_attr_init(attr);
+	assert(ret == 0);
+	if (stacksize < PTHREAD_STACK_MIN)
+		stacksize = PTHREAD_STACK_MIN;
+	ret = pthread_attr_setstacksize(attr, stacksize);
+	assert(ret == 0);
+	if (detached) {
+		ret = pthread_attr_setdetachstate(attr,
+						  PTHREAD_CREATE_DETACHED);
+		assert(ret == 0);
+	}
+}
libmultipath/util.h +1 -0
index 8861085..f3b37ee 100644
@@ -12,6 +12,7 @@ size_t strlcat(char *dst, const char *src, size_t size);
 int devt2devname (char *, int, char *);
 dev_t parse_devt(const char *dev_t);
 char *convert_dev(char *dev, int is_path_device);
+void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached);
 
 #define safe_sprintf(var, format, args...)	\
 	snprintf(var, sizeof(var), format, ##args) >= sizeof(var)
Signature · 1 line
2.10.1
#5 lore raw

PATCH 5/15 libmultipath: Fix POLLIN checks

In reply to Bart Van Assche

Instead of testing (pfd.revents == 0) & 1, test whether (pfd.revents & 1) == 0.

This has been detected by the sparse static analyzer.

---
 libmpathcmd/mpath_cmd.c | 2 +-
 libmultipath/uxsock.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
libmpathcmd/mpath_cmd.c +1 -1
index 667a2dc..d9c5790 100644
@@ -31,7 +31,7 @@ static ssize_t read_all(int fd, void *buf, size_t len, unsigned int timeout)
 			if (errno == EINTR)
 				continue;
 			return -1;
-		} else if (!pfd.revents & POLLIN)
+		} else if (!(pfd.revents & POLLIN))
 			continue;
 		n = recv(fd, buf, len, 0);
 		if (n < 0) {
libmultipath/uxsock.c +1 -1
index 880257f..b158a56 100644
@@ -116,7 +116,7 @@ ssize_t read_all(int fd, void *buf, size_t len, unsigned int timeout)
 			if (errno == EINTR)
 				continue;
 			return -errno;
-		} else if (!pfd.revents & POLLIN)
+		} else if (!(pfd.revents & POLLIN))
 			continue;
 		n = read(fd, buf, len);
 		if (n < 0) {
Signature · 1 line
2.10.1
#6 lore raw

PATCH 6/15 libmultipath: Remove an unused function

In reply to Bart Van Assche

The function snprint_config() is not used. Hence remove it.

---
 libmultipath/print.c | 6 ------
 1 file changed, 6 deletions(-)
libmultipath/print.c +0 -6
index 9aa41ad..09e4a2e 100644
@@ -1745,12 +1745,6 @@ snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs
 	return fwd;
 }
 
-extern int
-snprint_config (char * buff, int len)
-{
-	return 0;
-}
-
 /*
  * stdout printing helpers
  */
Signature · 1 line
2.10.1
#7 lore raw

Re: [PATCH 06/15] libmultipath: Remove an unused function

Removing functions packaged in a library just because they are not used in multipath does not seem fine, in general. They could still be used by third party.

Germano

Quoted 25 lines · Bart Van Assche

The function snprint_config() is not used. Hence remove it.

---
 libmultipath/print.c | 6 ------
 1 file changed, 6 deletions(-)
libmultipath/print.c +0 -6
index 9aa41ad..09e4a2e 100644
@@ -1745,12 +1745,6 @@ snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs
 	return fwd;
 }
 
-extern int
-snprint_config (char * buff, int len)
-{
-	return 0;
-}
-
 /*
  * stdout printing helpers
  */
#8 lore raw

Re: [PATCH 06/15] libmultipath: Remove an unused function

Quoted 16 lines · Germano Percossi
Quoted 15 lines · Bart Van Assche

The function snprint_config() is not used. Hence remove it.

---
 libmultipath/print.c | 6 ------
 1 file changed, 6 deletions(-)
libmultipath/print.c +0 -0
index 9aa41ad..09e4a2e 100644
@@ -1745,12 +1745,6 @@ snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs
 	return fwd;
 }
 
Quoted 13 lines

libmultipath/print.c snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs · line 1750

Quoted 9 lines
libmultipath/print.c +0 -6
-extern int
-snprint_config (char * buff, int len)
-{
-	return 0;
-}
-
 /*
  * stdout printing helpers
  */

Removing functions packaged in a library just because they are not used in multipath does not seem fine, in general. They could still be used by third party.

Hello Germano,

The snprint_config() function has never been declared in any multipath-tools header file so if someone would want to use this function without triggering a compiler warning they would have to add something like "extern int snprint_config (char * buff, int len)" to their source code. Because of this reason and also because of the empty implementation I think that is unlikely that any project is using this function.

Bart.

#9 lore raw

Re: [PATCH 06/15] libmultipath: Remove an unused function

Sorry, my reply was meant for mpath_prin_pthread_fn patch but, I guess, given the lack of a declaration in a header file, your answer will be the same.

Germano

Quoted 44 lines · Bart Van Assche
Quoted 17 lines · Germano Percossi
Quoted 16 lines · Bart Van Assche

The function snprint_config() is not used. Hence remove it.

---
 libmultipath/print.c | 6 ------
 1 file changed, 6 deletions(-)
libmultipath/print.c +0 -0
index 9aa41ad..09e4a2e 100644
@@ -1745,12 +1745,6 @@ snprint_devices (struct config *conf, char *

buff, int len, struct vectors *vecs

     return fwd;

}

Quoted 13 lines

libmultipath/print.c snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs · line 1750

Quoted 9 lines
libmultipath/print.c +0 -6
-extern int
-snprint_config (char * buff, int len)
-{
-    return 0;
-}
-
 /*
  * stdout printing helpers
  */

Removing functions packaged in a library just because they are not used in multipath does not seem fine, in general. They could still be used by third party.

Hello Germano,

The snprint_config() function has never been declared in any multipath-tools header file so if someone would want to use this function without triggering a compiler warning they would have to add something like "extern int snprint_config (char * buff, int len)" to their source code. Because of this reason and also because of the empty implementation I think that is unlikely that any project is using this function.

Bart.

#10 lore raw

Re: [PATCH 06/15] libmultipath: Remove an unused function

Quoted 3 lines · Germano Percossi

Sorry, my reply was meant for mpath_prin_pthread_fn patch but, I guess, given the lack of a declaration in a header file, your answer will be the same.

Hello Germano,

Inspection of the git log -p output learned me that also mpath_prin_pthread_fn() was never declared in any multipath-tools header file.

Bart.

#11 lore raw

PATCH 7/15 libmpathpersist: Remove an unused function

In reply to Bart Van Assche
---
 libmpathpersist/mpath_persist.c | 11 -----------
 1 file changed, 11 deletions(-)
libmpathpersist/mpath_persist.c +0 -11
index 7501651..edd4246 100644
@@ -414,17 +414,6 @@ get_mpvec (vector curmp, vector pathvec, char * refwwid)
 	return MPATH_PR_SUCCESS ;
 }
 
-void * mpath_prin_pthread_fn (void *p)
-{
-	int ret;
-	struct prin_param * pparam = (struct prin_param *)p;
-
-	ret = prin_do_scsi_ioctl(pparam->dev, pparam->rq_servact,
-				 pparam->resp,  pparam->noisy);
-	pparam->status = ret;
-	pthread_exit(NULL);
-}
-
 int mpath_send_prin_activepath (char * dev, int rq_servact,
 				struct prin_resp * resp, int noisy)
 {
Signature · 1 line
2.10.1
#12 lore raw

PATCH 8/15 libmultipath: Remove an unused variable

In reply to Bart Van Assche
---
 libmultipath/uevent.c | 1 -
 1 file changed, 1 deletion(-)
libmultipath/uevent.c +0 -1
index 7bc5837..19b910f 100644
@@ -49,7 +49,6 @@
 
 typedef int (uev_trigger)(struct uevent *, void * trigger_data);
 
-pthread_t uevq_thr;
 LIST_HEAD(uevq);
 pthread_mutex_t uevq_lock = PTHREAD_MUTEX_INITIALIZER;
 pthread_mutex_t *uevq_lockp = &uevq_lock;
Signature · 1 line
2.10.1
#13 lore raw

PATCH 9/15 libmultipath/checkers/rbd: Use unsigned int for one-bit bitfields

In reply to Bart Van Assche

Avoid that this bitfield is sign-extended. Detected by sparse.

---
 libmultipath/checkers/rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/checkers/rbd.c +1 -1
index f60914e..745e240 100644
@@ -46,7 +46,7 @@ struct rbd_checker_context {
 	char *username;
 	int remapped;
 	int blacklisted;
-	int lock_on_read:1;
+	unsigned lock_on_read:1;
 
 	rados_t cluster;
 
Signature · 1 line
2.10.1
#14 lore raw

PATCH 10/15 libmultipath: Move the definition of a global variable from .h to .c

In reply to Bart Van Assche

This change does not change the semantics of the code but makes it easier for sparse to analyze the source code.

---
 libmultipath/log.c | 2 ++
 libmultipath/log.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
libmultipath/log.c +2 -0
index ab92e2a..debd36d 100644
@@ -15,6 +15,8 @@
 
 #define ALIGN(len, s) (((len)+(s)-1)/(s)*(s))
 
+struct logarea* la;
+
 #if LOGDBG
 static void dump_logarea (void)
 {
libmultipath/log.h +1 -1
index 984f047..6551b5c 100644
@@ -29,7 +29,7 @@ struct logarea {
 	char * buff;
 };
 
-struct logarea * la;
+extern struct logarea* la;
 
 int log_init (char * progname, int size);
 void log_close (void);
Signature · 1 line
2.10.1
#15 lore raw

PATCH 11/15 libmpathpersist: Move the definition of a global variable from .h to .c

In reply to Bart Van Assche
---
 libmpathpersist/mpath_persist.c | 1 +
 libmpathpersist/mpathpr.h       | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
libmpathpersist/mpath_persist.c +1 -0
index edd4246..6cc6dbc 100644
@@ -35,6 +35,7 @@
 #define __STDC_FORMAT_MACROS 1
 
 struct udev *udev;
+struct config *conf;
 
 struct config *
 mpath_lib_init (struct udev *udev)
libmpathpersist/mpathpr.h +1 -1
index cd58201..056c547 100644
@@ -26,7 +26,7 @@ struct threadinfo {
 };
 
 
-struct config * conf;
+extern struct config *conf;
 
 
 int prin_do_scsi_ioctl(char * dev, int rq_servact, struct prin_resp * resp, int noisy);
Signature · 1 line
2.10.1
#16 lore raw

PATCH 12/15 Use NULL instead of 0 where a pointer is expected

In reply to Bart Van Assche

This was detected by sparse.

---
 kpartx/lopart.c             |  2 +-
 libmultipath/checkers/rbd.c |  2 +-
 mpathpersist/main.h         | 48 ++++++++++++++++++++++-----------------------
 3 files changed, 26 insertions(+), 26 deletions(-)
kpartx/lopart.c +1 -1
index 0ab1688..4502fad 100644
@@ -228,7 +228,7 @@ find_unused_loop_device (void)
 				"       maybe /dev/loop# has the wrong major number?");
 	} else
 		fprintf(stderr, "mount: could not find any free loop device");
-	return 0;
+	return NULL;
 }
 
 extern int
libmultipath/checkers/rbd.c +1 -1
index 745e240..481d860 100644
@@ -464,7 +464,7 @@ static int rbd_rm_blacklist(struct rbd_checker_context *ct)
 	cmd[1] = NULL;
 
 	ret = rados_mon_command(ct->cluster, (const char **)cmd, 1, "", 0,
-				NULL, 0, &stat, &stat_len);
+				NULL, NULL, &stat, &stat_len);
 	if (ret < 0) {
 		condlog(1, "rbd%d: repair failed to remove blacklist for %s %d",
 			ct->rbd_bus_id, ct->client_addr, ret);
mpathpersist/main.h +24 -24

52 lines not on this page · raw message

Signature · 1 line
2.10.1
#17 lore raw

PATCH 13/15 libmultipath/prioritizers: Make getprio() prototypes consistent

In reply to Bart Van Assche

Additionally, ensure that the compiler checks the getprio() prototype.

---
 libmultipath/prio.h                      | 3 +++
 libmultipath/prioritizers/const.c        | 2 +-
 libmultipath/prioritizers/datacore.c     | 2 +-
 libmultipath/prioritizers/iet.c          | 2 +-
 libmultipath/prioritizers/random.c       | 2 +-
 libmultipath/prioritizers/weightedpath.c | 2 +-
 6 files changed, 8 insertions(+), 5 deletions(-)
libmultipath/prio.h +3 -0
index 261105b..0193c52 100644
@@ -64,4 +64,7 @@ char * prio_name (struct prio *);
 char * prio_args (struct prio *);
 int prio_set_args (struct prio *, char *);
 
+/* The only function exported by prioritizer dynamic libraries (.so) */
+int getprio(struct path *, char *, unsigned int);
+
 #endif /* _PRIO_H */
libmultipath/prioritizers/const.c +1 -1
index 9d9d003..aad6927 100644
@@ -2,7 +2,7 @@
 
 #include "prio.h"
 
-int getprio (struct path * pp, char * args)
+int getprio(struct path * pp, char * args, unsigned int timeout)
 {
 	return 1;
 }
libmultipath/prioritizers/datacore.c +1 -1
index 050a94c..36465ac 100644
@@ -106,7 +106,7 @@ int datacore_prio (const char *dev, int sg_fd, char * args)
 	return 0;
 }
 
-int getprio (struct path * pp, char * args)
+int getprio(struct path * pp, char * args, unsigned int timeout)
 {
 	return datacore_prio(pp->dev, pp->fd, args);
 }
libmultipath/prioritizers/iet.c +1 -1
index aa852a0..a4ea61e 100644
@@ -138,7 +138,7 @@ int iet_prio(const char *dev, char * args)
 	return 10;
 }
 
-int getprio(struct path * pp, char * args)
+int getprio(struct path * pp, char * args, unsigned int timeout)
 {
 	return iet_prio(pp->dev, args);
 }
libmultipath/prioritizers/random.c +1 -1
index c3ea3ac..4a27123 100644
@@ -5,7 +5,7 @@
 
 #include "prio.h"
 
-int getprio (struct path * pp, char * args)
+int getprio(struct path * pp, char * args, unsigned int timeout)
 {
 	struct timeval tv;
 
libmultipath/prioritizers/weightedpath.c +1 -1
index a62b86e..34a43a8 100644
@@ -151,7 +151,7 @@ int prio_path_weight(struct path *pp, char *prio_args)
 	return priority;
 }
 
-int getprio(struct path *pp, char *args)
+int getprio(struct path *pp, char *args, unsigned int timeout)
 {
 	return prio_path_weight(pp, args);
 }
Signature · 1 line
2.10.1
#18 lore raw

PATCH 14/15 libmultipath/checkers: Make the compiler check the checker function prototypes

In reply to Bart Van Assche
---
 libmultipath/checkers.h | 6 ++++++
 1 file changed, 6 insertions(+)
libmultipath/checkers.h +6 -0
index 4fb97c9..fedc330 100644
@@ -142,4 +142,10 @@ char * checker_message (struct checker *);
 void checker_clear_message (struct checker *c);
 void checker_get (char *, struct checker *, char *);
 
+/* Functions exported by path checker dynamic libraries (.so) */
+int libcheck_check(struct checker *);
+int libcheck_init(struct checker *);
+void libcheck_free(struct checker *);
+void libcheck_repair(struct checker *);
+
 #endif /* _CHECKERS_H */
Signature · 1 line
2.10.1
#19 lore raw

PATCH 15/15 kpartx: Move the declaration of a global variable from .c to .h

In reply to Bart Van Assche
---
 kpartx/gpt.c    | 1 -
 kpartx/kpartx.h | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
kpartx/gpt.c +0 -1
index 3511886..6ef20f9 100644
@@ -504,7 +504,6 @@ compare_gpts(gpt_header *pgpt, gpt_header *agpt, uint64_t lastlba)
 static int
 find_valid_gpt(int fd, gpt_header ** gpt, gpt_entry ** ptes)
 {
-	extern int force_gpt;
 	int good_pgpt = 0, good_agpt = 0, good_pmbr = 0;
 	gpt_header *pgpt = NULL, *agpt = NULL;
 	gpt_entry *pptes = NULL, *aptes = NULL;
kpartx/kpartx.h +2 -0
index a55c211..52920e4 100644
@@ -39,6 +39,8 @@ struct slice {
 
 typedef int (ptreader)(int fd, struct slice all, struct slice *sp, int ns);
 
+extern int force_gpt;
+
 extern ptreader read_dos_pt;
 extern ptreader read_bsd_pt;
 extern ptreader read_solaris_pt;
Signature · 1 line
2.10.1