All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] multipath.rules: handle NVME devices
@ 2018-01-19  0:19 Martin Wilck
  2018-01-19  0:19 ` [PATCH 2/3] libmultipath: ignore natively multipathed " Martin Wilck
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Martin Wilck @ 2018-01-19  0:19 UTC (permalink / raw)
  To: Christophe Varoqui, dm-devel; +Cc: Xose Vazquez Perez, Martin Wilck

Note: ID_WWN is set in 60-persistent-storage.rules in current systemd.
That won't work well together with us installing multipath.rules as
56-multipath.rules -  multipath -u won't see ID_WWN.

However, we have strong reasons to run before blkid is invoked.
ID_WWN determination for NVMe should be moved to an earlier udev rule.
See systemd pull request #7594 on github.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipath/multipath.rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multipath/multipath.rules b/multipath/multipath.rules
index bc1a8529638f..6f8ee2be0a58 100644
--- a/multipath/multipath.rules
+++ b/multipath/multipath.rules
@@ -1,7 +1,7 @@
 # Set DM_MULTIPATH_DEVICE_PATH if the device should be handled by multipath
 SUBSYSTEM!="block", GOTO="end_mpath"
 ACTION!="add|change", GOTO="end_mpath"
-KERNEL!="sd*|dasd*", GOTO="end_mpath"
+KERNEL!="sd*|dasd*|nvme*", GOTO="end_mpath"
 
 IMPORT{cmdline}="nompath"
 ENV{nompath}=="?*", GOTO="end_mpath"
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] libmultipath: ignore natively multipathed NVME devices
  2018-01-19  0:19 [PATCH 1/3] multipath.rules: handle NVME devices Martin Wilck
@ 2018-01-19  0:19 ` Martin Wilck
  2018-01-19  0:19 ` [PATCH 3/3] multipath-tools: add dependency tracking to Makefiles Martin Wilck
  2018-02-07 18:37 ` [PATCH 1/3] multipath.rules: handle NVME devices Benjamin Marzinski
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Wilck @ 2018-01-19  0:19 UTC (permalink / raw)
  To: Christophe Varoqui, dm-devel; +Cc: Xose Vazquez Perez, Martin Wilck

Such devices have a parent with SUBSYSTEM="nvme-subsystem", not "nvme".
Furthermore, avoid a possible segfaults NULL checks.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/discovery.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 9b22bd94e491..88fc8d732258 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1200,6 +1200,7 @@ nvme_sysfs_pathinfo (struct path * pp, vector hwtable)
 {
 	struct udev_device *parent;
 	const char *attr_path = NULL;
+	const char *attr;
 
 	attr_path = udev_device_get_sysname(pp->udev);
 	if (!attr_path)
@@ -1209,14 +1210,17 @@ nvme_sysfs_pathinfo (struct path * pp, vector hwtable)
 		   &pp->sg_id.host_no,
 		   &pp->sg_id.scsi_id) != 2)
 		return 1;
-	pp->sg_id.channel = 0;
-	pp->sg_id.lun = atoi(udev_device_get_sysattr_value(pp->udev, "nsid"));
 
-	parent = udev_device_get_parent(pp->udev);
+	parent = udev_device_get_parent_with_subsystem_devtype(pp->udev,
+							       "nvme", NULL);
 	if (!parent)
 		return 1;
 
