[Pkg-zfsonlinux-devel] [SCM] zfs branch, master, updated. debian/0.6.5.6-2-7-g2d1f32d

Aron Xu aron at debian.org
Tue May 31 07:18:23 UTC 2016


The following commit has been merged in the master branch:
commit 5eacc075a6d5f568b95682994ca4ea7120a0fef9
Author: Aron Xu <aron at debian.org>
Date:   Tue May 31 14:08:52 2016 +0800

    Imported Upstream version 0.6.5.7

diff --git a/META b/META
index 8d4c352..f2cc959 100644
--- a/META
+++ b/META
@@ -1,7 +1,7 @@
 Meta:         1
 Name:         zfs
 Branch:       1.0
-Version:      0.6.5.6
+Version:      0.6.5.7
 Release:      1
 Release-Tags: relext
 License:      CDDL
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 8f6916a..edc50cd 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -6038,6 +6038,7 @@ main(int argc, char **argv)
 
 	(void) setlocale(LC_ALL, "");
 	(void) textdomain(TEXT_DOMAIN);
+	srand(time(NULL));
 
 	dprintf_setup(&argc, argv);
 
diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c
index cae2014..8e7d311 100644
--- a/cmd/zpool/zpool_vdev.c
+++ b/cmd/zpool/zpool_vdev.c
@@ -1206,12 +1206,10 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv)
 
 		/*
 		 * Remove any previously existing symlink from a udev path to
-		 * the device before labeling the disk.  This makes
-		 * zpool_label_disk_wait() truly wait for the new link to show
-		 * up instead of returning if it finds an old link still in
-		 * place.  Otherwise there is a window between when udev
-		 * deletes and recreates the link during which access attempts
-		 * will fail with ENOENT.
+		 * the device before labeling the disk.  This ensures that
+		 * only newly created links are used.  Otherwise there is a
+		 * window between when udev deletes and recreates the link
+		 * during which access attempts will fail with ENOENT.
 		 */
 		strncpy(udevpath, path, MAXPATHLEN);
 		(void) zfs_append_partition(udevpath, MAXPATHLEN);
@@ -1235,6 +1233,8 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv)
 		 * and then block until udev creates the new link.
 		 */
 		if (!is_exclusive || !is_spare(NULL, udevpath)) {
+			char *devnode = strrchr(devpath, '/') + 1;
+
 			ret = strncmp(udevpath, UDISK_ROOT, strlen(UDISK_ROOT));
 			if (ret == 0) {
 				ret = lstat64(udevpath, &statbuf);
@@ -1242,18 +1242,29 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv)
 					(void) unlink(udevpath);
 			}
 
-			if (zpool_label_disk(g_zfs, zhp,
-			    strrchr(devpath, '/') + 1) == -1)
+			/*
+			 * When labeling a pool the raw device node name
+			 * is provided as it appears under /dev/.
+			 */
+			if (zpool_label_disk(g_zfs, zhp, devnode) == -1)
 				return (-1);
 
+			/*
+			 * Wait for udev to signal the device is available
+			 * by the provided path.
+			 */
 			ret = zpool_label_disk_wait(udevpath, DISK_LABEL_WAIT);
 			if (ret) {
-				(void) fprintf(stderr, gettext("cannot "
-				    "resolve path '%s': %d\n"), udevpath, ret);
-				return (-1);
+				(void) fprintf(stderr,
+				    gettext("missing link: %s was "
+				    "partitioned but %s is missing\n"),
+				    devnode, udevpath);
+				return (ret);
 			}
 
