From 0e8dd16e3f8047929c504ef5ae650c42e003a3ec Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2016 14:24:20 +0000 Subject: import systemd-219-19.el7_2.7 --- diff --git a/SOURCES/0268-udev-fibre-channel-fix-NPIV-support.patch b/SOURCES/0268-udev-fibre-channel-fix-NPIV-support.patch new file mode 100644 index 0000000..5958e60 --- /dev/null +++ b/SOURCES/0268-udev-fibre-channel-fix-NPIV-support.patch @@ -0,0 +1,69 @@ +From 41bcd014886cfd2bc4415f2c78668008963934a9 Mon Sep 17 00:00:00 2001 +From: Maurizio Lombardi +Date: Mon, 1 Feb 2016 14:44:22 +0100 +Subject: [PATCH] udev: fibre channel: fix NPIV support + +When using NPIV, you can create multiple virtual HBAs on top of the +physical one, this means that the physical N_Port can have multiple +port IDs associated to it. +Suppose a LUN is assigned to the physical HBA and to a virtual HBA, +in both cases the original code uses the ID of the physical HBA +to build the by-path link and udev will end up trying to create two by-path +links with the same name. + +This patch fixes the problem by using the port ID of the virtual HBA +whenever it detects that the device belongs to a virtual HBA, +otherwise it uses the port ID of the physical HBA. + +(cherry-picked from 155a760bcedd11b7f3b430350a46f10736286895) + +Resolves: #1266934 +--- + src/udev/udev-builtin-path_id.c | 27 ++++++++++++++++++++++++--- + 1 file changed, 24 insertions(+), 3 deletions(-) + +diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c +index 9ca6084..695ac7f 100644 +--- a/src/udev/udev-builtin-path_id.c ++++ b/src/udev/udev-builtin-path_id.c +@@ -92,6 +92,9 @@ static struct udev_device *skip_subsystem(struct udev_device *dev, const char *s + static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, char **path) { + struct udev *udev = udev_device_get_udev(parent); + struct udev_device *targetdev; ++ struct udev_device *rportdev; ++ struct udev_device *hostdev; ++ struct udev_device *vportdev; + struct udev_device *fcdev = NULL; + const char *port; + char *lun = NULL; +@@ -100,9 +103,27 @@ static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, + if (targetdev == NULL) + return NULL; + +- fcdev = udev_device_new_from_subsystem_sysname(udev, "fc_transport", udev_device_get_sysname(targetdev)); +- if (fcdev == NULL) +- return NULL; ++ rportdev = udev_device_get_parent(targetdev); ++ if (rportdev == NULL) ++ goto skip_npiv_check; ++ ++ hostdev = udev_device_get_parent(rportdev); ++ if (hostdev == NULL) ++ goto skip_npiv_check; ++ ++ vportdev = udev_device_get_parent(hostdev); ++ if (vportdev == NULL) ++ goto skip_npiv_check; ++ ++ fcdev = udev_device_new_from_subsystem_sysname(udev, "fc_vports", udev_device_get_sysname(vportdev)); ++ ++skip_npiv_check: ++ if (fcdev == NULL) { ++ fcdev = udev_device_new_from_subsystem_sysname(udev, "fc_transport", udev_device_get_sysname(targetdev)); ++ if (fcdev == NULL) ++ return NULL; ++ } ++ + port = udev_device_get_sysattr_value(fcdev, "port_name"); + if (port == NULL) { + parent = NULL; diff --git a/SOURCES/0269-ata_id-unreverse-WWN-identifier.patch b/SOURCES/0269-ata_id-unreverse-WWN-identifier.patch new file mode 100644 index 0000000..3f875a3 --- /dev/null +++ b/SOURCES/0269-ata_id-unreverse-WWN-identifier.patch @@ -0,0 +1,43 @@ +From af5732176cb192206f555a1c00dd5431a757367f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Wed, 22 Jul 2015 00:23:47 -0400 +Subject: [PATCH] ata_id: unreverse WWN identifier + +An endianness conversion was lost in 6024a6e302bad6bcf073fa84a41a6123305dc845. +Restore it. Now ata_id and scsi_id output match. + +https://bugzilla.redhat.com/show_bug.cgi?id=1227503 + +Cherry-picked from: 01f61d331bb5038f0c877ac03c54333328b6ea28 +Resolves: #1308795 +--- + src/udev/ata_id/ata_id.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c +index b6f28c6..4adec44 100644 +--- a/src/udev/ata_id/ata_id.c ++++ b/src/udev/ata_id/ata_id.c +@@ -638,10 +638,20 @@ int main(int argc, char *argv[]) + * All other values are reserved. + */ + word = identify.wyde[108]; +- if ((word & 0xf000) == 0x5000) ++ if ((word & 0xf000) == 0x5000) { ++ uint64_t wwwn; ++ ++ wwwn = identify.wyde[108]; ++ wwwn <<= 16; ++ wwwn |= identify.wyde[109]; ++ wwwn <<= 16; ++ wwwn |= identify.wyde[110]; ++ wwwn <<= 16; ++ wwwn |= identify.wyde[111]; + printf("ID_WWN=0x%1$" PRIx64 "\n" + "ID_WWN_WITH_EXTENSION=0x%1$" PRIx64 "\n", +- identify.octa[108/4]); ++ wwwn); ++ } + + /* from Linux's include/linux/ata.h */ + if (identify.wyde[0] == 0x848a || diff --git a/SOURCES/0270-Fixup-WWN-bytes-for-big-endian-systems.patch b/SOURCES/0270-Fixup-WWN-bytes-for-big-endian-systems.patch new file mode 100644 index 0000000..932fd0e --- /dev/null +++ b/SOURCES/0270-Fixup-WWN-bytes-for-big-endian-systems.patch @@ -0,0 +1,26 @@ +From e2236a77928842bbf092956f8fa1918f2b4f7b9b Mon Sep 17 00:00:00 2001 +From: Tom Lyon +Date: Mon, 21 Sep 2015 14:36:32 -0700 +Subject: [PATCH] Fixup WWN bytes for big-endian systems + +Cherry-picked from: cf22cddcfd07d10fecd7b03ef465e957054daec2 +Resolves: #1308795 +--- + src/udev/ata_id/ata_id.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c +index 4adec44..ef05fba 100644 +--- a/src/udev/ata_id/ata_id.c ++++ b/src/udev/ata_id/ata_id.c +@@ -485,6 +485,10 @@ int main(int argc, char *argv[]) + disk_identify_fixup_uint16(identify.byte, 90); /* time required for enhanced SECURITY ERASE UNIT */ + disk_identify_fixup_uint16(identify.byte, 91); /* current APM values */ + disk_identify_fixup_uint16(identify.byte, 94); /* current AAM value */ ++ disk_identify_fixup_uint16(identify.byte, 108); /* wwn */ ++ disk_identify_fixup_uint16(identify.byte, 109); /* wwn */ ++ disk_identify_fixup_uint16(identify.byte, 110); /* wwn */ ++ disk_identify_fixup_uint16(identify.byte, 111); /* wwn */ + disk_identify_fixup_uint16(identify.byte, 128); /* device lock function */ + disk_identify_fixup_uint16(identify.byte, 217); /* nominal media rotation rate */ + memcpy(&id, identify.byte, sizeof id); diff --git a/SOURCES/0271-Revert-udev-fibre-channel-fix-NPIV-support.patch b/SOURCES/0271-Revert-udev-fibre-channel-fix-NPIV-support.patch new file mode 100644 index 0000000..e9ab780 --- /dev/null +++ b/SOURCES/0271-Revert-udev-fibre-channel-fix-NPIV-support.patch @@ -0,0 +1,57 @@ +From 3b9db589b168cef9c07ad63c8cc06950844bfd5b Mon Sep 17 00:00:00 2001 +From: Michal Sekletar +Date: Mon, 29 Feb 2016 16:33:38 +0100 +Subject: [PATCH] Revert "udev: fibre channel: fix NPIV support" + +This reverts commit 569d98e9caae425120bf28f6b440e6cc117abc0d. + +Related: #1266934 +--- + src/udev/udev-builtin-path_id.c | 27 +++------------------------ + 1 file changed, 3 insertions(+), 24 deletions(-) + +diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c +index 695ac7f..9ca6084 100644 +--- a/src/udev/udev-builtin-path_id.c ++++ b/src/udev/udev-builtin-path_id.c +@@ -92,9 +92,6 @@ static struct udev_device *skip_subsystem(struct udev_device *dev, const char *s + static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, char **path) { + struct udev *udev = udev_device_get_udev(parent); + struct udev_device *targetdev; +- struct udev_device *rportdev; +- struct udev_device *hostdev; +- struct udev_device *vportdev; + struct udev_device *fcdev = NULL; + const char *port; + char *lun = NULL; +@@ -103,27 +100,9 @@ static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, + if (targetdev == NULL) + return NULL; + +- rportdev = udev_device_get_parent(targetdev); +- if (rportdev == NULL) +- goto skip_npiv_check; +- +- hostdev = udev_device_get_parent(rportdev); +- if (hostdev == NULL) +- goto skip_npiv_check; +- +- vportdev = udev_device_get_parent(hostdev); +- if (vportdev == NULL) +- goto skip_npiv_check; +- +- fcdev = udev_device_new_from_subsystem_sysname(udev, "fc_vports", udev_device_get_sysname(vportdev)); +- +-skip_npiv_check: +- if (fcdev == NULL) { +- fcdev = udev_device_new_from_subsystem_sysname(udev, "fc_transport", udev_device_get_sysname(targetdev)); +- if (fcdev == NULL) +- return NULL; +- } +- ++ fcdev = udev_device_new_from_subsystem_sysname(udev, "fc_transport", udev_device_get_sysname(targetdev)); ++ if (fcdev == NULL) ++ return NULL; + port = udev_device_get_sysattr_value(fcdev, "port_name"); + if (port == NULL) { + parent = NULL; diff --git a/SOURCES/0272-udev-path-id-fibre-channel-NPIV-use-fc_vport-s-port_.patch b/SOURCES/0272-udev-path-id-fibre-channel-NPIV-use-fc_vport-s-port_.patch new file mode 100644 index 0000000..82e8f78 --- /dev/null +++ b/SOURCES/0272-udev-path-id-fibre-channel-NPIV-use-fc_vport-s-port_.patch @@ -0,0 +1,125 @@ +From 77314a3851676724fa018d76a4136fba059082d4 Mon Sep 17 00:00:00 2001 +From: Mauricio Faria de Oliveira +Date: Tue, 23 Feb 2016 15:02:02 -0300 +Subject: [PATCH] udev: path-id: fibre channel NPIV - use fc_vport's port_name + +With the Fibre Channel NPIV (N_Port ID Virtualization) feature, +a single physical N_Port (e.g., PCI address) can have multiple +N_Port IDs (e.g., different fc_host nodes) - which can connect +to the same target LUN (e.g., fc_remote_port's port_name and +LUN number). + +Thus, in order to be unique, the device persistent path should +include the fc_vport's port_name (only if the fc_vport is used), +in addition to the already in use PCI address, fc_remote_port's +port_name and LUN number. + +The patch merges the 2 proposals submitted upstream, addressing +some problems with both: +- #2500 (don't replace the fc_rport's port_name with fc_vport's) +- #2665 (don't add a fc_host/fc_vport's port_name if not needed) + +Links +- https://github.com/systemd/systemd/pull/2500/ +- https://github.com/systemd/systemd/pull/2665/ + +Built, checked, tested on RHEL Server 7.1 with no regressions. + +With the patch, /dev/disk/by-path symlinks are created correctly, +and are unique, backward-compatible with the physical port case: +- physical port (no vport field) +- virtual ports (w/ vport field) + + # ls -l /dev/disk/by-path | grep 0001:09:00.0 + <...> pci-0001:09:00.0-fc-0x500507680b2255fe-lun-0 -> ../../sdh + <...> pci-0001:09:00.0-fc-0x500507680b2255ff-lun-0 -> ../../sdi + <...> pci-0001:09:00.0-vport-0x5001a4aaf00a6785-fc-0x500507680b2255fe-lun-0 -> ../../sde + <...> pci-0001:09:00.0-vport-0x5001a4aaf00a6785-fc-0x500507680b2255ff-lun-0 -> ../../sdd + <...> pci-0001:09:00.0-vport-0x5001a4ad99d8c2de-fc-0x500507680b2255fe-lun-0 -> ../../sdc + <...> pci-0001:09:00.0-vport-0x5001a4ad99d8c2de-fc-0x500507680b2255ff-lun-0 -> ../../sdb + +Accordingly w/ sysfs: + + # ls -ld /sys/block/sd* | grep host1 + <...> /sys/block/sdb -> ../devices/pci0001:00/<...>/0001:09:00.0/host1/vport-1:0-0/host3/rport-3:0-1/target3:0:0/3:0:0:0/block/sdb + <...> /sys/block/sdc -> ../devices/pci0001:00/<...>/0001:09:00.0/host1/vport-1:0-0/host3/rport-3:0-2/target3:0:1/3:0:1:0/block/sdc + <...> /sys/block/sdd -> ../devices/pci0001:00/<...>/0001:09:00.0/host1/vport-1:0-2/host5/rport-5:0-1/target5:0:0/5:0:0:0/block/sdd + <...> /sys/block/sde -> ../devices/pci0001:00/<...>/0001:09:00.0/host1/vport-1:0-2/host5/rport-5:0-2/target5:0:1/5:0:1:0/block/sde + <...> /sys/block/sdh -> ../devices/pci0001:00/<...>/0001:09:00.0/host1/rport-1:0-3/target1:0:0/1:0:0:0/block/sdh + <...> /sys/block/sdi -> ../devices/pci0001:00/<...>/0001:09:00.0/host1/rport-1:0-4/target1:0:1/1:0:1:0/block/sdi + +The symlinks still include the fc_remote_port's (target) port_name: + + # grep . /sys/class/fc_remote_ports/rport-{3:0-{1,2},5:0-{1,2},1:0-{3,4}}/port_name + /sys/class/fc_remote_ports/rport-3:0-1/port_name:0x500507680b2255ff + /sys/class/fc_remote_ports/rport-3:0-2/port_name:0x500507680b2255fe + /sys/class/fc_remote_ports/rport-5:0-1/port_name:0x500507680b2255ff + /sys/class/fc_remote_ports/rport-5:0-2/port_name:0x500507680b2255fe + /sys/class/fc_remote_ports/rport-1:0-3/port_name:0x500507680b2255fe + /sys/class/fc_remote_ports/rport-1:0-4/port_name:0x500507680b2255ff + +And now include the fc_vport's (virtual host) port_name *if* it's from a fc_vport: + + # grep . /sys/class/fc_host/host1/port_name /sys/class/fc_vports/vport-1:0-{0,2}/port_name + /sys/class/fc_host/host1/port_name:0x10000090fa8f0ebc + /sys/class/fc_vports/vport-1:0-0/port_name:0x5001a4ad99d8c2de + /sys/class/fc_vports/vport-1:0-2/port_name:0x5001a4aaf00a6785 + +Signed-off-by: Mauricio Faria de Oliveira +Reported-by: Srikanth B. Aithal + +Cherry-picked from: 6a3d3f9e5970cf982ac37c65d0b856146b675a12 +Resolves: #1266934 +--- + src/udev/udev-builtin-path_id.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c +index 9ca6084..3b72922 100644 +--- a/src/udev/udev-builtin-path_id.c ++++ b/src/udev/udev-builtin-path_id.c +@@ -92,7 +92,11 @@ static struct udev_device *skip_subsystem(struct udev_device *dev, const char *s + static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, char **path) { + struct udev *udev = udev_device_get_udev(parent); + struct udev_device *targetdev; ++ struct udev_device *rportdev; ++ struct udev_device *hostdev; ++ struct udev_device *vportdev; + struct udev_device *fcdev = NULL; ++ struct udev_device *fc_vportdev = NULL; + const char *port; + char *lun = NULL; + +@@ -113,6 +117,32 @@ static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, + path_prepend(path, "fc-%s-%s", port, lun); + if (lun) + free(lun); ++ ++ /* NPIV */ ++ rportdev = udev_device_get_parent(targetdev); ++ if (rportdev == NULL) ++ goto out; ++ ++ hostdev = udev_device_get_parent(rportdev); ++ if (hostdev == NULL) ++ goto out; ++ ++ vportdev = udev_device_get_parent(hostdev); ++ if (vportdev == NULL) ++ goto out; ++ ++ fc_vportdev = udev_device_new_from_subsystem_sysname(udev, "fc_vports", udev_device_get_sysname(vportdev)); ++ if (fc_vportdev == NULL) ++ goto out; ++ ++ port = udev_device_get_sysattr_value(fc_vportdev, "port_name"); ++ if (port == NULL) ++ goto out_npiv; ++ ++ path_prepend(path, "vport-%s", port); ++ ++out_npiv: ++ udev_device_unref(fc_vportdev); + out: + udev_device_unref(fcdev); + return parent; diff --git a/SOURCES/0273-rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_R.patch b/SOURCES/0273-rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_R.patch new file mode 100644 index 0000000..a7ee894 --- /dev/null +++ b/SOURCES/0273-rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_R.patch @@ -0,0 +1,35 @@ +From 92f17bb12a37fe9deb0868ef8c4a43696319e72e Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 25 Feb 2016 15:15:04 +0100 +Subject: [PATCH] rules: set SYSTEMD_READY=0 on + DM_UDEV_DISABLE_OTHER_RULES_FLAG=1 only with ADD event + +The "SYSTEMD_READY=0" will cause automatic unmount +of mountpoint that is on top of such DM device +if this is used with multipath which sets +DM_UDEV_DISABLE_OTHER_RULES_FLAG in case +we have a CHANGE event thatcomes after DM multipath +device reload when one of the paths is down or up. + +See https://bugzilla.redhat.com/show_bug.cgi?id=1312011 + +RHEL-only +Cherry-picked from: 83a3642f617975d596b5001b1699c3d16773a6e5 +Resolves: #1312011 +--- + rules/99-systemd.rules.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in +index b66d727..a4f4bf3 100644 +--- a/rules/99-systemd.rules.in ++++ b/rules/99-systemd.rules.in +@@ -12,7 +12,7 @@ SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270 + KERNEL=="vport*", TAG+="systemd" + + SUBSYSTEM=="block", KERNEL!="ram*", TAG+="systemd" +-SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" ++SUBSYSTEM=="block", KERNEL!="ram*", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" + + # Ignore encrypted devices with no identified superblock on it, since + # we are probably still calling mke2fs or mkswap on it. diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 63b8857..cfefc31 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -7,7 +7,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 219 -Release: 19%{?dist}.4 +Release: 19%{?dist}.7 # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -295,6 +295,12 @@ Patch0264: 0264-makefile-disable-udev-tests.patch Patch0265: 0265-sysv-generator-test-always-log-to-console.patch Patch0266: 0266-test-sysv-generator-Check-for-network-online.target.patch Patch0267: 0267-Avoid-tmp-being-mounted-as-tmpfs-without-the-user-s-.patch +Patch0268: 0268-udev-fibre-channel-fix-NPIV-support.patch +Patch0269: 0269-ata_id-unreverse-WWN-identifier.patch +Patch0270: 0270-Fixup-WWN-bytes-for-big-endian-systems.patch +Patch0271: 0271-Revert-udev-fibre-channel-fix-NPIV-support.patch +Patch0272: 0272-udev-path-id-fibre-channel-NPIV-use-fc_vport-s-port_.patch +Patch0273: 0273-rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_R.patch %global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);} @@ -1254,6 +1260,18 @@ getent passwd systemd-resolve >/dev/null 2>&1 || useradd -r -l -g systemd-resolv %{_mandir}/man8/systemd-resolved.* %changelog +* Fri Mar 04 2016 Lukas Nykryn - 219-19.7 +- Revert "udev: fibre channel: fix NPIV support" (#1266934) +- udev: path-id: fibre channel NPIV - use fc_vport's port_name (#1266934) +- rules: set SYSTEMD_READY=0 on DM_UDEV_DISABLE_OTHER_RULES_FLAG=1 only with ADD event (#1312011) + +* Thu Feb 25 2016 Lukas Nykryn - 219-19.6 +- ata_id: unreverse WWN identifier (#1308795) +- Fixup WWN bytes for big-endian systems (#1308795) + +* Wed Feb 03 2016 Lukas Nykryn - 219-19.5 +- udev: fibre channel: fix NPIV support (#1266934) + * Wed Jan 13 2016 Lukas Nykryn - 219-19.4 - Avoid /tmp being mounted as tmpfs without the user's will (#1298109)