Meta: 1
Name: zfs
Branch: 1.0
-Version: 0.7.2
+Version: 0.7.3
Release: 1
Release-Tags: relext
License: CDDL
tags: ctags etags
pkg: @DEFAULT_PACKAGE@
+pkg-dkms: @DEFAULT_PACKAGE@-dkms
pkg-kmod: @DEFAULT_PACKAGE@-kmod
pkg-utils: @DEFAULT_PACKAGE@-utils
fi)
deb-kmod: deb-local rpm-kmod
-@CONFIG_KERNEL_TRUE@ name=${PACKAGE}; \
-@CONFIG_KERNEL_TRUE@ version=${VERSION}-${RELEASE}; \
-@CONFIG_KERNEL_TRUE@ arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
-@CONFIG_KERNEL_TRUE@ pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
-@CONFIG_KERNEL_TRUE@ fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
-@CONFIG_KERNEL_TRUE@ $(RM) $$pkg1
+ name=${PACKAGE}; \
+ version=${VERSION}-${RELEASE}; \
+ arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+ pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
+ fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+ $(RM) $$pkg1
+
+deb-dkms: deb-local rpm-dkms
+ name=${PACKAGE}; \
+ version=${VERSION}-${RELEASE}; \
+ arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
+ pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
+ fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+ $(RM) $$pkg1
deb-utils: deb-local rpm-utils
-@CONFIG_USER_TRUE@ name=${PACKAGE}; \
-@CONFIG_USER_TRUE@ version=${VERSION}-${RELEASE}; \
-@CONFIG_USER_TRUE@ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
-@CONFIG_USER_TRUE@ pkg1=$${name}-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg2=libnvpair1-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg3=libuutil1-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg4=libzfs2-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg5=libzpool2-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg6=libzfs2-devel-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg7=$${name}-test-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg8=$${name}-dracut-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
-@CONFIG_USER_TRUE@ path_prepend=`mktemp -d /tmp/intercept.XXX`; \
-@CONFIG_USER_TRUE@ echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
-@CONFIG_USER_TRUE@ echo "`which dh_shlibdeps` -- \
-@CONFIG_USER_TRUE@ -xlibuutil1linux -xlibnvpair1linux -xlibzfs2linux -xlibzpool2linux" \
-@CONFIG_USER_TRUE@ >> $${path_prepend}/dh_shlibdeps; \
-@CONFIG_USER_TRUE@ chmod +x $${path_prepend}/dh_shlibdeps; \
-@CONFIG_USER_TRUE@ env PATH=$${path_prepend}:$${PATH} \
-@CONFIG_USER_TRUE@ fakeroot $(ALIEN) --bump=0 --scripts --to-deb \
-@CONFIG_USER_TRUE@ $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
-@CONFIG_USER_TRUE@ $$pkg8 $$pkg9; \
-@CONFIG_USER_TRUE@ $(RM) $${path_prepend}/dh_shlibdeps; \
-@CONFIG_USER_TRUE@ rmdir $${path_prepend}; \
-@CONFIG_USER_TRUE@ $(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
-@CONFIG_USER_TRUE@ $$pkg8 $$pkg9;
-
-deb: deb-kmod deb-utils
+ name=${PACKAGE}; \
+ version=${VERSION}-${RELEASE}; \
+ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+ pkg1=$${name}-$${version}.$${arch}.rpm; \
+ pkg2=libnvpair1-$${version}.$${arch}.rpm; \
+ pkg3=libuutil1-$${version}.$${arch}.rpm; \
+ pkg4=libzfs2-$${version}.$${arch}.rpm; \
+ pkg5=libzpool2-$${version}.$${arch}.rpm; \
+ pkg6=libzfs2-devel-$${version}.$${arch}.rpm; \
+ pkg7=$${name}-test-$${version}.$${arch}.rpm; \
+ pkg8=$${name}-dracut-$${version}.$${arch}.rpm; \
+ pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
+ path_prepend=`mktemp -d /tmp/intercept.XXX`; \
+ echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
+ echo "`which dh_shlibdeps` -- \
+ -xlibuutil1linux -xlibnvpair1linux -xlibzfs2linux -xlibzpool2linux" \
+ >> $${path_prepend}/dh_shlibdeps; \
+ chmod +x $${path_prepend}/dh_shlibdeps; \
+ env PATH=$${path_prepend}:$${PATH} \
+ fakeroot $(ALIEN) --bump=0 --scripts --to-deb \
+ $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
+ $$pkg8 $$pkg9; \
+ $(RM) $${path_prepend}/dh_shlibdeps; \
+ rmdir $${path_prepend}; \
+ $(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
+ $$pkg8 $$pkg9;
+
+deb: deb-kmod deb-dkms deb-utils
tgz-local:
@(if test "${HAVE_ALIEN}" = "no"; then \
echo -e "\n" \
tags: ctags etags
pkg: @DEFAULT_PACKAGE@
+pkg-dkms: @DEFAULT_PACKAGE@-dkms
pkg-kmod: @DEFAULT_PACKAGE@-kmod
pkg-utils: @DEFAULT_PACKAGE@-utils
direntp->d_name);
continue;
}
- if ((st.st_mode & S_IWGRP) & !zcp->do_force) {
+ if ((st.st_mode & S_IWGRP) && !zcp->do_force) {
zed_log_msg(LOG_NOTICE,
"Ignoring \"%s\": writable by group",
direntp->d_name);
continue;
}
- if ((st.st_mode & S_IWOTH) & !zcp->do_force) {
+ if ((st.st_mode & S_IWOTH) && !zcp->do_force) {
zed_log_msg(LOG_NOTICE,
"Ignoring \"%s\": writable by other",
direntp->d_name);
fi)
deb-kmod: deb-local rpm-kmod
-if CONFIG_KERNEL
name=${PACKAGE}; \
version=${VERSION}-${RELEASE}; \
arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
$(RM) $$pkg1
-endif
+
+
+deb-dkms: deb-local rpm-dkms
+ name=${PACKAGE}; \
+ version=${VERSION}-${RELEASE}; \
+ arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
+ pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
+ fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+ $(RM) $$pkg1
deb-utils: deb-local rpm-utils
-if CONFIG_USER
name=${PACKAGE}; \
version=${VERSION}-${RELEASE}; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
rmdir $${path_prepend}; \
$(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
$$pkg8 $$pkg9;
-endif
-deb: deb-kmod deb-utils
+deb: deb-kmod deb-dkms deb-utils
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for zfs 0.7.2.
+# Generated by GNU Autoconf 2.63 for zfs 0.7.3.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# Identity of this package.
PACKAGE_NAME='zfs'
PACKAGE_TARNAME='zfs'
-PACKAGE_VERSION='0.7.2'
-PACKAGE_STRING='zfs 0.7.2'
+PACKAGE_VERSION='0.7.3'
+PACKAGE_STRING='zfs 0.7.3'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
# 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.7.2 to adapt to many kinds of systems.
+\`configure' configures zfs 0.7.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of zfs 0.7.2:";;
+ short | recursive ) echo "Configuration of zfs 0.7.3:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-zfs configure 0.7.2
+zfs configure 0.7.3
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
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.7.2, which was
+It was created by zfs $as_me 0.7.3, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='zfs'
- VERSION='0.7.2'
+ VERSION='0.7.3'
cat >>confdefs.h <<_ACEOF
# 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.7.2, which was
+This file was extended by zfs $as_me 0.7.3, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-zfs config.status 0.7.2
+zfs config.status 0.7.3
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
# On systems with gcc-config (Gentoo, Funtoo, etc.):
# Use the current profile to resolve the appropriate path
dracut_install "/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1"
+ elif [[ -n "$(ls /usr/lib/libgcc_s.so* 2>/dev/null)" ]]; then
+ # Try a simple path first
+ dracut_install /usr/lib/libgcc_s.so*
else
# Fallback: Guess the path and include all matches
dracut_install /usr/lib/gcc/*/*/libgcc_s.so*
# Explicitly specify all kernel modules because automatic dependency resolution
# is unreliable on many systems.
-BASE_MODULES="zlib_deflate spl zavl zcommon znvpair zunicode zfs"
+BASE_MODULES="zlib_deflate spl zavl zcommon znvpair zunicode zfs icp"
CRPT_MODULES="sun-ccm sun-gcm sun-ctr"
MANUAL_ADD_MODULES_LIST="$BASE_MODULES"
{
# Sanity checks
if [ ! -x /sbin/lvm ]; then
- message "lvm is not available"
+ [ "$quiet" != "y" ] && message "lvm is not available"
return 1
fi
eval `echo SNAP_$i=$snap`
i=$((i + 1))
done <<EOT
-$("${ZFS}" list -H -oname -tsnapshot "${fs}")
+$("${ZFS}" list -H -oname -tsnapshot -r "${fs}")
EOT
- echo -n " Snap nr [0-$((i-1))]? " > /dev/stderr
+ echo -n " Snap nr [1-$((i-1))]? " > /dev/stderr
read snapnr
# Re-enable debugging.
void arc_tempreserve_clear(uint64_t reserve);
int arc_tempreserve_space(uint64_t reserve, uint64_t txg);
-uint64_t arc_max_bytes(void);
+uint64_t arc_target_bytes(void);
void arc_init(void);
void arc_fini(void);
boolean_t drc_byteswap;
boolean_t drc_force;
boolean_t drc_resumable;
+ boolean_t drc_clone;
struct avl_tree *drc_guid_to_ds_map;
zio_cksum_t drc_cksum;
uint64_t drc_newsnapobj;
boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds,
dsl_dataset_t *snap);
-void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx);
-void dsl_dataset_sync_done(dsl_dataset_t *os, dmu_tx_t *tx);
+void dsl_dataset_sync(dsl_dataset_t *ds, zio_t *zio, dmu_tx_t *tx);
+void dsl_dataset_sync_done(dsl_dataset_t *ds, dmu_tx_t *tx);
void dsl_dataset_block_born(dsl_dataset_t *ds, const blkptr_t *bp,
dmu_tx_t *tx);
uint64_t *value);
void dsl_dataset_dirty(dsl_dataset_t *ds, dmu_tx_t *tx);
-void dsl_dataset_stats(dsl_dataset_t *os, nvlist_t *nv);
+void dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv);
void dsl_dataset_fast_stat(dsl_dataset_t *ds, dmu_objset_stats_t *stat);
void dsl_dataset_space(dsl_dataset_t *ds,
uint64_t *refdbytesp, uint64_t *availbytesp,
-I$(top_srcdir)/lib/libspl/include
AM_CCASFLAGS = \
- -I$(top_srcdir)/lib/libspl/include
+ $(CFLAGS)
noinst_LTLIBRARIES = libspl.la
SUBDIRS = include $(TARGET_ASM_DIR)
DIST_SUBDIRS = include asm-generic asm-i386 asm-x86_64
AM_CCASFLAGS = \
- -I$(top_srcdir)/lib/libspl/include
+ $(CFLAGS)
noinst_LTLIBRARIES = libspl.la
USER_C = \
Name: libzfs
Description: LibZFS library
-Version: 0.7.2
+Version: 0.7.3
URL: http://zfsonlinux.org
Requires: libzfs_core
Cflags: -I${includedir}/libzfs -I${includedir}/libspl
Name: libzfs_core
Description: LibZFS core library
-Version: 0.7.2
+Version: 0.7.3
URL: http://zfsonlinux.org
Cflags: -I${includedir}/libzfs -I${includedir}/libspl
Libs: -L${libdir} -lzfs_core
/*
* Determines if the pool is in use. If so, it returns true and the state of
- * the pool as well as the name of the pool. Both strings are allocated and
+ * the pool as well as the name of the pool. Name string is allocated and
* must be freed by the caller.
*/
int
{
int ret;
- if ((ret = zfs_iter_filesystems(zhp, func, data)) != 0)
+ if ((ret = zfs_iter_snapshots(zhp, B_FALSE, func, data)) != 0)
return (ret);
- return (zfs_iter_snapshots(zhp, B_FALSE, func, data));
+ return (zfs_iter_filesystems(zhp, func, data));
}
int error = 0;
char name[ZFS_MAX_DATASET_NAME_LEN];
enum lzc_send_flags lzc_flags = 0;
+ FILE *fout = (flags->verbose && flags->dryrun) ? stdout : stderr;
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot resume send"));
return (zfs_error(hdl, EZFS_FAULT, errbuf));
}
if (flags->verbose) {
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
+ (void) fprintf(fout, dgettext(TEXT_DOMAIN,
"resume token contents:\n"));
- nvlist_print(stderr, resume_nvl);
+ nvlist_print(fout, resume_nvl);
}
if (nvlist_lookup_string(resume_nvl, "toname", &toname) != 0 ||
lzc_flags, &size);
if (error == 0)
size = MAX(0, (int64_t)(size - bytes));
- send_print_verbose(stderr, zhp->zfs_name, fromname,
+ send_print_verbose(fout, zhp->zfs_name, fromname,
size, flags->parsable);
}
static void Encode(uint8_t *, const uint32_t *, size_t);
-#if defined(__amd64)
+#if defined(__sparc)
+
+#define SHA1_TRANSFORM(ctx, in) \
+ SHA1Transform((ctx)->state[0], (ctx)->state[1], (ctx)->state[2], \
+ (ctx)->state[3], (ctx)->state[4], (ctx), (in))
+
+static void SHA1Transform(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t,
+ SHA1_CTX *, const uint8_t *);
+
+#elif defined(__amd64)
#define SHA1_TRANSFORM(ctx, in) sha1_block_data_order((ctx), (in), 1)
#define SHA1_TRANSFORM_BLOCKS(ctx, in, num) sha1_block_data_order((ctx), \
#define W(n) w_ ## n
#endif /* !defined(W_ARRAY) */
+#if defined(__sparc)
+
+
+/*
+ * sparc register window optimization:
+ *
+ * `a', `b', `c', `d', and `e' are passed into SHA1Transform
+ * explicitly since it increases the number of registers available to
+ * the compiler. under this scheme, these variables can be held in
+ * %i0 - %i4, which leaves more local and out registers available.
+ *
+ * purpose: sha1 transformation -- updates the digest based on `block'
+ * input: uint32_t : bytes 1 - 4 of the digest
+ * uint32_t : bytes 5 - 8 of the digest
+ * uint32_t : bytes 9 - 12 of the digest
+ * uint32_t : bytes 12 - 16 of the digest
+ * uint32_t : bytes 16 - 20 of the digest
+ * SHA1_CTX * : the context to update
+ * uint8_t [64]: the block to use to update the digest
+ * output: void
+ */
+
+
+void
+SHA1Transform(uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t e,
+ SHA1_CTX *ctx, const uint8_t blk[64])
+{
+ /*
+ * sparc optimization:
+ *
+ * while it is somewhat counter-intuitive, on sparc, it is
+ * more efficient to place all the constants used in this
+ * function in an array and load the values out of the array
+ * than to manually load the constants. this is because
+ * setting a register to a 32-bit value takes two ops in most
+ * cases: a `sethi' and an `or', but loading a 32-bit value
+ * from memory only takes one `ld' (or `lduw' on v9). while
+ * this increases memory usage, the compiler can find enough
+ * other things to do while waiting to keep the pipeline does
+ * not stall. additionally, it is likely that many of these
+ * constants are cached so that later accesses do not even go
+ * out to the bus.
+ *
+ * this array is declared `static' to keep the compiler from
+ * having to bcopy() this array onto the stack frame of
+ * SHA1Transform() each time it is called -- which is
+ * unacceptably expensive.
+ *
+ * the `const' is to ensure that callers are good citizens and
+ * do not try to munge the array. since these routines are
+ * going to be called from inside multithreaded kernelland,
+ * this is a good safety check. -- `sha1_consts' will end up in
+ * .rodata.
+ *
+ * unfortunately, loading from an array in this manner hurts
+ * performance under Intel. So, there is a macro,
+ * SHA1_CONST(), used in SHA1Transform(), that either expands to
+ * a reference to this array, or to the actual constant,
+ * depending on what platform this code is compiled for.
+ */
+
+
+ static const uint32_t sha1_consts[] = {
+ SHA1_CONST_0, SHA1_CONST_1, SHA1_CONST_2, SHA1_CONST_3
+ };
+
+
+ /*
+ * general optimization:
+ *
+ * use individual integers instead of using an array. this is a
+ * win, although the amount it wins by seems to vary quite a bit.
+ */
+
+
+ uint32_t w_0, w_1, w_2, w_3, w_4, w_5, w_6, w_7;
+ uint32_t w_8, w_9, w_10, w_11, w_12, w_13, w_14, w_15;
+
+
+ /*
+ * sparc optimization:
+ *
+ * if `block' is already aligned on a 4-byte boundary, use
+ * LOAD_BIG_32() directly. otherwise, bcopy() into a
+ * buffer that *is* aligned on a 4-byte boundary and then do
+ * the LOAD_BIG_32() on that buffer. benchmarks have shown
+ * that using the bcopy() is better than loading the bytes
+ * individually and doing the endian-swap by hand.
+ *
+ * even though it's quite tempting to assign to do:
+ *
+ * blk = bcopy(ctx->buf_un.buf32, blk, sizeof (ctx->buf_un.buf32));
+ *
+ * and only have one set of LOAD_BIG_32()'s, the compiler
+ * *does not* like that, so please resist the urge.
+ */
+
+
+ if ((uintptr_t)blk & 0x3) { /* not 4-byte aligned? */
+ bcopy(blk, ctx->buf_un.buf32, sizeof (ctx->buf_un.buf32));
+ w_15 = LOAD_BIG_32(ctx->buf_un.buf32 + 15);
+ w_14 = LOAD_BIG_32(ctx->buf_un.buf32 + 14);
+ w_13 = LOAD_BIG_32(ctx->buf_un.buf32 + 13);
+ w_12 = LOAD_BIG_32(ctx->buf_un.buf32 + 12);
+ w_11 = LOAD_BIG_32(ctx->buf_un.buf32 + 11);
+ w_10 = LOAD_BIG_32(ctx->buf_un.buf32 + 10);
+ w_9 = LOAD_BIG_32(ctx->buf_un.buf32 + 9);
+ w_8 = LOAD_BIG_32(ctx->buf_un.buf32 + 8);
+ w_7 = LOAD_BIG_32(ctx->buf_un.buf32 + 7);
+ w_6 = LOAD_BIG_32(ctx->buf_un.buf32 + 6);
+ w_5 = LOAD_BIG_32(ctx->buf_un.buf32 + 5);
+ w_4 = LOAD_BIG_32(ctx->buf_un.buf32 + 4);
+ w_3 = LOAD_BIG_32(ctx->buf_un.buf32 + 3);
+ w_2 = LOAD_BIG_32(ctx->buf_un.buf32 + 2);
+ w_1 = LOAD_BIG_32(ctx->buf_un.buf32 + 1);
+ w_0 = LOAD_BIG_32(ctx->buf_un.buf32 + 0);
+ } else {
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_15 = LOAD_BIG_32(blk + 60);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_14 = LOAD_BIG_32(blk + 56);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_13 = LOAD_BIG_32(blk + 52);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_12 = LOAD_BIG_32(blk + 48);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_11 = LOAD_BIG_32(blk + 44);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_10 = LOAD_BIG_32(blk + 40);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_9 = LOAD_BIG_32(blk + 36);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_8 = LOAD_BIG_32(blk + 32);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_7 = LOAD_BIG_32(blk + 28);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_6 = LOAD_BIG_32(blk + 24);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_5 = LOAD_BIG_32(blk + 20);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_4 = LOAD_BIG_32(blk + 16);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_3 = LOAD_BIG_32(blk + 12);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_2 = LOAD_BIG_32(blk + 8);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_1 = LOAD_BIG_32(blk + 4);
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ w_0 = LOAD_BIG_32(blk + 0);
+ }
+#else /* !defined(__sparc) */
+
void /* CSTYLED */
SHA1Transform(SHA1_CTX *ctx, const uint8_t blk[64])
{
W(14) = LOAD_BIG_32((void *)(blk + 56));
W(15) = LOAD_BIG_32((void *)(blk + 60));
+#endif /* !defined(__sparc) */
+
/*
* general optimization:
*
{
size_t i, j;
- for (i = 0, j = 0; j < len; i++, j += 4) {
- output[j] = (input[i] >> 24) & 0xff;
- output[j + 1] = (input[i] >> 16) & 0xff;
- output[j + 2] = (input[i] >> 8) & 0xff;
- output[j + 3] = input[i] & 0xff;
+#if defined(__sparc)
+ if (IS_P2ALIGNED(output, sizeof (uint32_t))) {
+ for (i = 0, j = 0; j < len; i++, j += 4) {
+ /* LINTED E_BAD_PTR_CAST_ALIGN */
+ *((uint32_t *)(output + j)) = input[i];
+ }
+ } else {
+#endif /* little endian -- will work on big endian, but slowly */
+
+ for (i = 0, j = 0; j < len; i++, j += 4) {
+ output[j] = (input[i] >> 24) & 0xff;
+ output[j + 1] = (input[i] >> 16) & 0xff;
+ output[j + 2] = (input[i] >> 8) & 0xff;
+ output[j + 3] = input[i] & 0xff;
+ }
+#if defined(__sparc)
}
+#endif
}
kstat_named_t arcstat_memory_throttle_count;
kstat_named_t arcstat_memory_direct_count;
kstat_named_t arcstat_memory_indirect_count;
+ kstat_named_t arcstat_memory_all_bytes;
+ kstat_named_t arcstat_memory_free_bytes;
+ kstat_named_t arcstat_memory_available_bytes;
kstat_named_t arcstat_no_grow;
kstat_named_t arcstat_tempreserve;
kstat_named_t arcstat_loaned_bytes;
{ "memory_throttle_count", KSTAT_DATA_UINT64 },
{ "memory_direct_count", KSTAT_DATA_UINT64 },
{ "memory_indirect_count", KSTAT_DATA_UINT64 },
+ { "memory_all_bytes", KSTAT_DATA_UINT64 },
+ { "memory_free_bytes", KSTAT_DATA_UINT64 },
+ { "memory_available_bytes", KSTAT_DATA_INT64 },
{ "arc_no_grow", KSTAT_DATA_UINT64 },
{ "arc_tempreserve", KSTAT_DATA_UINT64 },
{ "arc_loaned_bytes", KSTAT_DATA_UINT64 },
arc_all_memory(void)
{
#ifdef _KERNEL
- return (MIN(ptob(physmem),
- vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC)));
+#ifdef CONFIG_HIGHMEM
+ return (ptob(totalram_pages - totalhigh_pages));
+#else
+ return (ptob(totalram_pages));
+#endif /* CONFIG_HIGHMEM */
#else
return (ptob(physmem) / 2);
-#endif
+#endif /* _KERNEL */
}
-#ifdef _KERNEL
+/*
+ * Return the amount of memory that is considered free. In user space
+ * which is primarily used for testing we pretend that free memory ranges
+ * from 0-20% of all memory.
+ */
static uint64_t
arc_free_memory(void)
{
+#ifdef _KERNEL
+#ifdef CONFIG_HIGHMEM
+ struct sysinfo si;
+ si_meminfo(&si);
+ return (ptob(si.freeram - si.freehigh));
+#else
#ifdef ZFS_GLOBAL_NODE_PAGE_STATE
- return (nr_free_pages() +
+ return (ptob(nr_free_pages() +
global_node_page_state(NR_INACTIVE_FILE) +
global_node_page_state(NR_INACTIVE_ANON) +
- global_node_page_state(NR_SLAB_RECLAIMABLE));
+ global_node_page_state(NR_SLAB_RECLAIMABLE)));
#else
- return (nr_free_pages() +
+ return (ptob(nr_free_pages() +
global_page_state(NR_INACTIVE_FILE) +
global_page_state(NR_INACTIVE_ANON) +
- global_page_state(NR_SLAB_RECLAIMABLE));
-#endif
+ global_page_state(NR_SLAB_RECLAIMABLE)));
+#endif /* ZFS_GLOBAL_NODE_PAGE_STATE */
+#endif /* CONFIG_HIGHMEM */
+#else
+ return (spa_get_random(arc_all_memory() * 20 / 100));
+#endif /* _KERNEL */
}
-#endif
typedef enum free_memory_reason_t {
FMR_UNKNOWN,
int64_t lowest = INT64_MAX;
free_memory_reason_t r = FMR_UNKNOWN;
#ifdef _KERNEL
- uint64_t available_memory = ptob(arc_free_memory());
int64_t n;
#ifdef __linux__
+#ifdef freemem
+#undef freemem
+#endif
pgcnt_t needfree = btop(arc_need_free);
pgcnt_t lotsfree = btop(arc_sys_free);
pgcnt_t desfree = 0;
-#endif
-
-#if defined(__i386)
- available_memory =
- MIN(available_memory, vmem_size(heap_arena, VMEM_FREE));
+ pgcnt_t freemem = btop(arc_free_memory());
#endif
if (needfree > 0) {
* number of needed free pages. We add extra pages here to make sure
* the scanner doesn't start up while we're freeing memory.
*/
- n = PAGESIZE * (btop(available_memory) - lotsfree - needfree - desfree);
+ n = PAGESIZE * (freemem - lotsfree - needfree - desfree);
if (n < lowest) {
lowest = n;
r = FMR_LOTSFREE;
r = FMR_SWAPFS_MINFREE;
}
-
/*
* Check that we have enough availrmem that memory locking (e.g., via
* mlock(3C) or memcntl(2)) can still succeed. (pages_pp_maximum
}
#endif
-#if defined(__i386)
+#if defined(_ILP32)
/*
- * If we're on an i386 platform, it's possible that we'll exhaust the
+ * If we're on a 32-bit platform, it's possible that we'll exhaust the
* kernel heap space before we ever run out of available physical
* memory. Most checks of the size of the heap_area compare against
* tune.t_minarmem, which is the minimum available real memory that we
extern kmem_cache_t *zio_data_buf_cache[];
extern kmem_cache_t *range_seg_cache;
+#ifdef _KERNEL
if ((arc_meta_used >= arc_meta_limit) && zfs_arc_meta_prune) {
/*
* We are exceeding our meta-data cache limit.
*/
arc_prune_async(zfs_arc_meta_prune);
}
+#if defined(_ILP32)
+ /*
+ * Reclaim unused memory from all kmem caches.
+ */
+ kmem_reap();
+#endif
+#endif
for (i = 0; i < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; i++) {
-#ifdef _ILP32
+#if defined(_ILP32)
/* reach upper limit of cache size on 32-bit */
if (zio_buf_cache[i] == NULL)
break;
arc_memory_throttle(uint64_t reserve, uint64_t txg)
{
#ifdef _KERNEL
- uint64_t available_memory = ptob(arc_free_memory());
+ uint64_t available_memory = arc_free_memory();
static uint64_t page_load = 0;
static uint64_t last_txg = 0;
-#ifdef __linux__
- pgcnt_t minfree = btop(arc_sys_free / 4);
-#endif
-#if defined(__i386)
+#if defined(_ILP32)
available_memory =
MIN(available_memory, vmem_size(heap_arena, VMEM_FREE));
#endif
* continue to let page writes occur as quickly as possible.
*/
if (current_is_kswapd()) {
- if (page_load > MAX(ptob(minfree), available_memory) / 4) {
+ if (page_load > MAX(arc_sys_free / 4, available_memory) / 4) {
DMU_TX_STAT_BUMP(dmu_tx_memory_reclaim);
return (SET_ERROR(ERESTART));
}
&as->arcstat_mfu_ghost_size,
&as->arcstat_mfu_ghost_evictable_data,
&as->arcstat_mfu_ghost_evictable_metadata);
+
+ as->arcstat_memory_all_bytes.value.ui64 =
+ arc_all_memory();
+ as->arcstat_memory_free_bytes.value.ui64 =
+ arc_free_memory();
+ as->arcstat_memory_available_bytes.value.i64 =
+ arc_available_memory();
}
return (0);
}
uint64_t
-arc_max_bytes(void)
+arc_target_bytes(void)
{
- return (arc_c_max);
+ return (arc_c);
}
void
multilist_get_num_sublists(ml));
}
+static inline unsigned long
+dbuf_cache_target_bytes(void)
+{
+ return MIN(dbuf_cache_max_bytes,
+ arc_target_bytes() >> dbuf_cache_max_shift);
+}
+
static inline boolean_t
dbuf_cache_above_hiwater(void)
{
+ uint64_t dbuf_cache_target = dbuf_cache_target_bytes();
+
uint64_t dbuf_cache_hiwater_bytes =
- (dbuf_cache_max_bytes * dbuf_cache_hiwater_pct) / 100;
+ (dbuf_cache_target * dbuf_cache_hiwater_pct) / 100;
return (refcount_count(&dbuf_cache_size) >
- dbuf_cache_max_bytes + dbuf_cache_hiwater_bytes);
+ dbuf_cache_target + dbuf_cache_hiwater_bytes);
}
static inline boolean_t
dbuf_cache_above_lowater(void)
{
+ uint64_t dbuf_cache_target = dbuf_cache_target_bytes();
+
uint64_t dbuf_cache_lowater_bytes =
- (dbuf_cache_max_bytes * dbuf_cache_lowater_pct) / 100;
+ (dbuf_cache_target * dbuf_cache_lowater_pct) / 100;
return (refcount_count(&dbuf_cache_size) >
- dbuf_cache_max_bytes - dbuf_cache_lowater_bytes);
+ dbuf_cache_target - dbuf_cache_lowater_bytes);
}
/*
* because it's OK to occasionally make the wrong decision here,
* and grabbing the lock results in massive lock contention.
*/
- if (refcount_count(&dbuf_cache_size) > dbuf_cache_max_bytes) {
+ if (refcount_count(&dbuf_cache_size) > dbuf_cache_target_bytes()) {
if (dbuf_cache_above_hiwater())
dbuf_evict_one();
cv_signal(&dbuf_evict_cv);
* dbuf cache to 1/32nd (default) of the size of the ARC.
*/
dbuf_cache_max_bytes = MIN(dbuf_cache_max_bytes,
- arc_max_bytes() >> dbuf_cache_max_shift);
+ arc_target_bytes() >> dbuf_cache_max_shift);
/*
* All entries are queued via taskq_dispatch_ent(), so min/maxalloc
dump_freeobjects(dmu_sendarg_t *dsp, uint64_t firstobj, uint64_t numobjs)
{
struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects);
+ uint64_t maxobj = DNODES_PER_BLOCK *
+ (DMU_META_DNODE(dsp->dsa_os)->dn_maxblkid + 1);
+
+ /*
+ * ZoL < 0.7 does not handle large FREEOBJECTS records correctly,
+ * leading to zfs recv never completing. to avoid this issue, don't
+ * send FREEOBJECTS records for object IDs which cannot exist on the
+ * receiving side.
+ */
+ if (maxobj > 0) {
+ if (maxobj < firstobj)
+ return (0);
+
+ if (maxobj < firstobj + numobjs)
+ numobjs = maxobj - firstobj;
+ }
/*
* If there is a pending op, but it's not PENDING_FREEOBJECTS,
drc->drc_force = force;
drc->drc_resumable = resumable;
drc->drc_cred = CRED();
+ drc->drc_clone = (origin != NULL);
if (drc->drc_drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC)) {
drc->drc_byteswap = B_TRUE;
/* A map from guid to dataset to help handle dedup'd streams. */
avl_tree_t *guid_to_ds_map;
boolean_t resumable;
- uint64_t last_object, last_offset;
+ uint64_t last_object;
+ uint64_t last_offset;
+ uint64_t max_object; /* highest object ID referenced in stream */
uint64_t bytes_read; /* bytes read when current record created */
};
return (SET_ERROR(EINVAL));
object = err == 0 ? drro->drr_object : DMU_NEW_OBJECT;
+ if (drro->drr_object > rwa->max_object)
+ rwa->max_object = drro->drr_object;
+
/*
* If we are losing blkptrs or changing the block size this must
* be a new file instance. We must clear out the previous file
int err;
err = dmu_object_info(rwa->os, obj, &doi);
- if (err == ENOENT) {
- obj++;
+ if (err == ENOENT)
continue;
- } else if (err != 0) {
+ else if (err != 0)
return (err);
- }
err = dmu_free_long_object(rwa->os, obj);
if (err != 0)
return (err);
+
+ if (obj > rwa->max_object)
+ rwa->max_object = obj;
}
if (next_err != ESRCH)
return (next_err);
rwa->last_object = drrw->drr_object;
rwa->last_offset = drrw->drr_offset;
+ if (rwa->last_object > rwa->max_object)
+ rwa->max_object = rwa->last_object;
+
if (dmu_object_info(rwa->os, drrw->drr_object, NULL) != 0)
return (SET_ERROR(EINVAL));
ref_os = rwa->os;
}
+ if (drrwbr->drr_object > rwa->max_object)
+ rwa->max_object = drrwbr->drr_object;
+
err = dmu_buf_hold(ref_os, drrwbr->drr_refobject,
drrwbr->drr_refoffset, FTAG, &dbp, DMU_READ_PREFETCH);
if (err != 0)
if (drrwe->drr_compression >= ZIO_COMPRESS_FUNCTIONS)
return (EINVAL);
+ if (drrwe->drr_object > rwa->max_object)
+ rwa->max_object = drrwe->drr_object;
+
tx = dmu_tx_create(rwa->os);
dmu_tx_hold_write(tx, drrwe->drr_object,
if (dmu_object_info(rwa->os, drrs->drr_object, NULL) != 0)
return (SET_ERROR(EINVAL));
+ if (drrs->drr_object > rwa->max_object)
+ rwa->max_object = drrs->drr_object;
+
VERIFY0(dmu_bonus_hold(rwa->os, drrs->drr_object, FTAG, &db));
if ((err = dmu_spill_hold_by_bonus(db, FTAG, &db_spill)) != 0) {
dmu_buf_rele(db, FTAG);
if (dmu_object_info(rwa->os, drrf->drr_object, NULL) != 0)
return (SET_ERROR(EINVAL));
+ if (drrf->drr_object > rwa->max_object)
+ rwa->max_object = drrf->drr_object;
+
err = dmu_free_long_range(rwa->os, drrf->drr_object,
drrf->drr_offset, drrf->drr_length);
}
mutex_exit(&rwa->mutex);
+ /*
+ * If we are receiving a full stream as a clone, all object IDs which
+ * are greater than the maximum ID referenced in the stream are
+ * by definition unused and must be freed.
+ */
+ if (drc->drc_clone && drc->drc_drrb->drr_fromguid == 0) {
+ uint64_t obj = rwa->max_object + 1;
+ int free_err = 0;
+ int next_err = 0;
+
+ while (next_err == 0) {
+ free_err = dmu_free_long_object(rwa->os, obj);
+ if (free_err != 0 && free_err != ENOENT)
+ break;
+
+ next_err = dmu_object_next(rwa->os, &obj, FALSE, 0);
+ }
+
+ if (err == 0) {
+ if (free_err != 0 && free_err != ENOENT)
+ err = free_err;
+ else if (next_err != ESRCH)
+ err = next_err;
+ }
+ }
+
cv_destroy(&rwa->cv);
mutex_destroy(&rwa->mutex);
bqueue_destroy(&rwa->q);
spa_config_enter(vd->vdev_spa, locks, FTAG, RW_READER);
- ub_abd = abd_alloc(VDEV_UBERBLOCK_SIZE(vd), B_TRUE);
+ ub_abd = abd_alloc_linear(VDEV_UBERBLOCK_SIZE(vd), B_TRUE);
write_zio = zio_root(vd->vdev_spa, NULL, NULL, flags);
for (int n = 0; n < VDEV_UBERBLOCK_COUNT(vd); n++) {
int error;
if ((lckdat->l_whence == 2) || (whence == 2)) {
- if ((error = zfs_getattr(ip, &vap, 0, CRED()) != 0))
+ if ((error = zfs_getattr(ip, &vap, 0, CRED())))
return (error);
}
%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
+%if ! 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
+%define not_rpm 1
+%endif
+
%define module @PACKAGE@
%define mkconf scripts/dkms.mkconf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-Requires: dkms >= 2.2.0.3-20
+Requires: dkms >= 2.2.0.3
Requires: spl-dkms = %{version}
Requires: gcc, make, perl
+%if 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
Requires: kernel-devel
+%endif
Provides: %{module}-kmod = %{version}
%description
if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
echo -e
echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"
- dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
+ dkms remove -m %{module} -v %{version} --all %{!?not_rpm:--rpm_safe_upgrade}
fi
exit 0
rm -rf $RPM_BUILD_ROOT
%changelog
-* Mon Sep 25 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
+* Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
+- Released 0.7.3-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
+* Fri Sep 22 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
- Released 0.7.2-1, detailed release notes are available at:
- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.2
* Tue Aug 8 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.1-1
%endif
%changelog
-* Mon Sep 25 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
+* Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
+- Released 0.7.3-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
+* Fri Sep 22 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
- Released 0.7.2-1, detailed release notes are available at:
- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.2
* Tue Aug 8 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.1-1
%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
+%if ! 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
+%define not_rpm 1
+%endif
+
%define module @PACKAGE@
%define mkconf scripts/dkms.mkconf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-Requires: dkms >= 2.2.0.3-20
+Requires: dkms >= 2.2.0.3
Requires: spl-dkms = %{version}
Requires: gcc, make, perl
+%if 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
Requires: kernel-devel
+%endif
Provides: %{module}-kmod = %{version}
%description
if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
echo -e
echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"
- dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
+ dkms remove -m %{module} -v %{version} --all %{!?not_rpm:--rpm_safe_upgrade}
fi
exit 0
%endif
%changelog
-* Mon Sep 25 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
+* Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
+- Released 0.7.3-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
+* Fri Sep 22 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
- Released 0.7.2-1, detailed release notes are available at:
- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.2
* Tue Aug 8 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.1-1
function usage
{
- echo -e "\n$0 [-t <timeout>] [-c <dump directory>]" \
+ echo -e "\n$0 [-t <timeout>] [ -s <vdev size> ] [-c <dump directory>]" \
"[ -- [extra ztest parameters]]\n" \
"\n" \
" This script runs ztest repeatedly with randomized arguments.\n" \
" Options:\n" \
" -t Total time to loop for, in seconds. If not provided,\n" \
" zloop runs forever.\n" \
+ " -s Size of vdev devices.\n" \
" -f Specify working directory for ztest vdev files.\n" \
" -c Specify a core dump directory to use.\n" \
" -h Print this help message.\n" \
coredir=$DEFAULTCOREDIR
workdir=$DEFAULTWORKDIR
timeout=0
-while getopts ":ht:c:f:" opt; do
+size="512m"
+while getopts ":ht:s:c:f:" opt; do
case $opt in
t ) [[ $OPTARG -gt 0 ]] && timeout=$OPTARG ;;
+ s ) [[ $OPTARG ]] && size=$OPTARG ;;
c ) [[ $OPTARG ]] && coredir=$OPTARG ;;
f ) [[ $OPTARG ]] && workdir=$(readlink -f "$OPTARG") ;;
h ) usage
align=$(((RANDOM % 2) * 3 + 9))
runtime=$((RANDOM % 100))
passtime=$((RANDOM % (runtime / 3 + 1) + 10))
- size=128m
zopt="$zopt -m $mirrors"
zopt="$zopt -r $raidz"
'send-c_lz4_disabled', 'send-c_recv_lz4_disabled',
'send-c_mixed_compression', 'send-c_stream_size_estimate', 'send-cD',
'send-c_embedded_blocks', 'send-c_resume', 'send-cpL_varied_recsize',
- 'send-c_recv_dedup']
+ 'send-c_recv_dedup', 'send_freeobjects']
[tests/functional/scrub_mirror]
tests = ['scrub_mirror_001_pos', 'scrub_mirror_002_pos',
fi
if id $user > /dev/null 2>&1; then
- log_must userdel $user
+ log_must_retry "currently used" 5 userdel $user
fi
[[ -d $basedir/$user ]] && rm -fr $basedir/$user
poolexists $TESTPOOL1 && \
log_must zpool destroy -f $TESTPOOL1
- for file in `ls $TESTDIR/file.*`; do
+ for file in `ls $TEST_BASE_DIR/file.*`; do
log_must rm -f $file
done
}
#make raw files to create various configuration pools
typeset -i i=0
while (( i < 3 )); do
- log_must mkfile $FILESIZE $TESTDIR/file.$i
+ log_must truncate -s $FILESIZE $TEST_BASE_DIR/file.$i
(( i = i + 1 ))
done
-fbase=$TESTDIR/file
+fbase=$TEST_BASE_DIR/file
set -A poolconf "mirror $fbase.0 $fbase.1 $fbase.2" \
"raidz1 $fbase.0 $fbase.1 $fbase.2" \
"raidz2 $fbase.0 $fbase.1 $fbase.2"
for pool_file in $pool_files; do
log_must bzcat \
$STF_SUITE/tests/functional/cli_root/zpool_upgrade/$pool_file.bz2 \
- >/$TESTPOOL/$pool_file
+ >$TEST_BASE_DIR/$pool_file
done
- log_must zpool import -d /$TESTPOOL $pool_name
+ log_must zpool import -d $TEST_BASE_DIR $pool_name
# Put some random contents into the pool
for i in {1..1024} ; do
log_must zpool destroy $pool_name
fi
for file in $pool_files; do
- rm -f /$TESTPOOL/$file
+ rm -f $TEST_BASE_DIR/$file
done
}
typeset pool=$1
typeset flag=$2
find /$pool -type f -exec cksum {} + > \
- /$TESTPOOL/pool-checksums.$pool.$flag
- echo /$TESTPOOL/pool-checksums.$pool.$flag
+ $TEST_BASE_DIR/pool-checksums.$pool.$flag
+ echo $TEST_BASE_DIR/pool-checksums.$pool.$flag
}
# This function simply checks that a pool has a particular version number
typeset -n pool_name=ZPOOL_VERSION_${config}_NAME
check_pool $pool_name post > /dev/null
- log_must diff /$TESTPOOL/pool-checksums.$pool_name.pre \
- /$TESTPOOL/pool-checksums.$pool_name.post
- rm /$TESTPOOL/pool-checksums.$pool_name.pre \
- /$TESTPOOL/pool-checksums.$pool_name.post
+ log_must diff $TEST_BASE_DIR/pool-checksums.$pool_name.pre \
+ $TEST_BASE_DIR/pool-checksums.$pool_name.post
+ rm $TEST_BASE_DIR/pool-checksums.$pool_name.pre \
+ $TEST_BASE_DIR/pool-checksums.$pool_name.post
destroy_upgraded_pool $config
done
log_must zfs create -o recordsize=512 -o compression=off $TEST_FS
-# Create enough blocks that it will take 4 TXGs to free them all.
-typeset zfs_free_max_blocks=100000
-typeset blocks=$((zfs_free_max_blocks * 4 * 512 / 1024 / 1024))
-
-log_must dd bs=1024k count=$blocks if=/dev/zero of=/$TEST_FS/file
-
+# Create enough blocks that it will take multiple TXGs to free them all.
+log_must dd bs=1024k count=128 if=/dev/zero of=/$TEST_FS/file
+log_must sync
log_must zfs destroy $TEST_FS
#
send-c_verify_ratio.ksh \
send-c_volume.ksh \
send-c_zstreamdump.ksh \
- send-cpL_varied_recsize.ksh
+ send-cpL_varied_recsize.ksh \
+ send_freeobjects.ksh
send-c_verify_ratio.ksh \
send-c_volume.ksh \
send-c_zstreamdump.ksh \
- send-cpL_varied_recsize.ksh
+ send-cpL_varied_recsize.ksh \
+ send_freeobjects.ksh
all: all-am
{
typeset sendfs=$1
typeset recvfs=$2
+ typeset streamfs=$3
typeset sendpool=${sendfs%%/*}
typeset recvpool=${recvfs%%/*}
datasetexists $sendfs && log_must zfs destroy -r $sendpool
datasetexists $recvfs && log_must zfs destroy -r $recvpool
+ datasetexists $streamfs && log_must zfs destroy -r $streamfs
if $(datasetexists $sendfs || zfs create -o compress=lz4 $sendfs); then
mk_files 1000 256 0 $sendfs &
">/$sendpool/incremental.zsend"
fi
- if datasetexists $streamfs; then
- log_must zfs destroy -r $streamfs
- fi
- log_must zfs create -o compress=lz4 $sendpool/stream
+ log_must zfs create -o compress=lz4 $streamfs
}
#
{
typeset sendfs=$1
typeset streamfs=$2
+ typeset sendpool=${sendfs%%/*}
datasetexists $sendfs && log_must zfs destroy -r $sendfs
datasetexists $streamfs && log_must zfs destroy -r $streamfs
cleanup_pool $POOL2
- rm -f /$POOL/initial.zsend /$POOL/incremental.zsend
+ rm -f /$sendpool/initial.zsend /$sendpool/incremental.zsend
}
recvfs=$POOL3/recvfs
streamfs=$POOL2/stream
-for sendfs in $POOL2/sendfs $POOL2; do
- test_fs_setup $sendfs $recvfs
+for sendfs in $POOL2/sendfs $POOL3; do
+ test_fs_setup $sendfs $recvfs $streamfs
resume_test "zfs send -v $sendfs@a" $streamfs $recvfs
resume_test "zfs send -v -i @a $sendfs@b" $streamfs $recvfs
file_check $sendfs $recvfs
log_onexit resume_cleanup $sendfs $streamfs
-test_fs_setup $sendfs $recvfs
+test_fs_setup $sendfs $recvfs $streamfs
resume_test "zfs send -D -v $sendfs@a" $streamfs $recvfs
file_check $sendfs $recvfs
log_onexit resume_cleanup $sendfs $streamfs
-test_fs_setup $sendfs $recvfs
+test_fs_setup $sendfs $recvfs $streamfs
resume_test "zfs send -v -e $sendfs@a" $streamfs $recvfs
resume_test "zfs send -v -e -i @a $sendfs@b" $streamfs $recvfs
file_check $sendfs $recvfs
log_onexit resume_cleanup $sendfs $streamfs
-test_fs_setup $sendfs $recvfs
+test_fs_setup $sendfs $recvfs $streamfs
log_must zfs bookmark $sendfs@a $sendfs#bm_a
log_must zfs destroy $sendfs@a
log_must zfs receive -v $recvfs </$POOL/initial.zsend
log_onexit resume_cleanup $sendfs $streamfs
-test_fs_setup $sendfs $recvfs
+test_fs_setup $sendfs $recvfs $streamfs
log_must zfs unmount $sendfs
resume_test "zfs send $sendfs" $streamfs $recvfs
file_check $sendfs $recvfs
log_assert "Verify compressed send streams can be resumed if interrupted"
log_onexit resume_cleanup $sendfs $streamfs
-test_fs_setup $sendfs $recvfs
+test_fs_setup $sendfs $recvfs $streamfs
resume_test "zfs send -c -v $sendfs@a" $streamfs $recvfs
resume_test "zfs send -c -v -i @a $sendfs@b" $streamfs $recvfs
file_check $sendfs $recvfs
--- /dev/null
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/rsend/rsend.kshlib
+
+#
+# Description:
+# Verify FREEOBJECTS record frees sequential objects (See
+# https://github.com/zfsonlinux/zfs/issues/6694)
+#
+# Strategy:
+# 1. Create three files with sequential object numbers, f1 f2 and f3
+# 2. Delete f2
+# 3. Take snapshot A
+# 4. Delete f3
+# 5. Take snapshot B
+# 6. Receive a full send of A
+# 7. Receive an incremental send of B
+# 8. Fail test if f3 exists on received snapshot B
+#
+
+verify_runnable "both"
+
+log_assert "Verify FREEOBJECTS record frees sequential objects"
+
+sendds=sendfo
+recvds=recvfo
+f1=/$POOL/$sendds/f1
+f2=/$POOL/$sendds/f2
+f3=/$POOL/$sendds/f3
+
+#
+# We need to set xattr=sa and dnodesize=legacy to guarantee sequential
+# object numbers for this test. Otherwise, if we used directory-based
+# xattrs, SELinux extended attributes might consume intervening object
+# numbers.
+#
+log_must zfs create -o xattr=sa -o dnodesize=legacy $POOL/$sendds
+
+tries=100
+for ((i=0; i<$tries; i++)); do
+ touch $f1 $f2 $f3
+ o1=$(ls -li $f1 | awk '{print $1}')
+ o2=$(ls -li $f2 | awk '{print $1}')
+ o3=$(ls -li $f3 | awk '{print $1}')
+
+ if [[ $o2 -ne $(( $o1 + 1 )) ]] || [[ $o3 -ne $(( $o2 + 1 )) ]]; then
+ rm -f $f1 $f2 $f3
+ else
+ break
+ fi
+done
+
+if [[ $i -eq $tries ]]; then
+ log_fail "Failed to create three sequential objects"
+fi
+
+log_must rm $f2
+log_must zfs snap $POOL/$sendds@A
+log_must rm $f3
+log_must zfs snap $POOL/$sendds@B
+log_must eval "zfs send $POOL/$sendds@A | zfs recv $POOL/$recvds"
+log_must eval "zfs send -i $POOL/$sendds@A $POOL/$sendds@B |" \
+ "zfs recv $POOL/$recvds"
+log_mustnot zdb $POOL/$recvds@B $o3
+log_pass "Verify FREEOBJECTS record frees sequential objects"