-			(void) zero_label(udevpath);
+			ret = zero_label(udevpath);
+			if (ret)
+				return (ret);
 		}
 
 		/*
diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4
index e1881f6..f614287 100644
--- a/config/kernel-xattr-handler.m4
+++ b/config/kernel-xattr-handler.m4
@@ -33,6 +33,31 @@ AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER], [
 ])
 
 dnl #
+dnl # 4.5 API change,
+dnl # struct xattr_handler added new member "name".
+dnl # xattr_handler which matches to whole name rather than prefix should use
+dnl # "name" instead of "prefix", e.g. "system.posix_acl_access"
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_NAME], [
+	AC_MSG_CHECKING([whether xattr_handler has name])
+	ZFS_LINUX_TRY_COMPILE([
+		#include <linux/xattr.h>
+
+		static const struct xattr_handler
+		    xops __attribute__ ((unused)) = {
+			.name = XATTR_NAME_POSIX_ACL_ACCESS,
+		};
+	],[
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1,
+		    [xattr_handler has name])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
 dnl # Supported xattr handler get() interfaces checked newest to oldest.
 dnl #
 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
diff --git a/config/kernel.m4 b/config/kernel.m4
index bac7d4d..a9f1b6a 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -32,6 +32,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
 	ZFS_AC_KERNEL_GET_GENDISK
 	ZFS_AC_KERNEL_DISCARD_GRANULARITY
 	ZFS_AC_KERNEL_CONST_XATTR_HANDLER
+	ZFS_AC_KERNEL_XATTR_HANDLER_NAME
 	ZFS_AC_KERNEL_XATTR_HANDLER_GET
 	ZFS_AC_KERNEL_XATTR_HANDLER_SET
 	ZFS_AC_KERNEL_XATTR_HANDLER_LIST
diff --git a/configure b/configure
index d56482b..4ae6130 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for zfs 0.6.5.6.
+# Generated by GNU Autoconf 2.68 for zfs 0.6.5.7.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -567,8 +567,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='zfs'
 PACKAGE_TARNAME='zfs'
-PACKAGE_VERSION='0.6.5.6'
-PACKAGE_STRING='zfs 0.6.5.6'
+PACKAGE_VERSION='0.6.5.7'
+PACKAGE_STRING='zfs 0.6.5.7'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1401,7 +1401,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures zfs 0.6.5.6 to adapt to many kinds of systems.
+\`configure' configures zfs 0.6.5.7 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1472,7 +1472,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of zfs 0.6.5.6:";;
+     short | recursive ) echo "Configuration of zfs 0.6.5.7:";;
    esac
   cat <<\_ACEOF
 
@@ -1607,7 +1607,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-zfs configure 0.6.5.6
+zfs configure 0.6.5.7
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1972,7 +1972,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by zfs $as_me 0.6.5.6, which was
+It was created by zfs $as_me 0.6.5.7, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -3099,7 +3099,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='zfs'
- VERSION='0.6.5.6'
+ VERSION='0.6.5.7'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14916,6 +14916,75 @@ fi
 
 
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler has name" >&5
+$as_echo_n "checking whether xattr_handler has name... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+		#include <linux/xattr.h>
+
+		static const struct xattr_handler
+		    xops __attribute__ ((unused)) = {
+			.name = XATTR_NAME_POSIX_ACL_ACCESS,
+		};
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+	echo "obj-m := conftest.o" >build/Makefile
+	modpost_flag=''
+	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+	if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_XATTR_HANDLER_NAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+	rm -Rf build
+
+
+
+
 							{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->get() wants xattr_handler" >&5
 $as_echo_n "checking whether xattr_handler->get() wants xattr_handler... " >&6; }
 
@@ -24679,6 +24748,75 @@ fi
 
 
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler has name" >&5
+$as_echo_n "checking whether xattr_handler has name... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+		#include <linux/xattr.h>
+
+		static const struct xattr_handler
+		    xops __attribute__ ((unused)) = {
+			.name = XATTR_NAME_POSIX_ACL_ACCESS,
+		};
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+	echo "obj-m := conftest.o" >build/Makefile
+	modpost_flag=''
+	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+	if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_XATTR_HANDLER_NAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+	rm -Rf build
+
+
+
+
 							{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->get() wants xattr_handler" >&5
 $as_echo_n "checking whether xattr_handler->get() wants xattr_handler... " >&6; }
 
@@ -32326,7 +32464,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by zfs $as_me 0.6.5.6, which was
+This file was extended by zfs $as_me 0.6.5.7, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -32392,7 +32530,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-zfs config.status 0.6.5.6
+zfs config.status 0.6.5.7
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h
index eee6c1f..5e19ea1 100644
--- a/include/linux/xattr_compat.h
+++ b/include/linux/xattr_compat.h
@@ -190,20 +190,20 @@ fn(struct inode *ip, const char *name, const void *buffer,		\
 
 /*
  * Linux 3.7 API change. posix_acl_{from,to}_xattr gained the user_ns
- * parameter.  For the HAVE_POSIX_ACL_FROM_XATTR_USERNS version the
- * userns _may_ not be correct because it's used outside the RCU.
+ * parameter.  All callers are expected to pass the &init_user_ns which
+ * is available through the init credential (kcred).
  */
 #ifdef HAVE_POSIX_ACL_FROM_XATTR_USERNS
 static inline struct posix_acl *
 zpl_acl_from_xattr(const void *value, int size)
 {
-	return (posix_acl_from_xattr(CRED()->user_ns, value, size));
+	return (posix_acl_from_xattr(kcred->user_ns, value, size));
 }
 
 static inline int
 zpl_acl_to_xattr(struct posix_acl *acl, void *value, int size)
 {
-	return (posix_acl_to_xattr(CRED()->user_ns, acl, value, size));
+	return (posix_acl_to_xattr(kcred->user_ns, acl, value, size));
 }
 
 #else
diff --git a/lib/libspl/include/sys/types.h b/lib/libspl/include/sys/types.h
index 9816345..25d56be 100644
--- a/lib/libspl/include/sys/types.h
+++ b/lib/libspl/include/sys/types.h
@@ -30,7 +30,6 @@
 #include <sys/isa_defs.h>
 #include <sys/feature_tests.h>
 #include_next <sys/types.h>
-#include <sys/param.h> /* for NBBY */
 #include <sys/types32.h>
 #include <sys/va_list.h>
 
@@ -95,4 +94,6 @@ typedef union {
 } lloff_t;
 #endif
 
+#include <sys/param.h> /* for NBBY */
+
 #endif
diff --git a/lib/libzfs/libzfs.pc b/lib/libzfs/libzfs.pc
index 349ba8f..ee6f0a4 100644
--- a/lib/libzfs/libzfs.pc
+++ b/lib/libzfs/libzfs.pc
@@ -5,7 +5,7 @@ includedir=${prefix}/include
 
 Name: libzfs
 Description: LibZFS library
-Version: 0.6.5.6
+Version: 0.6.5.7
 URL: http://zfsonlinux.org
 Requires: libzfs_core
 Cflags: -I${includedir}/libzfs -I${includedir}/libspl
diff --git a/lib/libzfs/libzfs_core.pc b/lib/libzfs/libzfs_core.pc
index b7ec4a4..b59c0e4 100644
--- a/lib/libzfs/libzfs_core.pc
+++ b/lib/libzfs/libzfs_core.pc
@@ -5,7 +5,7 @@ includedir=${prefix}/include
 
 Name: libzfs_core
 Description: LibZFS core library
-Version: 0.6.5.6
+Version: 0.6.5.7
 URL: http://zfsonlinux.org
 Cflags: -I${includedir}/libzfs -I${includedir}/libspl
 Libs: -L${libdir} -lzfs_core
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c
index 5dc1482..e40f6f6 100644
--- a/lib/libzfs/libzfs_import.c
+++ b/lib/libzfs/libzfs_import.c
@@ -97,6 +97,8 @@ typedef struct pool_list {
 	name_entry_t		*names;
 } pool_list_t;
 
