SHA256
1
0
forked from pool/systemd
systemd/1001-re-enable-by_path-links-for-ata-devices.patch
Stephan Kulow 74bf6f2e1d Accepting request 225960 from Base:System
- Add patch getty-generator-with-serial-3270-tty.patch to avoid
  harmless error messages on not existing getty@3270 files

- Replace systemd-big-endian-reply-matching.patch with upstream
  0001-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch 
  to solve broken systemd communication with and over dbus (bnc#866732)

- Readd patch 1008-add-msft-compability-rules.patch for
  older code base as 13.1 
- Modify pre_checkin.sh to throw an error if a patch will be
  applied which modifies one of Makefile.am, Makefile.in, or
  configiure.ac as this breaks bootstrapping
- Add second version of make-209-working-on-older-dist.patch
  to be able to apply for bootstrapping version

- Don't require non-existing binutils-gold

- Avoid file conflict between udev and systemd (bnc#868230)

- Modify patch
  module-load-handle-SUSE-etc-sysconfig-kernel-module-list.patch
  to ignore if /etc/sysconfig/kernel does not exist (bnc#865834) 

- Add patch systemd-big-endian-reply-matching.patch
  make sure that systemd can talk with dbus-daemon even on big
  endian systems (bnc#866732)
-----------------------------------------------------------------
- Due to previous reason, resurrect systemd-dbus-system-bus-address.patch
- Removed pkgconfig(dbus-1) BuildRequires - with 209 and newer, itis only
  needed for quering default DBus directories, which we nowpass to configure.

OBS-URL: https://build.opensuse.org/request/show/225960
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=178
2014-03-18 15:21:15 +00:00

103 lines
3.5 KiB
Diff

From 5cf46aa4339670afac386b1b0e630b739f3621c7 Mon Sep 17 00:00:00 2001
From: Robert Milasan <rmilasan@suse.com>
Date: Thu, 12 Jul 2012 15:56:34 +0000
Subject: [PATCH] Persistent by_path links for ata devices
With newer kernel we have the 'port_no' attribute,
which allows us to construct a valid ata by-path link.
With this patch ATA links of the form
ata-<port>.[01]
(for master/slave devices) or
ata-<port>.<pmp>.0
(for devices behind port multipliers)
are generated.
References: bnc#770910,FATE#317063
Signed-off-by: Robert Milasan <rmilasan@suse.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
src/udev/udev-builtin-path_id.c | 53 +++++++++++++++++++++++++++++++----------
1 file changed, 41 insertions(+), 12 deletions(-)
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
index 0599980..fbd3fda 100644
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -339,6 +339,46 @@ static struct udev_device *handle_scsi_hyperv(struct udev_device *parent, char *
return parent;
}
+static struct udev_device *handle_ata(struct udev_device *parent, char **path)
+{
+ struct udev *udev = udev_device_get_udev(parent);
+ struct udev_device *hostdev, *portdev;
+ int host, bus, target, lun, port_no;
+ const char *name, *atahost, *port;
+
+ hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
+ if (hostdev == NULL)
+ return NULL;
+
+ name = udev_device_get_sysname(parent);
+ if (sscanf(name, "%d:%d:%d:%d", &host, &bus, &target, &lun) != 4)
+ return NULL;
+
+ /* The ata port is the parent of the SCSI host */
+ hostdev = udev_device_get_parent(hostdev);
+ atahost = udev_device_get_sysname(hostdev);
+ if (strncmp(atahost, "ata", 3))
+ return NULL;
+
+ /* ATA port number is found in 'port_no' attribute */
+ portdev = udev_device_new_from_subsystem_sysname(udev, "ata_port",
+ atahost);
+ port = udev_device_get_sysattr_value(portdev, "port_no");
+ if (!port || sscanf(port, "%d", &port_no) != 1) {
+ hostdev = NULL;
+ goto out;
+ }
+ if (bus != 0)
+ /* Devices behind port multiplier have a bus != 0*/
+ path_prepend(path, "ata-%u.%u.0", port_no, bus);
+ else
+ /* Master/slave are distinguished by target id */
+ path_prepend(path, "ata-%u.%u", port_no, target);
+out:
+ udev_device_unref(portdev);
+ return hostdev;
+}
+
static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
{
const char *devtype;
@@ -375,19 +415,8 @@ static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
goto out;
}
- /*
- * We do not support the ATA transport class, it uses global counters
- * to name the ata devices which numbers spread across multiple
- * controllers.
- *
- * The real link numbers are not exported. Also, possible chains of ports
- * behind port multipliers cannot be composed that way.
- *
- * Until all that is solved at the kernel level, there are no by-path/
- * links for ATA devices.
- */
if (strstr(name, "/ata") != NULL) {
- parent = NULL;
+ parent = handle_ata(parent, path);
goto out;
}
--
1.8.1.4