Blame SOURCES/lvm2-2_03_12-filter-mpath-work-with-nvme-devices.patch

31f061
 lib/device/dev-type.c      |  81 +++++++++++++++++++----
31f061
 lib/device/dev-type.h      |   2 +
31f061
 lib/device/device.h        |   1 +
31f061
 lib/filters/filter-mpath.c | 156 ++++++++++++++++++++++++++++++---------------
31f061
 4 files changed, 177 insertions(+), 63 deletions(-)
31f061
31f061
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
31f061
index 896821d..379afa8 100644
31f061
--- a/lib/device/dev-type.c
31f061
+++ b/lib/device/dev-type.c
31f061
@@ -21,6 +21,7 @@
31f061
 #include "lib/metadata/metadata.h"
31f061
 #include "lib/device/bcache.h"
31f061
 #include "lib/label/label.h"
31f061
+#include "lib/commands/toolcontext.h"
31f061
 
31f061
 #ifdef BLKID_WIPING_SUPPORT
31f061
 #include <blkid.h>
31f061
@@ -67,6 +68,31 @@ int dev_is_pmem(struct device *dev)
31f061
 	return is_pmem ? 1 : 0;
31f061
 }
31f061
 
31f061
+/*
31f061
+ * An nvme device has major number 259 (BLKEXT), minor number <minor>,
31f061
+ * and reading /sys/dev/block/259:<minor>/device/dev shows a character
31f061
+ * device cmajor:cminor where cmajor matches the major number of the
31f061
+ * nvme character device entry in /proc/devices.  Checking all of that
31f061
+ * is excessive and unnecessary compared to just comparing /dev/name*.
31f061
+ */
31f061
+
31f061
+int dev_is_nvme(struct dev_types *dt, struct device *dev)
31f061
+{
31f061
+	struct dm_str_list *strl;
31f061
+
31f061
+	if (dev->flags & DEV_IS_NVME)
31f061
+		return 1;
31f061
+
31f061
+	dm_list_iterate_items(strl, &dev->aliases) {
31f061
+		if (!strncmp(strl->str, "/dev/nvme", 9)) {
31f061
+			log_debug("Found nvme device %s", dev_name(dev));
31f061
+			dev->flags |= DEV_IS_NVME;
31f061
+			return 1;
31f061
+		}
31f061
+	}
31f061
+	return 0;
31f061
+}
31f061
+
31f061
 int dev_is_lv(struct device *dev)