+#define	DEV_BYID_PATH	"/dev/disk/by-id/"
+
 static char *
 get_devid(const char *path)
 {
@@ -121,6 +123,40 @@ get_devid(const char *path)
 	return (ret);
 }
 
+/*
+ * Wait up to timeout_ms for udev to set up the device node.  The device is
+ * considered ready when the provided path have been verified to exist and
+ * it has been allowed to settle.  At this point the device the device can
+ * be accessed reliably.  Depending on the complexity of the udev rules thisi
+ * process could take several seconds.
+ */
+int
+zpool_label_disk_wait(char *path, int timeout_ms)
+{
+	int settle_ms = 50;
+	long sleep_ms = 10;
+	hrtime_t start, settle;
+	struct stat64 statbuf;
+
+	start = gethrtime();
+	settle = 0;
+
+	do {
+		errno = 0;
+		if ((stat64(path, &statbuf) == 0) && (errno == 0)) {
+			if (settle == 0)
+				settle = gethrtime();
+			else if (NSEC2MSEC(gethrtime() - settle) >= settle_ms)
+				return (0);
+		} else if (errno != ENOENT) {
+			return (errno);
+		}
+
+		usleep(sleep_ms * MILLISEC);
+	} while (NSEC2MSEC(gethrtime() - start) < timeout_ms);
+
+	return (ENODEV);
+}
 
 /*
  * Go through and fix up any path and/or devid information for the given vdev
@@ -162,7 +198,6 @@ fix_paths(nvlist_t *nv, name_entry_t *names)
 	best = NULL;
 	for (ne = names; ne != NULL; ne = ne->ne_next) {
 		if (ne->ne_guid == guid) {
-
 			if (path == NULL) {
 				best = ne;
 				break;
@@ -352,6 +387,118 @@ add_config(libzfs_handle_t *hdl, pool_list_t *pl, const char *path,
 	return (0);
 }
 
+#ifdef HAVE_LIBBLKID
+static int
+add_path(libzfs_handle_t *hdl, pool_list_t *pools, uint64_t pool_guid,
+    uint64_t vdev_guid, const char *path, int order)
+{
+	nvlist_t *label;
+	uint64_t guid;
+	int error, fd, num_labels;
+
+	fd = open64(path, O_RDONLY);
+	if (fd < 0)
+		return (errno);
+
+	error = zpool_read_label(fd, &label, &num_labels);
+	close(fd);
+
+	if (error || label == NULL)
+		return (ENOENT);
+
+	error = nvlist_lookup_uint64(label, ZPOOL_CONFIG_POOL_GUID, &guid);
+	if (error || guid != pool_guid) {
+		nvlist_free(label);
+		return (EINVAL);
+	}
+
+	error = nvlist_lookup_uint64(label, ZPOOL_CONFIG_GUID, &guid);
+	if (error || guid != vdev_guid) {
+		nvlist_free(label);
+		return (EINVAL);
+	}
+
+	error = add_config(hdl, pools, path, order, num_labels, label);
+
+	return (error);
+}
+
+static int
+add_configs_from_label_impl(libzfs_handle_t *hdl, pool_list_t *pools,
+    nvlist_t *nvroot, uint64_t pool_guid, uint64_t vdev_guid)
+{
+	char udevpath[MAXPATHLEN];
+	char *path;
+	nvlist_t **child;
+	uint_t c, children;
+	uint64_t guid;
+	int error;
+
+	if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
+	    &child, &children) == 0) {
+		for (c = 0; c < children; c++) {
+			error  = add_configs_from_label_impl(hdl, pools,
+			    child[c], pool_guid, vdev_guid);
+			if (error)
+				return (error);
+		}
+		return (0);
+	}
+
+	if (nvroot == NULL)
+		return (0);
+
+	error = nvlist_lookup_uint64(nvroot, ZPOOL_CONFIG_GUID, &guid);
+	if ((error != 0) || (guid != vdev_guid))
+		return (0);
+
+	error = nvlist_lookup_string(nvroot, ZPOOL_CONFIG_PATH, &path);
+	if (error == 0)
+		(void) add_path(hdl, pools, pool_guid, vdev_guid, path, 0);
+
+	error = nvlist_lookup_string(nvroot, ZPOOL_CONFIG_DEVID, &path);
+	if (error == 0) {
+		sprintf(udevpath, "%s%s", DEV_BYID_PATH, path);
+		(void) add_path(hdl, pools, pool_guid, vdev_guid, udevpath, 1);
+	}
+
+	return (0);
+}
+
+/*
+ * Given a disk label call add_config() for all known paths to the device
+ * as described by the label itself.  The paths are added in the following
+ * priority order: 'path', 'devid', 'devnode'.  As these alternate paths are
+ * added the labels are verified to make sure they refer to the same device.
+ */
+static int
+add_configs_from_label(libzfs_handle_t *hdl, pool_list_t *pools,
+    char *devname, int num_labels, nvlist_t *label)
+{
+	nvlist_t *nvroot;
+	uint64_t pool_guid;
+	uint64_t vdev_guid;
+	int error;
+
+	if (nvlist_lookup_nvlist(label, ZPOOL_CONFIG_VDEV_TREE, &nvroot) ||
+	    nvlist_lookup_uint64(label, ZPOOL_CONFIG_POOL_GUID, &pool_guid) ||
+	    nvlist_lookup_uint64(label, ZPOOL_CONFIG_GUID, &vdev_guid))
+		return (ENOENT);
+
+	/* Allow devlinks to stabilize so all paths are available. */
+	zpool_label_disk_wait(devname, DISK_LABEL_WAIT);
+
+	/* Add alternate paths as described by the label vdev_tree. */
+	(void) add_configs_from_label_impl(hdl, pools, nvroot,
+	    pool_guid, vdev_guid);
+
+	/* Add the device node /dev/sdX path as a last resort. */
+	error = add_config(hdl, pools, devname, 100, num_labels, label);
+
+	return (error);
+}
+#endif /* HAVE_LIBBLKID */
+
 /*
  * Returns true if the named pool matches the given GUID.
  */
@@ -975,9 +1122,7 @@ zpool_find_import_blkid(libzfs_handle_t *hdl, pool_list_t *pools)
 	blkid_cache cache;
 	blkid_dev_iterate iter;
 	blkid_dev dev;
-	const char *devname;
-	nvlist_t *config;
-	int fd, err, num_labels;
+	int err;
 
 	err = blkid_get_cache(&cache, NULL);
 	if (err != 0) {
@@ -1008,25 +1153,23 @@ zpool_find_import_blkid(libzfs_handle_t *hdl, pool_list_t *pools)
 	}
 
 	while (blkid_dev_next(iter, &dev) == 0) {
-		devname = blkid_dev_devname(dev);
+		nvlist_t *label;
+		char *devname;
+		int fd, num_labels;
+
+		devname = (char *) blkid_dev_devname(dev);
 		if ((fd = open64(devname, O_RDONLY)) < 0)
 			continue;
 
-		err = zpool_read_label(fd, &config, &num_labels);
+		err = zpool_read_label(fd, &label, &num_labels);
 		(void) close(fd);
 
-		if (err != 0) {
-			(void) no_memory(hdl);
-			goto err_blkid3;
-		}
+		if (err || label == NULL)
+			continue;
 
-		if (config != NULL) {
-			err = add_config(hdl, pools, devname, 0,
-			    num_labels, config);
-			if (err != 0)
-				goto err_blkid3;
-		}
+		add_configs_from_label(hdl, pools, devname, num_labels, label);
 	}
+	err = 0;
 
 err_blkid3:
 	blkid_dev_iterate_end(iter);
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index 456015e..a194b8b 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -4095,29 +4095,6 @@ find_start_block(nvlist_t *config)
 }
 
 int
-zpool_label_disk_wait(char *path, int timeout)
-{
-	struct stat64 statbuf;
-	int i;
-
-	/*
-	 * Wait timeout miliseconds for a newly created device to be available
-	 * from the given path.  There is a small window when a /dev/ device
-	 * will exist and the udev link will not, so we must wait for the
-	 * symlink.  Depending on the udev rules this may take a few seconds.
-	 */
-	for (i = 0; i < timeout; i++) {
-		usleep(1000);
-
-		errno = 0;
-		if ((stat64(path, &statbuf) == 0) && (errno == 0))
-			return (0);
-	}
-
-	return (ENOENT);
-}
-
-int
 zpool_label_disk_check(char *path)
 {
 	struct dk_gpt *vtoc;
@@ -4143,6 +4120,32 @@ zpool_label_disk_check(char *path)
 }
 
 /*
+ * Generate a unique partition name for the ZFS member.  Partitions must
+ * have unique names to ensure udev will be able to create symlinks under
+ * /dev/disk/by-partlabel/ for all pool members.  The partition names are
+ * of the form <pool>-<unique-id>.
+ */
+static void
+zpool_label_name(char *label_name, int label_size)
+{
+	uint64_t id = 0;
+	int fd;
+
+	fd = open("/dev/urandom", O_RDONLY);
+	if (fd > 0) {
+		if (read(fd, &id, sizeof (id)) != sizeof (id))
+			id = 0;
+
+		close(fd);
+	}
+
+	if (id == 0)
+		id = (((uint64_t)rand()) << 32) | (uint64_t)rand();
+
+	snprintf(label_name, label_size, "zfs-%016llx", (u_longlong_t) id);
+}
+
+/*
  * Label an individual disk.  The name provided is the short name,
  * stripped of any leading /dev path.
  */
@@ -4232,7 +4235,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
 	 * can get, in the absence of V_OTHER.
 	 */
 	vtoc->efi_parts[0].p_tag = V_USR;
-	(void) strcpy(vtoc->efi_parts[0].p_name, "zfs");
+	zpool_label_name(vtoc->efi_parts[0].p_name, EFI_PART_NAME_LEN);
 
 	vtoc->efi_parts[8].p_start = slice_size + start_block;
 	vtoc->efi_parts[8].p_size = resv;
@@ -4256,12 +4259,11 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
 	(void) close(fd);
 	efi_free(vtoc);
 
-	/* Wait for the first expected partition to appear. */
-
 	(void) snprintf(path, sizeof (path), "%s/%s", DISK_ROOT, name);
 	(void) zfs_append_partition(path, MAXPATHLEN);
 
-	rval = zpool_label_disk_wait(path, 3000);
+	/* Wait to udev to signal use the device has settled. */
+	rval = zpool_label_disk_wait(path, DISK_LABEL_WAIT);
 	if (rval) {
 		zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "failed to "
 		    "detect device partitions on '%s': %d"), path, rval);
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
index ebf0e8b..9b51ecc 100644
--- a/module/zfs/vdev_disk.c
+++ b/module/zfs/vdev_disk.c
@@ -139,7 +139,7 @@ vdev_elevator_switch(vdev_t *v, char *elevator)
 		return (0);
 
 	/* Leave existing scheduler when set to "none" */
-	if (strncmp(elevator, "none", 4) && (strlen(elevator) == 4) == 0)
+	if ((strncmp(elevator, "none", 4) == 0) && (strlen(elevator) == 4))
 		return (0);
 
 #ifdef HAVE_ELEVATOR_CHANGE
@@ -244,12 +244,12 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize,
 {
 	struct block_device *bdev = ERR_PTR(-ENXIO);
 	vdev_disk_t *vd;
-	int mode, block_size;
+	int count = 0, mode, block_size;
 
 	/* Must have a pathname and it must be absolute. */
 	if (v->vdev_path == NULL || v->vdev_path[0] != '/') {
 		v->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
-		return (EINVAL);
+		return (SET_ERROR(EINVAL));
 	}
 
 	/*
@@ -264,7 +264,7 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize,
 
 	vd = kmem_zalloc(sizeof (vdev_disk_t), KM_SLEEP);
 	if (vd == NULL)
-		return (ENOMEM);
+		return (SET_ERROR(ENOMEM));
 
 	/*
 	 * Devices are always opened by the path provided at configuration
@@ -279,16 +279,35 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize,
 	 * /dev/[hd]d devices which may be reordered due to probing order.
 	 * Devices in the wrong locations will be detected by the higher
 	 * level vdev validation.
+	 *
+	 * The specified paths may be briefly removed and recreated in
+	 * response to udev events.  This should be exceptionally unlikely
+	 * because the zpool command makes every effort to verify these paths
+	 * have already settled prior to reaching this point.  Therefore,
+	 * a ENOENT failure at this point is highly likely to be transient
+	 * and it is reasonable to sleep and retry before giving up.  In
+	 * practice delays have been observed to be on the order of 100ms.
 	 */
 	mode = spa_mode(v->vdev_spa);
 	if (v->vdev_wholedisk && v->vdev_expanding)
 		bdev = vdev_disk_rrpart(v->vdev_path, mode, vd);
-	if (IS_ERR(bdev))
+
+	while (IS_ERR(bdev) && count < 50) {
 		bdev = vdev_bdev_open(v->vdev_path,
 		    vdev_bdev_mode(mode), zfs_vdev_holder);
+		if (unlikely(PTR_ERR(bdev) == -ENOENT)) {
+			msleep(10);
+			count++;
+		} else if (IS_ERR(bdev)) {
+			break;
+		}
+	}
+
 	if (IS_ERR(bdev)) {
+		dprintf("failed open v->vdev_path=%s, error=%d count=%d\n",
+		    v->vdev_path, -PTR_ERR(bdev), count);
 		kmem_free(vd, sizeof (vdev_disk_t));
-		return (-PTR_ERR(bdev));
+		return (SET_ERROR(-PTR_ERR(bdev)));
 	}
 
 	v->vdev_tsd = vd;
diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c
index 7e9c473..c7b7180 100644
--- a/module/zfs/zfs_fm.c
+++ b/module/zfs/zfs_fm.c
@@ -457,7 +457,8 @@ update_histogram(uint64_t value_arg, uint16_t *hist, uint32_t *count)
 	/* We store the bits in big-endian (largest-first) order */
 	for (i = 0; i < 64; i++) {
 		if (value & (1ull << i)) {
-			hist[63 - i]++;
+			if (hist[63 - i] < UINT16_MAX)
+				hist[63 - i]++;
 			++bits;
 		}
 	}
@@ -615,7 +616,6 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info,
 	if (badbuf == NULL || goodbuf == NULL)
 		return (eip);
 
-	ASSERT3U(nui64s, <=, UINT16_MAX);
 	ASSERT3U(size, ==, nui64s * sizeof (uint64_t));
 	ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
 	ASSERT3U(size, <=, UINT32_MAX);
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
index 12d2750..745f713 100644
--- a/module/zfs/zfs_ioctl.c
+++ b/module/zfs/zfs_ioctl.c
@@ -5817,8 +5817,11 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
 	}
 
 
