[PATCH][SRU][XENIAL] UBUNTU: SAUCE: (noup) Update zfs to 0.6.5.6-0ubuntu15
Colin Ian King
colin.king at canonical.com
Fri Oct 28 14:21:04 UTC 2016
On 28/10/16 13:55, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> zfs/META | 2 +-
> zfs/config/kernel-lookup-bdev.m4 | 11 +
> zfs/configure | 412 ++++++++++++++++++++++++++++++++++++++
> zfs/contrib/initramfs/scripts/zfs | 7 +-
> zfs/include/linux/blkdev_compat.h | 12 +-
> zfs/module/zfs/zvol.c | 2 +-
> zfs/zfs_config.h.in | 3 +
> 7 files changed, 441 insertions(+), 8 deletions(-)
>
> diff --git a/zfs/META b/zfs/META
> index a0dbc97..94784ee 100644
> --- a/zfs/META
> +++ b/zfs/META
> @@ -2,7 +2,7 @@ Meta: 1
> Name: zfs
> Branch: 1.0
> Version: 0.6.5.6
> -Release: 0ubuntu10
> +Release: 0ubuntu15
> Release-Tags: relext
> License: CDDL
> Author: OpenZFS on Linux
> diff --git a/zfs/config/kernel-lookup-bdev.m4 b/zfs/config/kernel-lookup-bdev.m4
> index 245f95f..d8496e3 100644
> --- a/zfs/config/kernel-lookup-bdev.m4
> +++ b/zfs/config/kernel-lookup-bdev.m4
> @@ -13,5 +13,16 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_BDEV],
> AC_DEFINE(HAVE_LOOKUP_BDEV, 1, [lookup_bdev() is available])
> ], [
> AC_MSG_RESULT(no)
> + AC_MSG_CHECKING([whether lookup_bdev() is available and wants 2 args])
> + ZFS_LINUX_TRY_COMPILE_SYMBOL([
> + #include <linux/fs.h>
> + ], [
> + lookup_bdev(NULL, 0);
> + ], [lookup_bdev], [fs/block_dev.c], [
> + AC_MSG_RESULT(yes)
> + AC_DEFINE(HAVE_LOOKUP_BDEV_2ARGS, 1, [lookup_bdev() with 2 args is available])
> + ], [
> + AC_MSG_RESULT(no)
> + ])
> ])
> ])
> diff --git a/zfs/configure b/zfs/configure
> index b1e7c88..ebbae10 100755
> --- a/zfs/configure
> +++ b/zfs/configure
> @@ -15071,6 +15071,109 @@ fi
>
> { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> $as_echo "no" >&6; }
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lookup_bdev() is available and wants 2 args" >&5
> +$as_echo_n "checking whether lookup_bdev() is available and wants 2 args... " >&6; }
> +
> +
> +
> +cat confdefs.h - <<_ACEOF >conftest.c
> +
> +
> + #include <linux/fs.h>
> +
> +int
> +main (void)
> +{
> +
> + lookup_bdev(NULL, 0);
> +
> + ;
> + 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 :
> + rc=0
> +else
> + $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> + rc=1
> +
> +
> +fi
> + rm -Rf build
> +
> +
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else
> + if test "x$enable_linux_builtin" != xyes; then
> +
> + grep -q -E '[[:space:]]lookup_bdev[[:space:]]' \
> + $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
> + rc=$?
> + if test $rc -ne 0; then
> + export=0
> + for file in fs/block_dev.c; do
> + grep -q -E "EXPORT_SYMBOL.*(lookup_bdev)" \
> + "$LINUX/$file" 2>/dev/null
> + rc=$?
> + if test $rc -eq 0; then
> + export=1
> + break;
> + fi
> + done
> + if test $export -eq 0; then :
> + rc=1
> + else :
> + rc=0
> + fi
> + else :
> + rc=0
> + fi
> +
> + fi
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> +$as_echo "yes" >&6; }
> +
> +$as_echo "#define HAVE_LOOKUP_BDEV_2ARGS 1" >>confdefs.h
> +
> +
> + fi
> + fi
> +
>
> else
> if test "x$enable_linux_builtin" != xyes; then
> @@ -15103,6 +15206,109 @@ $as_echo "no" >&6; }
>
> { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> $as_echo "no" >&6; }
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lookup_bdev() is available and wants 2 args" >&5
> +$as_echo_n "checking whether lookup_bdev() is available and wants 2 args... " >&6; }
> +
> +
> +
> +cat confdefs.h - <<_ACEOF >conftest.c
> +
> +
> + #include <linux/fs.h>
> +
> +int
> +main (void)
> +{
> +
> + lookup_bdev(NULL, 0);
> +
> + ;
> + 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 :
> + rc=0
> +else
> + $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> + rc=1
> +
> +
> +fi
> + rm -Rf build
> +
> +
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else
> + if test "x$enable_linux_builtin" != xyes; then
> +
> + grep -q -E '[[:space:]]lookup_bdev[[:space:]]' \
> + $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
> + rc=$?
> + if test $rc -ne 0; then
> + export=0
> + for file in fs/block_dev.c; do
> + grep -q -E "EXPORT_SYMBOL.*(lookup_bdev)" \
> + "$LINUX/$file" 2>/dev/null
> + rc=$?
> + if test $rc -eq 0; then
> + export=1
> + break;
> + fi
> + done
> + if test $export -eq 0; then :
> + rc=1
> + else :
> + rc=0
> + fi
> + else :
> + rc=0
> + fi
> +
> + fi
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> +$as_echo "yes" >&6; }
> +
> +$as_echo "#define HAVE_LOOKUP_BDEV_2ARGS 1" >>confdefs.h
> +
> +
> + fi
> + fi
> +
>
> else :
>
> @@ -24122,6 +24328,109 @@ fi
>
> { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> $as_echo "no" >&6; }
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lookup_bdev() is available and wants 2 args" >&5
> +$as_echo_n "checking whether lookup_bdev() is available and wants 2 args... " >&6; }
> +
> +
> +
> +cat confdefs.h - <<_ACEOF >conftest.c
> +
> +
> + #include <linux/fs.h>
> +
> +int
> +main (void)
> +{
> +
> + lookup_bdev(NULL, 0);
> +
> + ;
> + 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 :
> + rc=0
> +else
> + $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> + rc=1
> +
> +
> +fi
> + rm -Rf build
> +
> +
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else
> + if test "x$enable_linux_builtin" != xyes; then
> +
> + grep -q -E '[[:space:]]lookup_bdev[[:space:]]' \
> + $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
> + rc=$?
> + if test $rc -ne 0; then
> + export=0
> + for file in fs/block_dev.c; do
> + grep -q -E "EXPORT_SYMBOL.*(lookup_bdev)" \
> + "$LINUX/$file" 2>/dev/null
> + rc=$?
> + if test $rc -eq 0; then
> + export=1
> + break;
> + fi
> + done
> + if test $export -eq 0; then :
> + rc=1
> + else :
> + rc=0
> + fi
> + else :
> + rc=0
> + fi
> +
> + fi
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> +$as_echo "yes" >&6; }
> +
> +$as_echo "#define HAVE_LOOKUP_BDEV_2ARGS 1" >>confdefs.h
> +
> +
> + fi
> + fi
> +
>
> else
> if test "x$enable_linux_builtin" != xyes; then
> @@ -24154,6 +24463,109 @@ $as_echo "no" >&6; }
>
> { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> $as_echo "no" >&6; }
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lookup_bdev() is available and wants 2 args" >&5
> +$as_echo_n "checking whether lookup_bdev() is available and wants 2 args... " >&6; }
> +
> +
> +
> +cat confdefs.h - <<_ACEOF >conftest.c
> +
> +
> + #include <linux/fs.h>
> +
> +int
> +main (void)
> +{
> +
> + lookup_bdev(NULL, 0);
> +
> + ;
> + 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 :
> + rc=0
> +else
> + $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> + rc=1
> +
> +
> +fi
> + rm -Rf build
> +
> +
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else
> + if test "x$enable_linux_builtin" != xyes; then
> +
> + grep -q -E '[[:space:]]lookup_bdev[[:space:]]' \
> + $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
> + rc=$?
> + if test $rc -ne 0; then
> + export=0
> + for file in fs/block_dev.c; do
> + grep -q -E "EXPORT_SYMBOL.*(lookup_bdev)" \
> + "$LINUX/$file" 2>/dev/null
> + rc=$?
> + if test $rc -eq 0; then
> + export=1
> + break;
> + fi
> + done
> + if test $export -eq 0; then :
> + rc=1
> + else :
> + rc=0
> + fi
> + else :
> + rc=0
> + fi
> +
> + fi
> + if test $rc -ne 0; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> + else :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> +$as_echo "yes" >&6; }
> +
> +$as_echo "#define HAVE_LOOKUP_BDEV_2ARGS 1" >>confdefs.h
> +
> +
> + fi
> + fi
> +
>
> else :
>
> diff --git a/zfs/contrib/initramfs/scripts/zfs b/zfs/contrib/initramfs/scripts/zfs
> index 6a78a46..250dc57 100644
> --- a/zfs/contrib/initramfs/scripts/zfs
> +++ b/zfs/contrib/initramfs/scripts/zfs
> @@ -288,9 +288,8 @@ load_module_initrd()
> wait_for_dev
> fi
>
> - # zpool import refuse to import without a valid mtab
> - [ ! -f /proc/mounts ] && mount proc /proc
> - [ ! -f /etc/mtab ] && cat /proc/mounts > /etc/mtab
> + # zpool import refuse to import without a valid /proc/self/mounts
> + [ ! -f /proc/self/mounts ] && mount proc /proc
>
> # Load the module
> load_module "zfs" || return 1
> @@ -919,7 +918,7 @@ mountroot()
> #
> # but the MOUNTPOINT prefix is preserved on descendent filesystem
> # after the pivot into the regular root, which later breaks things
> - # like `zfs mount -a` and the /etc/mtab refresh.
> + # like `zfs mount -a` and the /proc/self/mounts refresh.
> #
> # * Mount additional filesystems required
> # Such as /usr, /var, /usr/local etc.
> diff --git a/zfs/include/linux/blkdev_compat.h b/zfs/include/linux/blkdev_compat.h
> index 868b89c5..4b6423a 100644
> --- a/zfs/include/linux/blkdev_compat.h
> +++ b/zfs/include/linux/blkdev_compat.h
> @@ -236,9 +236,17 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags)
> * 2.6.27 API change
> * The function was exported for use, prior to this it existed by the
> * symbol was not exported.
> + *
> + * Ubuntu Xenial commit 193fb6a2c94fab8eb8ce70a5da4d21c7d4023bee
> + * ("UBUNTU: SAUCE: block_dev: Support checking inode permissions in lookup_bdev()")
> + * added in a mask parameter which we set as zero.
> */
> -#ifndef HAVE_LOOKUP_BDEV
> -#define lookup_bdev(path) ERR_PTR(-ENOTSUP)
> +#ifdef HAVE_LOOKUP_BDEV
> +#define zfs_lookup_bdev(path) lookup_bdev(path)
> +#elif defined(HAVE_LOOKUP_BDEV_2ARGS)
> +#define zfs_lookup_bdev(path) lookup_bdev(path, 0)
> +#else
> +#define zfs_lookup_bdev(path) ERR_PTR(-ENOTSUP)
> #endif
>
> /*
> diff --git a/zfs/module/zfs/zvol.c b/zfs/module/zfs/zvol.c
> index a7a79e6..816c123 100644
> --- a/zfs/module/zfs/zvol.c
> +++ b/zfs/module/zfs/zvol.c
> @@ -174,7 +174,7 @@ zvol_is_zvol(const char *device)
> struct block_device *bdev;
> unsigned int major;
>
> - bdev = lookup_bdev(device);
> + bdev = zfs_lookup_bdev(device);
> if (IS_ERR(bdev))
> return (B_FALSE);
>
> diff --git a/zfs/zfs_config.h.in b/zfs/zfs_config.h.in
> index a539e7c..86c5668 100644
> --- a/zfs/zfs_config.h.in
> +++ b/zfs/zfs_config.h.in
> @@ -222,6 +222,9 @@
> /* lookup_bdev() is available */
> #undef HAVE_LOOKUP_BDEV
>
> +/* lookup_bdev() with 2 args is available */
> +#undef HAVE_LOOKUP_BDEV_2ARGS
> +
> /* iops->lookup() passes nameidata */
> #undef HAVE_LOOKUP_NAMEIDATA
>
>
Bah, I forgot the bug link,
BugLink: http://bugs.launchpad.net/bugs/1636517 - want me to re-send?
More information about the kernel-team
mailing list