31f061
 {
31f061
 	FILE *fp;
31f061
@@ -302,6 +328,9 @@ int dev_subsystem_part_major(struct dev_types *dt, struct device *dev)
31f061
 
31f061
 const char *dev_subsystem_name(struct dev_types *dt, struct device *dev)
31f061
 {
31f061
+	if (dev->flags & DEV_IS_NVME)
31f061
+		return "NVME";
31f061
+
31f061
 	if (MAJOR(dev->dev) == dt->device_mapper_major)
31f061
 		return "DM";
31f061
 
31f061
@@ -348,7 +377,6 @@ int major_is_scsi_device(struct dev_types *dt, int major)
31f061
 	return (dt->dev_type_array[major].flags & PARTITION_SCSI_DEVICE) ? 1 : 0;
31f061
 }
31f061
 
31f061
-
31f061
 static int _loop_is_with_partscan(struct device *dev)
31f061
 {
31f061
 	FILE *fp;
31f061
@@ -398,6 +426,28 @@ struct partition {
31f061
 	uint32_t nr_sects;
31f061
 } __attribute__((packed));
31f061
 
31f061
+static int _has_sys_partition(struct device *dev)
31f061
+{
31f061
+	char path[PATH_MAX];
31f061
+	struct stat info;
31f061
+	int major = (int) MAJOR(dev->dev);
31f061
+	int minor = (int) MINOR(dev->dev);
31f061
+
31f061
+	/* check if dev is a partition */
31f061
+	if (dm_snprintf(path, sizeof(path), "%s/dev/block/%d:%d/partition",
31f061
+			dm_sysfs_dir(), major, minor) < 0) {
31f061
+		log_error("dm_snprintf partition failed");
31f061
+		return 0;
31f061
+	}
31f061
+
31f061
+	if (stat(path, &info) == -1) {
31f061
+		if (errno != ENOENT)
31f061
+			log_sys_error("stat", path);
31f061
+		return 0;
31f061
+	}
31f061
+	return 1;
31f061
+}
31f061
+
31f061
 static int _is_partitionable(struct dev_types *dt, struct device *dev)
31f061
 {
31f061
 	int parts = major_max_partitions(dt, MAJOR(dev->dev));
31f061
@@ -414,6 +464,13 @@ static int _is_partitionable(struct dev_types *dt, struct device *dev)
31f061
 	    _loop_is_with_partscan(dev))
31f061
 		return 1;
31f061
 
31f061
+	if (dev_is_nvme(dt, dev)) {
31f061
+		/* If this dev is already a partition then it's not partitionable. */
31f061
+		if (_has_sys_partition(dev))
31f061
+			return 0;
31f061
+		return 1;
31f061
+	}
31f061
+
31f061
 	if ((parts <= 1) || (MINOR(dev->dev) % parts))
31f061
 		return 0;
31f061
 
31f061
@@ -557,11 +614,18 @@ int dev_get_primary_dev(struct dev_types *dt, struct device *dev, dev_t *result)
31f061
 	char path[PATH_MAX];
31f061
 	char temp_path[PATH_MAX];
31f061
 	char buffer[64];
31f061
-	struct stat info;
31f061
 	FILE *fp = NULL;
31f061
 	int parts, residue, size, ret = 0;
31f061
 
31f061
 	/*
31f061
+	 * /dev/nvme devs don't use the major:minor numbering like
31f061
+	 * block dev types that have their own major number, so
31f061
+	 * the calculation based on minor number doesn't work.
31f061
+	 */
31f061
+	if (dev_is_nvme(dt, dev))
31f061
+		goto sys_partition;
31f061
+
31f061
+	/*
31f061
 	 * Try to get the primary dev out of the
31f061
 	 * list of known device types first.
31f061
 	 */
31f061
@@ -576,23 +640,14 @@ int dev_get_primary_dev(struct dev_types *dt, struct device *dev, dev_t *result)
31f061
 		goto out;
31f061
 	}
31f061
 
31f061
+ sys_partition:
31f061
 	/*
31f061
 	 * If we can't get the primary dev out of the list of known device
31f061
 	 * types, try to look at sysfs directly then. This is more complex
31f061
 	 * way and it also requires certain sysfs layout to be present
31f061
 	 * which might not be there in old kernels!
31f061
 	 */
31f061
-
31f061
-	/* check if dev is a partition */
31f061
-	if (dm_snprintf(path, sizeof(path), "%s/dev/block/%d:%d/partition",
31f061
-			sysfs_dir, major, minor) < 0) {
31f061
-		log_error("dm_snprintf partition failed");
31f061
-		goto out;
31f061
-	}
31f061
-
31f061
-	if (stat(path, &info) == -1) {
31f061
-		if (errno != ENOENT)
31f061
-			log_sys_error("stat", path);
31f061
+	if (!_has_sys_partition(dev)) {
31f061
 		*result = dev->dev;
31f061
 		ret = 1;
31f061
 		goto out; /* dev is not a partition! */
31f061
diff --git a/lib/device/dev-type.h b/lib/device/dev-type.h
31f061
index fdf7791..8b94b79 100644
31f061
--- a/lib/device/dev-type.h
31f061
+++ b/lib/device/dev-type.h
31f061
@@ -95,6 +95,8 @@ int dev_is_rotational(struct dev_types *dt, struct device *dev);
31f061
 
31f061
 int dev_is_pmem(struct device *dev);
31f061
 
31f061
+int dev_is_nvme(struct dev_types *dt, struct device *dev);
31f061
+
31f061
 int dev_is_lv(struct device *dev);
31f061
 
31f061
 int get_fs_block_size(struct device *dev, uint32_t *fs_block_size);
31f061
diff --git a/lib/device/device.h b/lib/device/device.h
31f061
index a58bff8..816db31 100644
31f061
--- a/lib/device/device.h
31f061
+++ b/lib/device/device.h
31f061
@@ -38,6 +38,7 @@
31f061
 #define DEV_SCAN_FOUND_LABEL	0x00010000      /* label scan read dev and found label */
31f061
 #define DEV_IS_MD_COMPONENT	0x00020000	/* device is an md component */
31f061
 #define DEV_UDEV_INFO_MISSING   0x00040000	/* we have no udev info for this device */
31f061
+#define DEV_IS_NVME		0x00080000	/* set if dev is nvme */
31f061
 
31f061
 /*
31f061
  * Support for external device info.
31f061
diff --git a/lib/filters/filter-mpath.c b/lib/filters/filter-mpath.c
31f061
index 85d1625..40e7df6 100644
31f061
--- a/lib/filters/filter-mpath.c
31f061
+++ b/lib/filters/filter-mpath.c
31f061
@@ -16,6 +16,7 @@
31f061
 #include "lib/misc/lib.h"
31f061
 #include "lib/filters/filter.h"
31f061
 #include "lib/activate/activate.h"
31f061
+#include "lib/commands/toolcontext.h"
31f061
 #ifdef UDEV_SYNC_SUPPORT
31f061
 #include <libudev.h>
31f061
 #include "lib/device/dev-ext-udev-constants.h"
31f061
@@ -27,7 +28,6 @@
31f061
 
31f061
 #define MPATH_PREFIX "mpath-"
31f061
 
31f061
-
31f061
 struct mpath_priv {
31f061
 	struct dm_pool *mem;
31f061
 	struct dev_filter f;
31f061
@@ -35,6 +35,9 @@ struct mpath_priv {
31f061
 	struct dm_hash_table *hash;
31f061
 };
31f061
 
31f061
+/*
31f061
+ * given "/dev/foo" return "foo"
31f061
+ */
31f061
 static const char *_get_sysfs_name(struct device *dev)
31f061
 {
31f061
 	const char *name;
31f061
@@ -53,6 +56,11 @@ static const char *_get_sysfs_name(struct device *dev)
31f061
 	return name;
31f061
 }
31f061
 
31f061
+/*
31f061
+ * given major:minor
31f061
+ * readlink translates /sys/dev/block/major:minor to /sys/.../foo
31f061
+ * from /sys/.../foo return "foo"
31f061
+ */
31f061
 static const char *_get_sysfs_name_by_devt(const char *sysfs_dir, dev_t devno,
31f061
 					  char *buf, size_t buf_size)
31f061
 {
31f061
@@ -102,27 +110,28 @@ static int _get_sysfs_string(const char *path, char *buffer, int max_size)
31f061
 	return r;
31f061
 }
31f061
 
31f061
-static int _get_sysfs_get_major_minor(const char *sysfs_dir, const char *kname, int *major, int *minor)
31f061
+static int _get_sysfs_dm_mpath(struct dev_types *dt, const char *sysfs_dir, const char *holder_name)
31f061
 {
31f061
-	char path[PATH_MAX], buffer[64];
31f061
+	char path[PATH_MAX];
31f061
+	char buffer[128];
31f061
 
31f061
-	if (dm_snprintf(path, sizeof(path), "%s/block/%s/dev", sysfs_dir, kname) < 0) {
31f061
+	if (dm_snprintf(path, sizeof(path), "%sblock/%s/dm/uuid", sysfs_dir, holder_name) < 0) {
31f061
 		log_error("Sysfs path string is too long.");
31f061
 		return 0;
31f061
 	}
31f061
 
31f061
+	buffer[0] = '\0';
31f061
+
31f061
 	if (!_get_sysfs_string(path, buffer, sizeof(buffer)))
31f061
 		return_0;
31f061
 
31f061
-	if (sscanf(buffer, "%d:%d", major, minor) != 2) {
31f061
-		log_error("Failed to parse major minor from %s", buffer);
31f061
-		return 0;
31f061
-	}
31f061
+	if (!strncmp(buffer, MPATH_PREFIX, 6))
31f061
+		return 1;
31f061
 
31f061
-	return 1;
31f061
+	return 0;
31f061
 }
31f061
 
31f061
-static int _get_parent_mpath(const char *dir, char *name, int max_size)
31f061
+static int _get_holder_name(const char *dir, char *name, int max_size)
31f061
 {
31f061
 	struct dirent *d;
31f061
 	DIR *dr;
31f061
@@ -155,7 +164,7 @@ static int _get_parent_mpath(const char *dir, char *name, int max_size)
31f061
 }
31f061
 
31f061
 #ifdef UDEV_SYNC_SUPPORT
31f061
-static int _udev_dev_is_mpath(struct device *dev)
31f061
+static int _udev_dev_is_mpath_component(struct device *dev)
31f061
 {
31f061
 	const char *value;
31f061
 	struct dev_ext *ext;
31f061
@@ -174,95 +183,148 @@ static int _udev_dev_is_mpath(struct device *dev)
31f061
 	return 0;
31f061
 }
31f061
 #else
31f061
-static int _udev_dev_is_mpath(struct device *dev)
31f061
+static int _udev_dev_is_mpath_component(struct device *dev)
31f061
 {
31f061
 	return 0;
31f061
 }
31f061
 #endif
31f061
 
31f061
-static int _native_dev_is_mpath(struct dev_filter *f, struct device *dev)
31f061
+static int _native_dev_is_mpath_component(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
31f061
 {
31f061
 	struct mpath_priv *mp = (struct mpath_priv *) f->private;
31f061
 	struct dev_types *dt = mp->dt;
31f061
-	const char *part_name, *name;
31f061
-	struct stat info;
31f061
-	char path[PATH_MAX], parent_name[PATH_MAX];
31f061
+	const char *part_name;
31f061
+	const char *name;               /* e.g. "sda" for "/dev/sda" */
31f061
+	char link_path[PATH_MAX];       /* some obscure, unpredictable sysfs path */
31f061
+	char holders_path[PATH_MAX];    /* e.g. "/sys/block/sda/holders/" */
31f061
+	char dm_dev_path[PATH_MAX];    /* e.g. "/dev/dm-1" */
31f061
+	char holder_name[128] = { 0 };  /* e.g. "dm-1" */
31f061
 	const char *sysfs_dir = dm_sysfs_dir();
31f061
-	int major = MAJOR(dev->dev);
31f061
-	int minor = MINOR(dev->dev);
31f061
+	int dev_major = MAJOR(dev->dev);
31f061
+	int dev_minor = MINOR(dev->dev);
31f061
+	int dm_dev_major;
31f061
+	int dm_dev_minor;
31f061
+	struct stat info;
31f061
 	dev_t primary_dev;
31f061
 	long look;
31f061
 
31f061
-	/* Limit this filter only to SCSI devices */
31f061
-	if (!major_is_scsi_device(dt, MAJOR(dev->dev)))
31f061
+	/* Limit this filter to SCSI or NVME devices */
31f061
+	if (!major_is_scsi_device(dt, dev_major) && !dev_is_nvme(dt, dev))
31f061
 		return 0;
31f061
 
31f061
 	switch (dev_get_primary_dev(dt, dev, &primary_dev)) {
31f061
+
31f061
 	case 2: /* The dev is partition. */
31f061
 		part_name = dev_name(dev); /* name of original dev for log_debug msg */
31f061
-		if (!(name = _get_sysfs_name_by_devt(sysfs_dir, primary_dev, parent_name, sizeof(parent_name))))
31f061
+
31f061
+		/* gets "foo" for "/dev/foo" where "/dev/foo" comes from major:minor */
31f061
+		if (!(name = _get_sysfs_name_by_devt(sysfs_dir, primary_dev, link_path, sizeof(link_path))))
31f061
 			return_0;
31f061
+
31f061
 		log_debug_devs("%s: Device is a partition, using primary "
31f061
 			       "device %s for mpath component detection",
31f061
 			       part_name, name);
31f061
 		break;
31f061
+
31f061
 	case 1: /* The dev is already a primary dev. Just continue with the dev. */
31f061
+
31f061
+		/* gets "foo" for "/dev/foo" */
31f061
 		if (!(name = _get_sysfs_name(dev)))
31f061
 			return_0;
31f061
 		break;
31f061
+
31f061
 	default: /* 0, error. */
31f061
-		log_warn("Failed to get primary device for %d:%d.", major, minor);
31f061
+		log_warn("Failed to get primary device for %d:%d.", dev_major, dev_minor);
31f061
 		return 0;
31f061
 	}
31f061
 
31f061
-	if (dm_snprintf(path, sizeof(path), "%s/block/%s/holders", sysfs_dir, name) < 0) {
31f061
+	if (dm_snprintf(holders_path, sizeof(holders_path), "%sblock/%s/holders", sysfs_dir, name) < 0) {
31f061
 		log_warn("Sysfs path to check mpath is too long.");
31f061
 		return 0;
31f061
 	}
31f061
 
31f061
 	/* also will filter out partitions */
31f061
-	if (stat(path, &info))
31f061
+	if (stat(holders_path, &info))
31f061
 		return 0;
31f061
 
31f061
 	if (!S_ISDIR(info.st_mode)) {
31f061
-		log_warn("Path %s is not a directory.", path);
31f061
+		log_warn("Path %s is not a directory.", holders_path);
31f061
 		return 0;
31f061
 	}
31f061
 
31f061
-	if (!_get_parent_mpath(path, parent_name, sizeof(parent_name)))
31f061
+	/*
31f061
+	 * If holders dir contains an entry such as "dm-1", then this sets
31f061
+	 * holder_name to "dm-1".
31f061
+	 *
31f061
+	 * If holders dir is empty, return 0 (this is generally where
31f061
+	 * devs that are not mpath components return.)
31f061
+	 */
31f061
+	if (!_get_holder_name(holders_path, holder_name, sizeof(holder_name)))
31f061
 		return 0;
31f061
 
31f061
-	if (!_get_sysfs_get_major_minor(sysfs_dir, parent_name, &major, &minor))
31f061
-		return_0;
31f061
+	if (dm_snprintf(dm_dev_path, sizeof(dm_dev_path), "%s/%s", cmd->dev_dir, holder_name) < 0) {
31f061
+		log_warn("dm device path to check mpath is too long.");
31f061
+		return 0;
31f061
+	}
31f061
 
31f061
-	if (major != dt->device_mapper_major)
31f061
+	/*
31f061
+	 * stat "/dev/dm-1" which is the holder of the dev we're checking
31f061
+	 * dm_dev_major:dm_dev_minor come from stat("/dev/dm-1")
31f061
+	 */
31f061
+	if (stat(dm_dev_path, &info)) {
31f061
+		log_debug("filter-mpath %s holder %s stat result %d",
31f061
+			  dev_name(dev), dm_dev_path, errno);
31f061
 		return 0;
31f061
+	}
31f061
+	dm_dev_major = (int)MAJOR(info.st_rdev);
31f061
+	dm_dev_minor = (int)MINOR(info.st_rdev);
31f061
+	
31f061
+	if (dm_dev_major != dt->device_mapper_major) {
31f061
+		log_debug_devs("filter-mpath %s holder %s %d:%d does not have dm major",
31f061
+			       dev_name(dev), dm_dev_path, dm_dev_major, dm_dev_minor);
31f061
+		return 0;
31f061
+	}
31f061
 
31f061
-	/* Avoid repeated detection of multipath device and use first checked result */
31f061
-	look = (long) dm_hash_lookup_binary(mp->hash, &minor, sizeof(minor));
31f061
+	/*
31f061
+	 * Save the result of checking that "/dev/dm-1" is an mpath device
31f061
+	 * to avoid repeating it for each path component.
31f061
+	 * The minor number of "/dev/dm-1" is added to the hash table with
31f061
+	 * const value 2 meaning that dm minor 1 (for /dev/dm-1) is a multipath dev
31f061
+	 * and const value 1 meaning that dm minor 1 is not a multipath dev.
31f061
+	 */
31f061
+	look = (long) dm_hash_lookup_binary(mp->hash, &dm_dev_minor, sizeof(dm_dev_minor));
31f061
 	if (look > 0) {
31f061
-		log_debug_devs("%s(%u:%u): already checked as %sbeing mpath.",
31f061
-			       parent_name, major, minor, (look > 1) ? "" : "not ");
31f061
+		log_debug_devs("filter-mpath %s holder %s %u:%u already checked as %sbeing mpath.",
31f061
+			       dev_name(dev), holder_name, dm_dev_major, dm_dev_minor, (look > 1) ? "" : "not ");
31f061
 		return (look > 1) ? 1 : 0;
31f061
 	}
31f061
 
31f061
-	if (lvm_dm_prefix_check(major, minor, MPATH_PREFIX)) {
31f061
-		(void) dm_hash_insert_binary(mp->hash, &minor, sizeof(minor), (void*)2);
31f061
+	/*
31f061
+	 * Returns 1 if /sys/block/<holder_name>/dm/uuid indicates that
31f061
+	 * <holder_name> is a dm device with dm uuid prefix mpath-.
31f061
+	 * When true, <holder_name> will be something like "dm-1".
31f061
+	 *
31f061
+	 * (Is a hash table worth it to avoid reading one sysfs file?)
31f061
+	 */
31f061
+	if (_get_sysfs_dm_mpath(dt, sysfs_dir, holder_name)) {
31f061
+		log_debug_devs("filter-mpath %s holder %s %u:%u ignore mpath component",
31f061
+			       dev_name(dev), holder_name, dm_dev_major, dm_dev_minor);
31f061
+		(void) dm_hash_insert_binary(mp->hash, &dm_dev_minor, sizeof(dm_dev_minor), (void*)2);
31f061
 		return 1;
31f061
 	}
31f061
 
31f061
-	(void) dm_hash_insert_binary(mp->hash, &minor, sizeof(minor), (void*)1);
31f061
+	(void) dm_hash_insert_binary(mp->hash, &dm_dev_minor, sizeof(dm_dev_minor), (void*)1);
31f061
 
31f061
 	return 0;
31f061
 }
31f061
 
31f061
-static int _dev_is_mpath(struct dev_filter *f, struct device *dev)
31f061
+static int _dev_is_mpath_component(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
31f061
 {
31f061
 	if (dev->ext.src == DEV_EXT_NONE)
31f061
-		return _native_dev_is_mpath(f, dev);
31f061
+		return _native_dev_is_mpath_component(cmd, f, dev);
31f061
 
31f061
 	if (dev->ext.src == DEV_EXT_UDEV)
31f061
-		return _udev_dev_is_mpath(dev);
31f061
+		return _udev_dev_is_mpath_component(dev);
31f061
 
31f061
 	log_error(INTERNAL_ERROR "Missing hook for mpath recognition "
31f061
 		  "using external device info source %s", dev_ext_name(dev));
31f061
@@ -272,11 +334,11 @@ static int _dev_is_mpath(struct dev_filter *f, struct device *dev)
31f061
 
31f061
 #define MSG_SKIPPING "%s: Skipping mpath component device"
31f061
 
31f061
-static int _ignore_mpath(struct cmd_context *cmd, struct dev_filter *f, struct device *dev, const char *use_filter_name)
31f061
+static int _ignore_mpath_component(struct cmd_context *cmd, struct dev_filter *f, struct device *dev, const char *use_filter_name)
31f061
 {
31f061
 	dev->filtered_flags &= ~DEV_FILTERED_MPATH_COMPONENT;
31f061
 
31f061
-	if (_dev_is_mpath(f, dev) == 1) {
31f061
+	if (_dev_is_mpath_component(cmd, f, dev) == 1) {
31f061
 		if (dev->ext.src == DEV_EXT_NONE)
31f061
 			log_debug_devs(MSG_SKIPPING, dev_name(dev));
31f061
 		else
31f061
@@ -303,8 +365,8 @@ static void _destroy(struct dev_filter *f)
31f061
 struct dev_filter *mpath_filter_create(struct dev_types *dt)
31f061
 {
31f061
 	const char *sysfs_dir = dm_sysfs_dir();
31f061
-	struct dm_pool *mem;
31f061
 	struct mpath_priv *mp;
31f061
+	struct dm_pool *mem;
31f061
 	struct dm_hash_table *hash;
31f061
 
31f061
 	if (!*sysfs_dir) {
31f061
@@ -328,19 +390,13 @@ struct dev_filter *mpath_filter_create(struct dev_types *dt)
31f061
 		goto bad;
31f061
 	}
31f061
 
31f061
-	if (!(mp = dm_pool_zalloc(mem, sizeof(*mp)))) {
31f061
-		log_error("mpath filter allocation failed.");
31f061
-		goto bad;
31f061
-	}
31f061
-
31f061
-	mp->f.passes_filter = _ignore_mpath;
31f061
+	mp->f.passes_filter = _ignore_mpath_component;
31f061
 	mp->f.destroy = _destroy;
31f061
 	mp->f.use_count = 0;
31f061
 	mp->f.private = mp;
31f061
 	mp->f.name = "mpath";
31f061
-
31f061
-	mp->mem = mem;
31f061
 	mp->dt = dt;
31f061
+	mp->mem = mem;
31f061
 	mp->hash = hash;
31f061
 
31f061
 	log_debug_devs("mpath filter initialised.");