-	if (error == 0 && !(flag & FKIOCTL))
+	if (error == 0 && !(flag & FKIOCTL)) {
+		cookie = spl_fstrans_mark();
 		error = vec->zvec_secpolicy(zc, innvl, CRED());
+		spl_fstrans_unmark(cookie);
+	}
 
 	if (error != 0)
 		goto out;
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 944f0ad..43c3a3c 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -332,11 +332,11 @@ update_pages(struct inode *ip, int64_t start, int len,
 	int64_t	off;
 	void *pb;
 
-	off = start & (PAGE_CACHE_SIZE-1);
-	for (start &= PAGE_CACHE_MASK; len > 0; start += PAGE_CACHE_SIZE) {
-		nbytes = MIN(PAGE_CACHE_SIZE - off, len);
+	off = start & (PAGE_SIZE-1);
+	for (start &= PAGE_MASK; len > 0; start += PAGE_SIZE) {
+		nbytes = MIN(PAGE_SIZE - off, len);
 
-		pp = find_lock_page(mp, start >> PAGE_CACHE_SHIFT);
+		pp = find_lock_page(mp, start >> PAGE_SHIFT);
 		if (pp) {
 			if (mapping_writably_mapped(mp))
 				flush_dcache_page(pp);
@@ -353,7 +353,7 @@ update_pages(struct inode *ip, int64_t start, int len,
 			SetPageUptodate(pp);
 			ClearPageError(pp);
 			unlock_page(pp);
-			page_cache_release(pp);
+			put_page(pp);
 		}
 
 		len -= nbytes;
@@ -384,11 +384,11 @@ mappedread(struct inode *ip, int nbytes, uio_t *uio)
 	void *pb;
 
 	start = uio->uio_loffset;
-	off = start & (PAGE_CACHE_SIZE-1);
-	for (start &= PAGE_CACHE_MASK; len > 0; start += PAGE_CACHE_SIZE) {
-		bytes = MIN(PAGE_CACHE_SIZE - off, len);
+	off = start & (PAGE_SIZE-1);
+	for (start &= PAGE_MASK; len > 0; start += PAGE_SIZE) {
+		bytes = MIN(PAGE_SIZE - off, len);
 
-		pp = find_lock_page(mp, start >> PAGE_CACHE_SHIFT);
+		pp = find_lock_page(mp, start >> PAGE_SHIFT);
 		if (pp) {
 			ASSERT(PageUptodate(pp));
 
@@ -401,7 +401,7 @@ mappedread(struct inode *ip, int nbytes, uio_t *uio)
 
 			mark_page_accessed(pp);
 			unlock_page(pp);
-			page_cache_release(pp);
+			put_page(pp);
 		} else {
 			error = dmu_read_uio_dbuf(sa_get_db(zp->z_sa_hdl),
 			    uio, bytes);
@@ -3894,8 +3894,8 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc)
 
 	pgoff = page_offset(pp);	/* Page byte-offset in file */
 	offset = i_size_read(ip);	/* File length in bytes */
-	pglen = MIN(PAGE_CACHE_SIZE,	/* Page length in bytes */
-	    P2ROUNDUP(offset, PAGE_CACHE_SIZE)-pgoff);
+	pglen = MIN(PAGE_SIZE,		/* Page length in bytes */
+	    P2ROUNDUP(offset, PAGE_SIZE)-pgoff);
 
 	/* Page is beyond end of file */
 	if (pgoff >= offset) {
@@ -4006,7 +4006,7 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc)
 	}
 
 	va = kmap(pp);
-	ASSERT3U(pglen, <=, PAGE_CACHE_SIZE);
+	ASSERT3U(pglen, <=, PAGE_SIZE);
 	dmu_write(zsb->z_os, zp->z_id, pgoff, pglen, va, tx);
 	kunmap(pp);
 
@@ -4181,7 +4181,7 @@ zfs_fillpage(struct inode *ip, struct page *pl[], int nr_pages)
 	int err;
 
 	os = zsb->z_os;
-	io_len = nr_pages << PAGE_CACHE_SHIFT;
+	io_len = nr_pages << PAGE_SHIFT;
 	i_size = i_size_read(ip);
 	io_off = page_offset(pl[0]);
 
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
index 860354b..1742a51 100644
--- a/module/zfs/zfs_znode.c
+++ b/module/zfs/zfs_znode.c
@@ -1510,13 +1510,12 @@ zfs_zero_partial_page(znode_t *zp, uint64_t start, uint64_t len)
 	int64_t	off;
 	void *pb;
 
-	ASSERT((start & PAGE_CACHE_MASK) ==
-	    ((start + len - 1) & PAGE_CACHE_MASK));
+	ASSERT((start & PAGE_MASK) == ((start + len - 1) & PAGE_MASK));
 
-	off = start & (PAGE_CACHE_SIZE - 1);
-	start &= PAGE_CACHE_MASK;
+	off = start & (PAGE_SIZE - 1);
+	start &= PAGE_MASK;
 
-	pp = find_lock_page(mp, start >> PAGE_CACHE_SHIFT);
+	pp = find_lock_page(mp, start >> PAGE_SHIFT);
 	if (pp) {
 		if (mapping_writably_mapped(mp))
 			flush_dcache_page(pp);
@@ -1532,7 +1531,7 @@ zfs_zero_partial_page(znode_t *zp, uint64_t start, uint64_t len)
 		SetPageUptodate(pp);
 		ClearPageError(pp);
 		unlock_page(pp);
-		page_cache_release(pp);
+		put_page(pp);
 	}
 }
 
@@ -1579,14 +1578,14 @@ zfs_free_range(znode_t *zp, uint64_t off, uint64_t len)
 		loff_t first_page_offset, last_page_offset;
 
 		/* first possible full page in hole */
-		first_page = (off + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+		first_page = (off + PAGE_SIZE - 1) >> PAGE_SHIFT;
 		/* last page of hole */
-		last_page = (off + len) >> PAGE_CACHE_SHIFT;
+		last_page = (off + len) >> PAGE_SHIFT;
 
 		/* offset of first_page */
-		first_page_offset = first_page << PAGE_CACHE_SHIFT;
+		first_page_offset = first_page << PAGE_SHIFT;
 		/* offset of last_page */
-		last_page_offset = last_page << PAGE_CACHE_SHIFT;
+		last_page_offset = last_page << PAGE_SHIFT;
 
 		/* truncate whole pages */
 		if (last_page_offset > first_page_offset) {
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
index a23bc7d..5c430c7 100644
--- a/module/zfs/zpl_file.c
+++ b/module/zfs/zpl_file.c
@@ -24,6 +24,9 @@
  */
 
 
+#ifdef CONFIG_COMPAT
+#include <linux/compat.h>
+#endif
 #include <sys/dmu_objset.h>
 #include <sys/zfs_vfsops.h>
 #include <sys/zfs_vnops.h>
@@ -798,7 +801,17 @@ zpl_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 static long
 zpl_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
-	return (zpl_ioctl(filp, cmd, arg));
+	switch (cmd) {
+	case FS_IOC32_GETFLAGS:
+		cmd = FS_IOC_GETFLAGS;
+		break;
+	case FS_IOC32_SETFLAGS:
+		cmd = FS_IOC_SETFLAGS;
+		break;
+	default:
+		return (-ENOTTY);
+	}
+	return (zpl_ioctl(filp, cmd, (unsigned long)compat_ptr(arg)));
 }
 #endif /* CONFIG_COMPAT */
 
diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
index 6a1acd7..1a15d4d 100644
--- a/module/zfs/zpl_xattr.c
+++ b/module/zfs/zpl_xattr.c
@@ -688,10 +688,11 @@ __zpl_xattr_user_get(struct inode *ip, const char *name,
 {
 	char *xattr_name;
 	int error;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") == 0)
 		return (-EINVAL);
-
+#endif
 	if (!(ITOZSB(ip)->z_flags & ZSB_XATTR))
 		return (-EOPNOTSUPP);
 
@@ -709,10 +710,11 @@ __zpl_xattr_user_set(struct inode *ip, const char *name,
 {
 	char *xattr_name;
 	int error;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") == 0)
 		return (-EINVAL);
-
+#endif
 	if (!(ITOZSB(ip)->z_flags & ZSB_XATTR))
 		return (-EOPNOTSUPP);
 
@@ -758,10 +760,11 @@ __zpl_xattr_trusted_get(struct inode *ip, const char *name,
 
 	if (!capable(CAP_SYS_ADMIN))
 		return (-EACCES);
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") == 0)
 		return (-EINVAL);
-
+#endif
 	xattr_name = kmem_asprintf("%s%s", XATTR_TRUSTED_PREFIX, name);
 	error = zpl_xattr_get(ip, xattr_name, value, size);
 	strfree(xattr_name);
@@ -779,10 +782,11 @@ __zpl_xattr_trusted_set(struct inode *ip, const char *name,
 
 	if (!capable(CAP_SYS_ADMIN))
 		return (-EACCES);
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") == 0)
 		return (-EINVAL);
-
+#endif
 	xattr_name = kmem_asprintf("%s%s", XATTR_TRUSTED_PREFIX, name);
 	error = zpl_xattr_set(ip, xattr_name, value, size, flags);
 	strfree(xattr_name);
@@ -825,10 +829,11 @@ __zpl_xattr_security_get(struct inode *ip, const char *name,
 {
 	char *xattr_name;
 	int error;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") == 0)
 		return (-EINVAL);
-
+#endif
 	xattr_name = kmem_asprintf("%s%s", XATTR_SECURITY_PREFIX, name);
 	error = zpl_xattr_get(ip, xattr_name, value, size);
 	strfree(xattr_name);
@@ -843,10 +848,11 @@ __zpl_xattr_security_set(struct inode *ip, const char *name,
 {
 	char *xattr_name;
 	int error;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") == 0)
 		return (-EINVAL);
-
+#endif
 	xattr_name = kmem_asprintf("%s%s", XATTR_SECURITY_PREFIX, name);
 	error = zpl_xattr_set(ip, xattr_name, value, size, flags);
 	strfree(xattr_name);
@@ -969,7 +975,7 @@ zpl_set_acl(struct inode *ip, int type, struct posix_acl *acl)
 		break;
 
 	case ACL_TYPE_DEFAULT:
-		name = XATTR_NAME_POSIX_ACL_ACCESS;
+		name = XATTR_NAME_POSIX_ACL_DEFAULT;
 		if (!S_ISDIR(ip->i_mode))
 			return (acl ? -EACCES : 0);
 		break;
@@ -1212,10 +1218,11 @@ __zpl_xattr_acl_get_access(struct inode *ip, const char *name,
 	struct posix_acl *acl;
 	int type = ACL_TYPE_ACCESS;
 	int error;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") != 0)
 		return (-EINVAL);
-
+#endif
 	if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
 		return (-EOPNOTSUPP);
 
@@ -1239,10 +1246,11 @@ __zpl_xattr_acl_get_default(struct inode *ip, const char *name,
 	struct posix_acl *acl;
 	int type = ACL_TYPE_DEFAULT;
 	int error;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") != 0)
 		return (-EINVAL);
-
+#endif
 	if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
 		return (-EOPNOTSUPP);
 
@@ -1266,10 +1274,11 @@ __zpl_xattr_acl_set_access(struct inode *ip, const char *name,
 	struct posix_acl *acl;
 	int type = ACL_TYPE_ACCESS;
 	int error = 0;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") != 0)
 		return (-EINVAL);
-
+#endif
 	if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
 		return (-EOPNOTSUPP);
 
@@ -1305,10 +1314,11 @@ __zpl_xattr_acl_set_default(struct inode *ip, const char *name,
 	struct posix_acl *acl;
 	int type = ACL_TYPE_DEFAULT;
 	int error = 0;
-
+	/* xattr_resolve_name will do this for us if this is defined */
+#ifndef HAVE_XATTR_HANDLER_NAME
 	if (strcmp(name, "") != 0)
 		return (-EINVAL);
-
+#endif
 	if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
 		return (-EOPNOTSUPP);
 
@@ -1339,10 +1349,17 @@ ZPL_XATTR_SET_WRAPPER(zpl_xattr_acl_set_default);
 
 /*
  * ACL access xattr namespace handlers.
+ *
+ * Use .name instead of .prefix when available. xattr_resolve_name will match
+ * whole name and reject anything that has .name only as prefix.
  */
 xattr_handler_t zpl_xattr_acl_access_handler =
 {
+#ifdef HAVE_XATTR_HANDLER_NAME
+	.name	= XATTR_NAME_POSIX_ACL_ACCESS,
+#else
 	.prefix	= XATTR_NAME_POSIX_ACL_ACCESS,
+#endif
 	.list	= zpl_xattr_acl_list_access,
 	.get	= zpl_xattr_acl_get_access,
 	.set	= zpl_xattr_acl_set_access,
@@ -1355,10 +1372,17 @@ xattr_handler_t zpl_xattr_acl_access_handler =
 
 /*
  * ACL default xattr namespace handlers.
+ *
+ * Use .name instead of .prefix when available. xattr_resolve_name will match
+ * whole name and reject anything that has .name only as prefix.
  */
 xattr_handler_t zpl_xattr_acl_default_handler =
 {
+#ifdef HAVE_XATTR_HANDLER_NAME
+	.name	= XATTR_NAME_POSIX_ACL_DEFAULT,
+#else
 	.prefix	= XATTR_NAME_POSIX_ACL_DEFAULT,
+#endif
 	.list	= zpl_xattr_acl_list_default,
 	.get	= zpl_xattr_acl_get_default,
 	.set	= zpl_xattr_acl_set_default,
diff --git a/rpm/generic/zfs-kmod.spec.in b/rpm/generic/zfs-kmod.spec.in
index 3840604..3db3a27 100644
--- a/rpm/generic/zfs-kmod.spec.in
+++ b/rpm/generic/zfs-kmod.spec.in
@@ -186,6 +186,16 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Thu May 12 2016 Ned Bass <bass6 at llnl.gov> - 0.6.5.7-1
+- Fix user namespaces uid/gid mapping zfsonlinux/zfs#4177
+- Fix ZPL miswrite of default POSIX ACL zfsonlinux/zfs#4520
+- Linux 4.5 and 4.6 compatibility zfsonlinux/zfs#4537 zfsonlinux/zfs#4489
+- Ensure /dev/disk/by-partlabel gets correctly populated zfsonlinux/zfs#4517
+- Utilities now work reliably with newly created partitions zfsonlinux/zfs#3708
+- Import now reliably uses device names stored in label zfsonlinux/zfs#3043
+- Fix possible deadlock in zfs_secpolicy_write_perms ioctl zfsonlinux/zfs#4554
+- Fix inverted logic on none elevator comparison zfsonlinux/zfs#4507
+- Add 32 bit FS_IOC32_{GET|SET}FLAGS compat ioctls for PPC zfsonlinux/zfs#4477
 * Tue Mar 22 2016 Ned Bass <bass6 at llnl.gov> - 0.6.5.6-1
 - Remove artificial architecture restrictions in packaging
 - Add support for s390[x] zfsonlinux/zfs#4425
diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in
index 55289df..f62cc0e 100644
--- a/rpm/generic/zfs.spec.in
+++ b/rpm/generic/zfs.spec.in
@@ -327,6 +327,16 @@ exit 0
 %endif
 
 %changelog
+* Thu May 12 2016 Ned Bass <bass6 at llnl.gov> - 0.6.5.7-1
+- Fix user namespaces uid/gid mapping zfsonlinux/zfs#4177
+- Fix ZPL miswrite of default POSIX ACL zfsonlinux/zfs#4520
+- Linux 4.5 and 4.6 compatibility zfsonlinux/zfs#4537 zfsonlinux/zfs#4489
+- Ensure /dev/disk/by-partlabel gets correctly populated zfsonlinux/zfs#4517
+- Utilities now work reliably with newly created partitions zfsonlinux/zfs#3708
+- Import now reliably uses device names stored in label zfsonlinux/zfs#3043
+- Fix possible deadlock in zfs_secpolicy_write_perms ioctl zfsonlinux/zfs#4554
+- Fix inverted logic on none elevator comparison zfsonlinux/zfs#4507
+- Add 32 bit FS_IOC32_{GET|SET}FLAGS compat ioctls for PPC zfsonlinux/zfs#4477
 * Tue Mar 22 2016 Ned Bass <bass6 at llnl.gov> - 0.6.5.6-1
 - Remove artificial architecture restrictions in packaging
 - Add support for s390[x] zfsonlinux/zfs#4425
diff --git a/rpm/redhat/zfs.spec.in b/rpm/redhat/zfs.spec.in
index 55289df..f62cc0e 100644
--- a/rpm/redhat/zfs.spec.in
+++ b/rpm/redhat/zfs.spec.in
@@ -327,6 +327,16 @@ exit 0
 %endif
 
 %changelog
+* Thu May 12 2016 Ned Bass <bass6 at llnl.gov> - 0.6.5.7-1
+- Fix user namespaces uid/gid mapping zfsonlinux/zfs#4177
+- Fix ZPL miswrite of default POSIX ACL zfsonlinux/zfs#4520
+- Linux 4.5 and 4.6 compatibility zfsonlinux/zfs#4537 zfsonlinux/zfs#4489
+- Ensure /dev/disk/by-partlabel gets correctly populated zfsonlinux/zfs#4517
+- Utilities now work reliably with newly created partitions zfsonlinux/zfs#3708
+- Import now reliably uses device names stored in label zfsonlinux/zfs#3043
+- Fix possible deadlock in zfs_secpolicy_write_perms ioctl zfsonlinux/zfs#4554
+- Fix inverted logic on none elevator comparison zfsonlinux/zfs#4507
+- Add 32 bit FS_IOC32_{GET|SET}FLAGS compat ioctls for PPC zfsonlinux/zfs#4477
 * Tue Mar 22 2016 Ned Bass <bass6 at llnl.gov> - 0.6.5.6-1
 - Remove artificial architecture restrictions in packaging
 - Add support for s390[x] zfsonlinux/zfs#4425
diff --git a/zfs_config.h.in b/zfs_config.h.in
index 0fd47c3..f94b67f 100644
--- a/zfs_config.h.in
+++ b/zfs_config.h.in
@@ -345,6 +345,9 @@
 /* xattr_handler->get() wants inode */
 #undef HAVE_XATTR_GET_INODE
 
+/* xattr_handler has name */
+#undef HAVE_XATTR_HANDLER_NAME
+
 /* xattr_handler->list() wants dentry */
 #undef HAVE_XATTR_LIST_DENTRY
 

-- 
OpenZFS on Linux



More information about the Pkg-zfsonlinux-devel mailing list