diff -Nru multipath-tools-0.4.9/debian/changelog multipath-tools-0.4.9/debian/changelog --- multipath-tools-0.4.9/debian/changelog 2016-05-12 05:04:32.000000000 -0400 +++ multipath-tools-0.4.9/debian/changelog 2016-05-17 14:42:36.000000000 -0400 @@ -1,3 +1,10 @@ +multipath-tools (0.4.9-3ubuntu7.13) trusty; urgency=medium + + * debian/patches/0001-multipath-fix-setting-sysfs-fc-timeout-parameters.patch: + multipath was not setting fiberchannel sysfs params correctly. (LP: #1578654) + + -- Dan Streetman Thu, 05 May 2016 13:47:30 +0000 + multipath-tools (0.4.9-3ubuntu7.12) trusty; urgency=medium * 0044-multipath-check-for-NULL-from-udev_device_get.patch (LP: #1532789) diff -Nru multipath-tools-0.4.9/debian/patches/0001-multipath-fix-setting-sysfs-fc-timeout-parameters.patch multipath-tools-0.4.9/debian/patches/0001-multipath-fix-setting-sysfs-fc-timeout-parameters.patch --- multipath-tools-0.4.9/debian/patches/0001-multipath-fix-setting-sysfs-fc-timeout-parameters.patch 1969-12-31 19:00:00.000000000 -0500 +++ multipath-tools-0.4.9/debian/patches/0001-multipath-fix-setting-sysfs-fc-timeout-parameters.patch 2016-05-17 14:42:00.000000000 -0400 @@ -0,0 +1,78 @@ +From 050b24b33d3c60e29f7820d2fb75e84a9edde528 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Mon, 20 Aug 2012 17:26:46 -0500 +Subject: [PATCH] multipath: fix setting sysfs fc timeout parameters + +Multipath was accidentally trying to write to the directory where +dev_loss_tmo and fast_io_fail_tmo were located instead to the files +themselves. Also, if dev_loss_tmo was unset, it was trying to set it +to 0. Finally, it wasn't correctly checking for errors in setting +the files. This patch fixes these issues. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 7 ++++--- + libmultipath/sysfs.c | 7 ++++--- + 2 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index 3315b5e..33e44b6 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -289,7 +289,8 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) + pp->sg_id.channel, pp->sg_id.scsi_id, rport_id); + + snprintf(value, 11, "%u", mpp->dev_loss); +- if (sysfs_attr_set_value(rport_dev, "dev_loss_tmo", value, 11) < 0) { ++ if (mpp->dev_loss && ++ sysfs_attr_set_value(rport_dev, "dev_loss_tmo", value, 11) <= 0) { + if ((!mpp->fast_io_fail || + mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF) + && mpp->dev_loss > 600) { +@@ -298,7 +298,7 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) + "fast_io_fail is not set", mpp->alias); + snprintf(value, 11, "%u", 600); + if (sysfs_attr_set_value(rport_dev, "dev_loss_tmo", +- value, 11) < 0) ++ value, 11) <= 0) + condlog(0, "%s failed to set dev_loss_tmo", + mpp->alias); + goto out; +@@ -311,7 +312,7 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) + else + snprintf(value, 11, "%u", mpp->fast_io_fail); + if (sysfs_attr_set_value(rport_dev, "fast_io_fail_tmo", +- value, 11) < 0) { ++ value, 11) <= 0) { + condlog(0, "%s failed to set fast_io_fail_tmo", + mpp->alias); + } +diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c +index c9dc280..8e986e8 100644 +--- a/libmultipath/sysfs.c ++++ b/libmultipath/sysfs.c +@@ -41,8 +41,8 @@ + ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, + char * value, size_t value_len) + { +- const char *devpath; ++ char devpath[PATH_SIZE]; + const char *path; + struct stat statbuf; + int fd; + ssize_t size = -1; +@@ -48,8 +48,9 @@ ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, + if (!dev || !attr_name || !value) + return 0; + +- devpath = udev_device_get_syspath(dev); +- condlog(4, "open '%s'/'%s'", devpath, attr_name); ++ snprintf(devpath, PATH_SIZE, "%s/%s", udev_device_get_syspath(dev), ++ attr_name); ++ condlog(4, "open '%s'", devpath); + if (stat(devpath, &statbuf) != 0) { + condlog(4, "stat '%s' failed: %s", devpath, strerror(errno)); + return 0; +-- +1.9.1 + diff -Nru multipath-tools-0.4.9/debian/patches/series multipath-tools-0.4.9/debian/patches/series --- multipath-tools-0.4.9/debian/patches/series 2016-05-12 05:00:38.000000000 -0400 +++ multipath-tools-0.4.9/debian/patches/series 2016-05-17 14:43:23.000000000 -0400 @@ -77,3 +77,4 @@ multipath_enable_sync_support_1b8082c8.patch dm-multipath-backlist-nvme-5c412e47.patch 0044-multipath-check-for-NULL-from-udev_device_get.patch +0001-multipath-fix-setting-sysfs-fc-timeout-parameters.patch