zfs, zfs.git: Update to 0.6.3
This commit is contained in:
parent
b5b8b5247a
commit
9e1ec18624
@ -1,43 +0,0 @@
|
|||||||
From 729210564a5325e190fc4fba22bf17bacf957ace Mon Sep 17 00:00:00 2001
|
|
||||||
From: Richard Yao <ryao@gentoo.org>
|
|
||||||
Date: Mon, 25 Nov 2013 12:21:21 -0500
|
|
||||||
Subject: [PATCH] Properly ignore bdi_setup_and_register return value
|
|
||||||
|
|
||||||
This broke compilation against Linux 3.13 and GCC 4.7.3.
|
|
||||||
|
|
||||||
Signed-off-by: Richard Yao <ryao@gentoo.org>
|
|
||||||
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
|
||||||
Closes #1906
|
|
||||||
---
|
|
||||||
config/kernel-bdi-setup-and-register.m4 | 5 ++++-
|
|
||||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/config/kernel-bdi-setup-and-register.m4 b/config/kernel-bdi-setup-and-register.m4
|
|
||||||
index 4196091..cb8ed67 100644
|
|
||||||
--- a/config/kernel-bdi-setup-and-register.m4
|
|
||||||
+++ b/config/kernel-bdi-setup-and-register.m4
|
|
||||||
@@ -1,12 +1,14 @@
|
|
||||||
dnl #
|
|
||||||
dnl # 2.6.34 API change
|
|
||||||
-dnl # The bdi_setup_and_register() helper function is avilable and
|
|
||||||
+dnl # The bdi_setup_and_register() helper function is available and
|
|
||||||
dnl # exported by the kernel. This is a trivial helper function but
|
|
||||||
dnl # using it significantly simplifies the code surrounding setting
|
|
||||||
dnl # up and tearing down the bdi structure.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER],
|
|
||||||
[AC_MSG_CHECKING([whether bdi_setup_and_register() is available])
|
|
||||||
+ tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
+ EXTRA_KCFLAGS="-Wno-unused-result"
|
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/backing-dev.h>
|
|
||||||
], [
|
|
||||||
@@ -18,4 +20,5 @@ AC_DEFUN([ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER],
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
+ EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
|
||||||
--
|
|
||||||
1.8.5.5
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
|||||||
{ stdenv, fetchurl, kernel, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
|
{ stdenv, fetchurl, kernel, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "zfs-0.6.2-${kernel.version}";
|
name = "zfs-0.6.3-${kernel.version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.2.tar.gz;
|
url = http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.3.tar.gz;
|
||||||
sha256 = "18b5f18k8mwb17r5ippsilmp1a2sqjw9fwn0z82159dkhsadg33b";
|
sha256 = "06rrip9fxn13x6qnyp6br68r9pcygb95lld25hnnj88m2vagvg19";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ./libblkid-1db7b9b.patch ./gcc-4.8.patch ./3.13-compat.patch ];
|
patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ];
|
||||||
|
|
||||||
buildInputs = [ spl perl autoconf automake libtool zlib libuuid coreutils ];
|
buildInputs = [ spl perl autoconf automake libtool zlib libuuid coreutils ];
|
||||||
|
|
||||||
@ -28,9 +28,12 @@ stdenv.mkDerivation {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = ''
|
configureFlags = ''
|
||||||
|
--disable-systemd
|
||||||
--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
|
--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
|
||||||
--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
|
--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
|
||||||
--with-spl=${spl}/libexec/spl
|
--with-spl=${spl}/libexec/spl
|
||||||
|
--with-dracutdir=$$out/lib/dracut
|
||||||
|
--with-udevdir=$$out/lib/udev
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
@ -1,114 +0,0 @@
|
|||||||
commit 0f62f3f9abc4bfa0bcafee9bfa3d55e91dcb371d
|
|
||||||
Author: Brian Behlendorf <behlendorf1@llnl.gov>
|
|
||||||
Date: Tue Jan 14 09:39:13 2014 -0800
|
|
||||||
|
|
||||||
Disable GCCs aggressive loop optimization
|
|
||||||
|
|
||||||
GCC >+ 4.8's aggressive loop optimization breaks some of the iterators
|
|
||||||
over the dn_blkptr[] pseudo-array in dnode_phys. Since dn_blkptr[] is
|
|
||||||
defined as a single-element array, GCC believes an iterator can only
|
|
||||||
access index 0 and will unroll the loop into a single iteration.
|
|
||||||
|
|
||||||
One way to resolve the issue would be to cast the array to a pointer
|
|
||||||
and fix all the iterators that might break. The only loop where it
|
|
||||||
is known to cause a problem is this loop in dmu_objset_write_ready():
|
|
||||||
|
|
||||||
for (i = 0; i < dnp->dn_nblkptr; i++)
|
|
||||||
bp->blk_fill += dnp->dn_blkptr[i].blk_fill;
|
|
||||||
|
|
||||||
In the common case where dn_nblkptr is 3, the loop is only executed a
|
|
||||||
single time and "i" is equal to 1 following the loop.
|
|
||||||
|
|
||||||
The specific breakage caused by this problem is that the blk_fill of
|
|
||||||
root block pointers wouldn't be set properly when more than one blkptr
|
|
||||||
is in use (when no indrect blocks are needed).
|
|
||||||
|
|
||||||
The simple reproducing sequence is:
|
|
||||||
|
|
||||||
zpool create tank /tank.img
|
|
||||||
zdb -ddddd tank 0
|
|
||||||
|
|
||||||
Notice that "fill=31", however, there are two L0 indirect blocks with
|
|
||||||
"F=31" and "F=5". The fill count should be 36 rather than 31. This
|
|
||||||
problem causes an assert to be hit in a simple "zdb tank" when built
|
|
||||||
with --enable-debug.
|
|
||||||
|
|
||||||
However, this approach was not taken because we need to be absolutely
|
|
||||||
sure we catch all instances of this unwanted optimization. Therefore,
|
|
||||||
the build system has been updated to detect if GCC supports the
|
|
||||||
aggressive loop optimization. If it does the optimization will be
|
|
||||||
explicitly disabled using the -fno-aggressive-loop-optimization option.
|
|
||||||
|
|
||||||
Original-fix-by: Tim Chase <tim@chase2k.com>
|
|
||||||
Signed-off-by: Tim Chase <tim@chase2k.com>
|
|
||||||
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
|
||||||
Closes #2010
|
|
||||||
Closes #2051
|
|
||||||
|
|
||||||
diff --git a/config/Rules.am b/config/Rules.am
|
|
||||||
index e3fa5b5..24f9426 100644
|
|
||||||
--- a/config/Rules.am
|
|
||||||
+++ b/config/Rules.am
|
|
||||||
@@ -1,8 +1,10 @@
|
|
||||||
DEFAULT_INCLUDES = -include ${top_builddir}/zfs_config.h
|
|
||||||
|
|
||||||
AM_LIBTOOLFLAGS = --silent
|
|
||||||
-AM_CFLAGS = -Wall -Wstrict-prototypes
|
|
||||||
-AM_CFLAGS += -fno-strict-aliasing ${NO_UNUSED_BUT_SET_VARIABLE} ${DEBUG_CFLAGS}
|
|
||||||
+AM_CFLAGS = ${DEBUG_CFLAGS} -Wall -Wstrict-prototypes
|
|
||||||
+AM_CFLAGS += ${NO_UNUSED_BUT_SET_VARIABLE}
|
|
||||||
+AM_CFLAGS += ${NO_AGGRESSIVE_LOOP_OPTIMIZATIONS}
|
|
||||||
+AM_CFLAGS += -fno-strict-aliasing
|
|
||||||
AM_CPPFLAGS = -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT
|
|
||||||
AM_CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64
|
|
||||||
AM_CPPFLAGS += -D_LARGEFILE64_SOURCE -DTEXT_DOMAIN=\"zfs-linux-user\"
|
|
||||||
diff --git a/config/always-no-aggressive-loop-optimizations.m4 b/config/always-no-aggressive-loop-optimizations.m4
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..8f2115a
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/config/always-no-aggressive-loop-optimizations.m4
|
|
||||||
@@ -0,0 +1,20 @@
|
|
||||||
+dnl #
|
|
||||||
+dnl # Check if gcc supports -fno-aggressive-loop-optimizations
|
|
||||||
+dnl #
|
|
||||||
+AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_NO_AGGRESSIVE_LOOP_OPTIMIZATIONS], [
|
|
||||||
+ AC_MSG_CHECKING([for -fno-aggressive-loop-optimizations support])
|
|
||||||
+
|
|
||||||
+ saved_flags="$CFLAGS"
|
|
||||||
+ CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations"
|
|
||||||
+
|
|
||||||
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([], [])], [
|
|
||||||
+ NO_AGGRESSIVE_LOOP_OPTIMIZATIONS=-fno-aggressive-loop-optimizations
|
|
||||||
+ AC_MSG_RESULT([yes])
|
|
||||||
+ ], [
|
|
||||||
+ NO_AGGRESSIVE_LOOP_OPTIMIZATIONS=
|
|
||||||
+ AC_MSG_RESULT([no])
|
|
||||||
+ ])
|
|
||||||
+
|
|
||||||
+ CFLAGS="$saved_flags"
|
|
||||||
+ AC_SUBST([NO_AGGRESSIVE_LOOP_OPTIMIZATIONS])
|
|
||||||
+])
|
|
||||||
diff --git a/config/kernel.m4 b/config/kernel.m4
|
|
||||||
index cbf0ca3..62a9b42 100644
|
|
||||||
--- a/config/kernel.m4
|
|
||||||
+++ b/config/kernel.m4
|
|
||||||
@@ -104,6 +104,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|
||||||
dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other
|
|
||||||
dnl # compiler options are added by the kernel build system.
|
|
||||||
KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
|
|
||||||
+ KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_AGGRESSIVE_LOOP_OPTIMIZATIONS"
|
|
||||||
KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
|
|
||||||
KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
|
|
||||||
|
|
||||||
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
|
|
||||||
index 005185b..477b916 100644
|
|
||||||
--- a/config/zfs-build.m4
|
|
||||||
+++ b/config/zfs-build.m4
|
|
||||||
@@ -62,6 +62,7 @@ AC_DEFUN([ZFS_AC_DEBUG_DMU_TX], [
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
|
||||||
ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
|
|
||||||
+ ZFS_AC_CONFIG_ALWAYS_NO_AGGRESSIVE_LOOP_OPTIMIZATIONS
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_CONFIG], [
|
|
@ -1,12 +1,12 @@
|
|||||||
{ stdenv, fetchgit, kernel, spl_git, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
|
{ stdenv, fetchgit, kernel, spl_git, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "zfs-0.6.3pre-${kernel.version}";
|
name = "zfs-0.6.3-${kernel.version}";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = git://github.com/zfsonlinux/zfs.git;
|
url = git://github.com/zfsonlinux/zfs.git;
|
||||||
rev = "de39ec11b885f97e6256324ee89eaf75af9852f6";
|
rev = "07dabd234dd51a1e5adc5bd21cddf5b5fdc70732";
|
||||||
sha256 = "02hrhka9hg0vn4z20x7xzwrkr340pv9qwvwj8phjdm5ln321jh33";
|
sha256 = "1yqsfdhyzh33aisfvwqd692n5kfgnlz7yjixd2gqn8vx9bv0dz0b";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ];
|
patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ];
|
||||||
@ -33,6 +33,8 @@ stdenv.mkDerivation {
|
|||||||
--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
|
--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
|
||||||
--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
|
--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
|
||||||
--with-spl=${spl_git}/libexec/spl
|
--with-spl=${spl_git}/libexec/spl
|
||||||
|
--with-dracutdir=$$out/lib/dracut
|
||||||
|
--with-udevdir=$$out/lib/udev
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
@ -1,118 +0,0 @@
|
|||||||
commit 1db7b9be75a225cedb3b7a60028ca5695e5b8346
|
|
||||||
Author: Richard Yao <ryao@gentoo.org>
|
|
||||||
Date: Wed Aug 28 16:17:47 2013 -0400
|
|
||||||
|
|
||||||
Fix libblkid support
|
|
||||||
|
|
||||||
libblkid support is dormant because the autotools check is broken and
|
|
||||||
liblkid identifies ZFS vdevs as "zfs_member", not "zfs". We fix that
|
|
||||||
with a few changes:
|
|
||||||
|
|
||||||
First, we fix the libblkid autotools check to do a few things:
|
|
||||||
|
|
||||||
1. Make a 64MB file, which is the minimum size ZFS permits.
|
|
||||||
2. Make 4 fake uberblock entries to make libblkid's check succeed.
|
|
||||||
3. Return 0 upon success to make autotools use the success case.
|
|
||||||
4. Include stdlib.h to avoid implicit declration of free().
|
|
||||||
5. Check for "zfs_member", not "zfs"
|
|
||||||
6. Make --with-blkid disable autotools check (avoids Gentoo sandbox violation)
|
|
||||||
7. Pass '-lblkid' correctly using LIBS not LDFLAGS.
|
|
||||||
|
|
||||||
Second, we change the libblkid support to scan for "zfs_member", not
|
|
||||||
"zfs".
|
|
||||||
|
|
||||||
This makes --with-blkid work on Gentoo.
|
|
||||||
|
|
||||||
Signed-off-by: Richard Yao <ryao@gentoo.org>
|
|
||||||
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
|
||||||
Issue #1751
|
|
||||||
|
|
||||||
diff --git a/config/user-libblkid.m4 b/config/user-libblkid.m4
|
|
||||||
index 276587f..2dd2623 100644
|
|
||||||
--- a/config/user-libblkid.m4
|
|
||||||
+++ b/config/user-libblkid.m4
|
|
||||||
@@ -22,26 +22,45 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
|
|
||||||
[with_blkid=check])
|
|
||||||
|
|
||||||
LIBBLKID=
|
|
||||||
- AS_IF([test "x$with_blkid" != xno],
|
|
||||||
+ AS_IF([test "x$with_blkid" = xyes],
|
|
||||||
+ [
|
|
||||||
+ AC_SUBST([LIBBLKID], ["-lblkid"])
|
|
||||||
+ AC_DEFINE([HAVE_LIBBLKID], 1,
|
|
||||||
+ [Define if you have libblkid])
|
|
||||||
+ ])
|
|
||||||
+
|
|
||||||
+ AS_IF([test "x$with_blkid" = xcheck],
|
|
||||||
[
|
|
||||||
AC_CHECK_LIB([blkid], [blkid_get_cache],
|
|
||||||
[
|
|
||||||
AC_MSG_CHECKING([for blkid zfs support])
|
|
||||||
|
|
||||||
ZFS_DEV=`mktemp`
|
|
||||||
- dd if=/dev/zero of=$ZFS_DEV bs=1024k count=8 \
|
|
||||||
+ truncate -s 64M $ZFS_DEV
|
|
||||||
+ echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
|
|
||||||
+ dd of=$ZFS_DEV bs=1k count=8 \
|
|
||||||
+ seek=128 conv=notrunc &>/dev/null \
|
|
||||||
>/dev/null 2>/dev/null
|
|
||||||
echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
|
|
||||||
dd of=$ZFS_DEV bs=1k count=8 \
|
|
||||||
seek=132 conv=notrunc &>/dev/null \
|
|
||||||
>/dev/null 2>/dev/null
|
|
||||||
+ echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
|
|
||||||
+ dd of=$ZFS_DEV bs=1k count=8 \
|
|
||||||
+ seek=136 conv=notrunc &>/dev/null \
|
|
||||||
+ >/dev/null 2>/dev/null
|
|
||||||
+ echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
|
|
||||||
+ dd of=$ZFS_DEV bs=1k count=8 \
|
|
||||||
+ seek=140 conv=notrunc &>/dev/null \
|
|
||||||
+ >/dev/null 2>/dev/null
|
|
||||||
|
|
||||||
- saved_LDFLAGS="$LDFLAGS"
|
|
||||||
- LDFLAGS="-lblkid"
|
|
||||||
+ saved_LIBS="$LIBS"
|
|
||||||
+ LIBS="-lblkid"
|
|
||||||
|
|
||||||
AC_RUN_IFELSE([AC_LANG_PROGRAM(
|
|
||||||
[
|
|
||||||
#include <stdio.h>
|
|
||||||
+ #include <stdlib.h>
|
|
||||||
#include <blkid/blkid.h>
|
|
||||||
],
|
|
||||||
[
|
|
||||||
@@ -58,10 +77,10 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (strcmp(value, "zfs")) {
|
|
||||||
+ if (strcmp(value, "zfs_member")) {
|
|
||||||
free(value);
|
|
||||||
blkid_put_cache(cache);
|
|
||||||
- return 3;
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(value);
|
|
||||||
@@ -82,7 +101,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
|
|
||||||
[--with-blkid given but unavailable])])
|
|
||||||
])
|
|
||||||
|
|
||||||
- LDFLAGS="$saved_LDFLAGS"
|
|
||||||
+ LIBS="$saved_LIBS"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
AS_IF([test "x$with_blkid" != xcheck],
|
|
||||||
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c
|
|
||||||
index 53609f2..d1fa98e 100644
|
|
||||||
--- a/lib/libzfs/libzfs_import.c
|
|
||||||
+++ b/lib/libzfs/libzfs_import.c
|
|
||||||
@@ -965,7 +965,7 @@ zpool_find_import_blkid(libzfs_handle_t *hdl, pool_list_t *pools)
|
|
||||||
goto err_blkid2;
|
|
||||||
}
|
|
||||||
|
|
||||||
- err = blkid_dev_set_search(iter, "TYPE", "zfs");
|
|
||||||
+ err = blkid_dev_set_search(iter, "TYPE", "zfs_member");
|
|
||||||
if (err != 0) {
|
|
||||||
(void) zfs_error_fmt(hdl, EZFS_BADCACHE,
|
|
||||||
dgettext(TEXT_DOMAIN, "blkid_dev_set_search() %d"), err);
|
|
Loading…
x
Reference in New Issue
Block a user