-	pp->sg_id.channel = atoi(udev_device_get_sysattr_value(parent, "cntlid"));
+	attr = udev_device_get_sysattr_value(pp->udev, "nsid");
+	pp->sg_id.lun = attr ? atoi(attr) : 0;
+
+	attr = udev_device_get_sysattr_value(parent, "cntlid");
+	pp->sg_id.channel = attr ? atoi(attr) : 0;
 
 	snprintf(pp->vendor_id, SCSI_VENDOR_SIZE, "NVME");
 	snprintf(pp->product_id, SCSI_PRODUCT_SIZE, "%s",
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] multipath-tools: add dependency tracking to Makefiles
  2018-01-19  0:19 [PATCH 1/3] multipath.rules: handle NVME devices Martin Wilck
  2018-01-19  0:19 ` [PATCH 2/3] libmultipath: ignore natively multipathed " Martin Wilck
@ 2018-01-19  0:19 ` Martin Wilck
  2018-02-07 18:37 ` [PATCH 1/3] multipath.rules: handle NVME devices Benjamin Marzinski
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Wilck @ 2018-01-19  0:19 UTC (permalink / raw)
  To: Christophe Varoqui, dm-devel; +Cc: Xose Vazquez Perez, Martin Wilck

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 .gitignore                         |  1 +
 Makefile.inc                       |  2 +-
 kpartx/Makefile                    |  7 ++++++-
 libdmmp/Makefile                   |  7 ++++++-
 libdmmp/test/Makefile              |  9 ++++++++-
 libmpathcmd/Makefile               | 10 ++++++++--
 libmpathpersist/Makefile           |  8 +++++++-
 libmultipath/Makefile              |  7 ++++++-
 libmultipath/checkers/Makefile     |  8 +++++++-
 libmultipath/prioritizers/Makefile |  8 +++++++-
 mpathpersist/Makefile              |  7 ++++++-
 multipath/Makefile                 |  7 ++++++-
 multipathd/Makefile                |  7 ++++++-
 tests/Makefile                     |  9 ++++++++-
 14 files changed, 83 insertions(+), 14 deletions(-)

diff --git a/.gitignore b/.gitignore
index 371b8758c0a1..35c59a7e2d51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
 *.so.0
 *.a
 *.gz
+*.d
 kpartx/kpartx
 multipath/multipath
 multipathd/multipathd
diff --git a/Makefile.inc b/Makefile.inc
index d82d3b5df3fe..eb99c36010c1 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -91,7 +91,7 @@ OPTFLAGS	= -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \
 		  --param=ssp-buffer-size=4
 
 CFLAGS		:= $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \
-		   $(CFLAGS)
+		   -MMD -MP $(CFLAGS)
 BIN_CFLAGS	= -fPIE -DPIE
 LIB_CFLAGS	= -fPIC
 SHARED_FLAGS	= -shared
diff --git a/kpartx/Makefile b/kpartx/Makefile
index bf7362d95efd..7eb467ee3efb 100644
--- a/kpartx/Makefile
+++ b/kpartx/Makefile
@@ -44,5 +44,10 @@ uninstall:
 	$(RM) $(DESTDIR)$(libudevdir)/rules.d/67-kpartx-compat.rules
 	$(RM) $(DESTDIR)$(libudevdir)/rules.d/68-del-part-nodes.rules
 
-clean:
+clean: dep_clean
 	$(RM) core *.o $(EXEC) *.gz
+
+include $(wildcard $(OBJS:.o=.d))
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/libdmmp/Makefile b/libdmmp/Makefile
index bf231ace1a1b..1dd3f34069b9 100644
--- a/libdmmp/Makefile
+++ b/libdmmp/Makefile
@@ -56,11 +56,13 @@ uninstall:
 	$(RM) $(DESTDIR)$(man3dir)/libdmmp.h*
 	$(RM) $(DESTDIR)$(pkgconfdir)/$(PKGFILE)
 
-clean:
+clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so *.so.*
 	$(RM) -r docs/man
 	$(MAKE) -C test clean
 
+include $(wildcard $(OBJS:.o=.d))
+
 check: all
 	$(MAKE) -C test check
 
@@ -84,3 +86,6 @@ docs/man/$(EXTRA_MAN_FILES).gz: $(HEADERS)
 		gzip -f $$file; \
 	done
 	find docs/man -type f -name \*[0-9].gz
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/libdmmp/test/Makefile b/libdmmp/test/Makefile
index acfb3bffb7f5..20b394587c4a 100644
--- a/libdmmp/test/Makefile
+++ b/libdmmp/test/Makefile
@@ -26,5 +26,12 @@ speed_test: $(SPD_TEST_EXEC)
 	sudo env LD_LIBRARY_PATH=$(_libdmmpdir):$(_mpathcmddir) \
 		time -p ./$(SPD_TEST_EXEC)
 
-clean:
+clean: dep_clean
 	rm -f $(TEST_EXEC) $(SPD_TEST_EXEC)
+
+OBJS = $(TEST_EXEC).o $(SPD_TEST_EXEC).o
+include $(wildcard $(OBJS:.o=.d))
+
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/libmpathcmd/Makefile b/libmpathcmd/Makefile
index 4f321017361d..53c08992420b 100644
--- a/libmpathcmd/Makefile
+++ b/libmpathcmd/Makefile
@@ -26,5 +26,11 @@ uninstall:
 	$(RM) $(DESTDIR)$(syslibdir)/$(DEVLIB)
 	$(RM) $(DESTDIR)$(includedir)/mpath_cmd.h
 
-clean:
-	$(RM) core *.a *.o *.so *.so.* *.gz
+clean: dep_clean
+	$(RM) core *.a *.o *.so *.so.* *.gz 
+
+include $(wildcard $(OBJS:.o=.d))
+
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/libmpathpersist/Makefile b/libmpathpersist/Makefile
index 1b4ec16a18f7..21fdad805f10 100644
--- a/libmpathpersist/Makefile
+++ b/libmpathpersist/Makefile
@@ -37,5 +37,11 @@ uninstall:
 	$(RM) $(DESTDIR)$(includedir)/mpath_persist.h
 	$(RM) $(DESTDIR)$(syslibdir)/$(DEVLIB)
 
-clean:
+clean: dep_clean
 	$(RM) core *.a *.o *.so *.so.* *.gz
+
+include $(wildcard $(OBJS:.o=.d))
+
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/libmultipath/Makefile b/libmultipath/Makefile
index 6447d8dafb4f..25b052729d48 100644
--- a/libmultipath/Makefile
+++ b/libmultipath/Makefile
@@ -61,5 +61,10 @@ uninstall:
 	$(RM) $(DESTDIR)$(syslibdir)/$(LIBS)
 	$(RM) $(DESTDIR)$(syslibdir)/$(DEVLIB)
 
-clean:
+clean: dep_clean
 	$(RM) core *.a *.o *.so *.so.* *.gz
+
+include $(wildcard $(OBJS:.o=.d))
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile
index bce6b8b7be75..9559038a770d 100644
--- a/libmultipath/checkers/Makefile
+++ b/libmultipath/checkers/Makefile
@@ -36,5 +36,11 @@ install:
 uninstall:
 	for file in $(LIBS); do $(RM) $(DESTDIR)$(libdir)/$$file; done
 
-clean:
+clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
+
+OBJS := $(LIBS:libcheck%.so=%.o) libsg.o directio.o
+include $(wildcard $(OBJS:.o=.d))
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/libmultipath/prioritizers/Makefile b/libmultipath/prioritizers/Makefile
index 0c71e6334473..b3cc944c810d 100644
--- a/libmultipath/prioritizers/Makefile
+++ b/libmultipath/prioritizers/Makefile
@@ -38,5 +38,11 @@ install: $(LIBS)
 uninstall:
 	for file in $(LIBS); do $(RM) $(DESTDIR)$(libdir)/$$file; done
 
-clean:
+clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
+
+OBJS = $(LIBS:libprio%.so=%.o) alua_rtpg.o
+include $(wildcard $(OBJS:.o=.d))
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/mpathpersist/Makefile b/mpathpersist/Makefile
index 6e5acd3b751e..51268010b31d 100644
--- a/mpathpersist/Makefile
+++ b/mpathpersist/Makefile
@@ -22,9 +22,14 @@ install:
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir)
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir)
 
-clean:
+clean: dep_clean
 	$(RM) core *.o $(EXEC) *.gz
 
+include $(wildcard $(OBJS:.o=.d))
+
 uninstall:
 	$(RM) $(DESTDIR)$(bindir)/$(EXEC)
 	$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/multipath/Makefile b/multipath/Makefile
index 468c056d49d0..654568af3576 100644
--- a/multipath/Makefile
+++ b/multipath/Makefile
@@ -37,5 +37,10 @@ uninstall:
 	$(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz
 	$(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz
 
-clean:
+clean: dep_clean
 	$(RM) core *.o $(EXEC) *.gz
+
+include $(wildcard $(OBJS:.o=.d))
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/multipathd/Makefile b/multipathd/Makefile
index e6f140bf3b91..251690ec5e2a 100644
--- a/multipathd/Makefile
+++ b/multipathd/Makefile
@@ -49,5 +49,10 @@ uninstall:
 	$(RM) $(DESTDIR)$(unitdir)/$(EXEC).service
 	$(RM) $(DESTDIR)$(unitdir)/$(EXEC).socket
 
-clean:
+clean: dep_clean
 	$(RM) core *.o $(EXEC) *.gz
+
+include $(wildcard $(OBJS:.o=.d))
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
diff --git a/tests/Makefile b/tests/Makefile
index ff58cb8bb207..f6b55836a434 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -17,7 +17,14 @@ TESTS := uevent
 
 all:	$(TESTS:%=%.out)
 
-clean:
+clean: dep_clean
 	rm -f $(TESTS:%=%-test) $(TESTS:%=%.out) $(TESTS:%=%.o)
 
+OBJS = $(TESTS:%=%.o)
+include $(wildcard $(OBJS:.o=.d))
 
+
+
+
+dep_clean:
+	$(RM) $(OBJS:.o=.d)
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] multipath.rules: handle NVME devices
  2018-01-19  0:19 [PATCH 1/3] multipath.rules: handle NVME devices Martin Wilck
  2018-01-19  0:19 ` [PATCH 2/3] libmultipath: ignore natively multipathed " Martin Wilck
  2018-01-19  0:19 ` [PATCH 3/3] multipath-tools: add dependency tracking to Makefiles Martin Wilck
@ 2018-02-07 18:37 ` Benjamin Marzinski
  2 siblings, 0 replies; 4+ messages in thread
From: Benjamin Marzinski @ 2018-02-07 18:37 UTC (permalink / raw)
  To: Martin Wilck; +Cc: dm-devel, Xose Vazquez Perez

On Fri, Jan 19, 2018 at 01:19:42AM +0100, Martin Wilck wrote:
> Note: ID_WWN is set in 60-persistent-storage.rules in current systemd.
> That won't work well together with us installing multipath.rules as
> 56-multipath.rules -  multipath -u won't see ID_WWN.
> 
> However, we have strong reasons to run before blkid is invoked.
> ID_WWN determination for NVMe should be moved to an earlier udev rule.
> See systemd pull request #7594 on github.
> 

ACK for all three.
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  multipath/multipath.rules | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/multipath/multipath.rules b/multipath/multipath.rules
> index bc1a8529638f..6f8ee2be0a58 100644
> --- a/multipath/multipath.rules
> +++ b/multipath/multipath.rules
> @@ -1,7 +1,7 @@
>  # Set DM_MULTIPATH_DEVICE_PATH if the device should be handled by multipath
>  SUBSYSTEM!="block", GOTO="end_mpath"
>  ACTION!="add|change", GOTO="end_mpath"
> -KERNEL!="sd*|dasd*", GOTO="end_mpath"
> +KERNEL!="sd*|dasd*|nvme*", GOTO="end_mpath"
>  
>  IMPORT{cmdline}="nompath"
>  ENV{nompath}=="?*", GOTO="end_mpath"
> -- 
> 2.15.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-07 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19  0:19 [PATCH 1/3] multipath.rules: handle NVME devices Martin Wilck
2018-01-19  0:19 ` [PATCH 2/3] libmultipath: ignore natively multipathed " Martin Wilck
2018-01-19  0:19 ` [PATCH 3/3] multipath-tools: add dependency tracking to Makefiles Martin Wilck
2018-02-07 18:37 ` [PATCH 1/3] multipath.rules: handle NVME devices Benjamin Marzinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.