Commit 8e543f2f authored by Colin Ian King's avatar Colin Ian King Committed by Luis Henriques

UBUNTU: SAUCE: (noup) Update zfs to 0.6.5.6-0ubuntu15

BugLink: http://bugs.launchpad.net/bugs/1636517

Xenial kernel commit 193fb6a2c94fab8eb8ce70a5da4d21c7d4023bee
("block_dev: Support checking inode permissions in lookup_bdev()")
added a flags argument to block_dev which caused this breakage. Add
detection of 1 or 2 arg block_dev and add a zfs_block_dev shim to
abstract these differences away. Kudos to Fabian Grünbichler for
the original fix that this fix is based on.
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarTim Gardner <tim.gardner@canonical.com>
Acked-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 729c9d91
......@@ -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
......@@ -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)
])
])
])
......@@ -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 :
......
......@@ -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.
......
......@@ -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
/*
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment