debian/0000755000000000000000000000000012161601127007163 5ustar debian/rules0000755000000000000000000000216012013347557010254 0ustar #!/usr/bin/make -f SCONSFLAGS=--no-cache -C src debug=1 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) SCONSFLAGS+= optim=-O0 else SCONSFLAGS+= optim=-O2 endif override_dh_auto_build: # Get the latest config.sub, config.guess files from autotools-dev -test -r /usr/share/misc/config.sub && \ cp -f /usr/share/misc/config.sub src/lib/libumem/config.sub -test -r /usr/share/misc/config.guess && \ cp -f /usr/share/misc/config.guess src/lib/libumem/config.guess scons $(SCONSFLAGS) override_dh_auto_clean: scons $(SCONSFLAGS) -ccc rm -f src/.sconsign.dblite rm -f src/lib/libumem/config.guess rm -f src/lib/libumem/config.sub override_dh_auto_install: scons $(SCONSFLAGS) DESTDIR=$(CURDIR)/debian/zfs-fuse install_dir=/sbin man_dir=/usr/share/man/man8 install install -m 644 contrib/zfsrc $(CURDIR)/debian/zfs-fuse/etc/zfs install -m 644 -T contrib/zfs_completion.bash $(CURDIR)/debian/zfs-fuse/etc/bash_completion.d/zfs-fuse rm -f debian/zfs-fuse/sbin/ztest override_dh_installchangelogs: dh_installchangelogs CHANGES override_dh_installinit: dh_installinit --no-start -- start 38 S . stop 39 0 6 . %: dh $@ debian/zfs-fuse.default0000644000000000000000000000064712013347557012314 0ustar # Defaults for zfs-fuse initscript # sourced by /etc/init.d/zfs-fuse # installed at /etc/default/zfs-fuse by the maintainer scripts # # This is a POSIX shell fragment # # Enable ZFS support? (yes/no) ENABLE_ZFS=yes # Try to restart zfs-fuse when upgrading? (yes/no) # This will require unmounting all ZFS volumes upon upgrade # Do not use this if a vital system volume is on ZFS (/var, /home, etc) RESTART_ON_UPGRADE=no debian/control0000644000000000000000000000167712013347557010613 0ustar Source: zfs-fuse Section: otherosfs Priority: optional Maintainer: Asias He Build-Depends: debhelper (>= 7.0.50~), scons, libfuse-dev (>= 2.8.7-2), zlib1g-dev, libaio-dev, libssl-dev, libattr1-dev, autotools-dev Standards-Version: 3.9.2 Homepage: http://zfs-fuse.net Vcs-Git: git://git.debian.org/collab-maint/zfs-fuse.git Vcs-Browser: http://git.debian.org/?p=collab-maint/zfs-fuse.git DM-Upload-Allowed: yes Package: zfs-fuse Architecture: i386 amd64 sparc powerpc Depends: ${shlibs:Depends}, ${misc:Depends}, fuse (>=2.8.7-2) , lsb-base Suggests: nfs-kernel-server, kpartx Description: ZFS on FUSE ZFS is an advanced filesystem from Sun Microsystems, originally developed for solaris. It provides a number of advanced features, such as live integrity checks, atomic updates, atomic snapshots and clones, compression, and much more. . This package provides an implementation of Sun's ZFS filesystem in userspace, using FUSE. debian/source/0000755000000000000000000000000012013347557010475 5ustar debian/source/format0000644000000000000000000000001412013347557011703 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000002023412161601000011024 0ustar zfs-fuse (0.7.0-10.1) unstable; urgency=low * Non-maintainer upload. * Fix "ftbfs with eglibc-2.17": add patch fix-malloc-for-newer-glibc.patch from Ben Collins / Ubuntu: - Newer GLibC changes the way __malloc_initialize_hook is initialized, so patch malloc.c accordingly. (Closes: #701447) -- gregor herrmann Sun, 23 Jun 2013 16:09:01 +0200 zfs-fuse (0.7.0-10) unstable; urgency=low * Fix "issues forbidden SG_IO ioctl on partitions" (Closes: #657166) -- Asias He Fri, 31 Aug 2012 15:30:05 +0800 zfs-fuse (0.7.0-9) unstable; urgency=low * Fix "automated monthly scrubs" (Closes: #650955) * Fix "Automated ZFS snapshots using Hanoi algorithm" (Closes: #651873) * Fix "/proc/$pid/oom_adj is deprecated, please use /proc/$pid/oom_score_adj instead." issue -- Asias He Fri, 17 Aug 2012 11:50:57 +0800 zfs-fuse (0.7.0-8) unstable; urgency=low * Fix "fails to install due to insserv rejecting the script header" Drop fuse in /etc/init.d/zfs-fuse (Closes: #669246) -- Asias He Tue, 05 Jun 2012 09:34:39 +0800 zfs-fuse (0.7.0-7) unstable; urgency=low * Fix "zfs-fuse depends on transitional package fuse-utils" (Closes: #673662) -- Asias He Wed, 30 May 2012 14:04:13 +0800 zfs-fuse (0.7.0-6) unstable; urgency=low * Fix build breakage on powerpc -- Asias He Mon, 06 Feb 2012 13:37:48 +0000 zfs-fuse (0.7.0-5) unstable; urgency=low * Fix "unnecessary fails, cosmetic issues in the init-script" (Closes: #587920) * Fix "drop fallback functions in the initscript" (Closes: #583383) * Fix "Please readd powerpc (built for 0.7.0-3)" (Closes: #656923) -- Asias He Mon, 06 Feb 2012 05:18:24 +0000 zfs-fuse (0.7.0-4) unstable; urgency=low * Fix "FTBFS on sparc: undefined reference to `ec_atomic_cas'" (Closes: #650807) * Fix "FTBFS: error: #error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined" (Closes: #598923) -- Asias He Fri, 13 Jan 2012 10:01:07 +0800 zfs-fuse (0.7.0-3) unstable; urgency=low * Fix "fails to run, segfault or invalid option due to wrong argv[0] when read cfg file is called from main" (Closes: #647326) -- Asias He Wed, 02 Nov 2011 15:04:37 +0800 zfs-fuse (0.7.0-2) unstable; urgency=low * Import patches from upstream git tree maint branch -- Asias He Mon, 31 Oct 2011 19:27:51 +0800 zfs-fuse (0.7.0-1) unstable; urgency=low * New upstream release * Set maintainer to Asias He * Set Vcs to git.debian.org * Set DM-Upload-Allowed to yes * Do not distribute sbin/ztest * Add debian/zfs-fuse.lintian-overrides * Drop debian/patches/debian-changes-0.6.9-1 * Bump Standards-Version to 3.9.2 -- Asias He Sun, 18 Sep 2011 19:16:36 +0800 zfs-fuse (0.6.9-1) unstable; urgency=low * New upstream release. [ Mike Hommey ] * debian/control: - Build depend on libssl-dev and libattr1-dev, now required to build. - Build depend on docbook-xml to avoid xsltproc I/O error loading docbook DTD. - Add suggestions for a NFS server and kpartx. * debian/man/*, debian/copyright, debian/rules: Remove manual pages, they are now shipped upstream. * debian/copyright: Change download link. * src/SConstruct: - Add an optim option to the build system. - Add support for DESTDIR. - Force debug=1 to mean optim, no strip, no debug. - Use -ffunction-sections, -fdata-sections, and --gc-sections flags to reduce the binary sizes. * src/lib/libumem/SConscript: Cleanup src/lib/libumem when cleaning up build directory. * src/cmd/*/SConscript: Don't link zfs, zpool and zdb against libssl. * src/lib/libumem/SConscript: Only build static libumem. * src/lib/libumem/sol_compat.h: - Add atomic cas support for sparc. - Use atomic functions from libsolcompat in libumem on unsupported platforms. * debian/rules: - Set optimization level in build system according to DEB_BUILD_OPTIONS. - Build with debug=1 to have unstripped binaries ; dh_strip will do the right thing. - Don't depend on the local location of the docbook XSLT stylesheets. Use the catalogged url in place of the full path. - Don't clean src/.sconsign.dblite and src/path.pyc. - Set all destination directories when installing with scons. - Install bash completion and zfsrc files. - Don't use scons cache when building. * debian/prerm: Remove /var/lib/zfs/zpool.cache in prerm. * debian/dirs: Create /etc/bash_completion.d. * debian/watch: Fix watch file. * debian/rules, debian/control, debian/compat: Switch to dh. * debian/README.Debian: Update README.Debian. * debian/zfs-fuse.man.xml: Update zfs-fuse manual page. * debian/zfs-fuse.init: Start sharing datasets marked as such at daemon startup. * debian/rules, debian/control: Use config.guess and config.sub from autotools-dev. [ Seth Heeren ] * debian/zfs-fuse.man.xml: Added notes on the precedence, zfsrc, commandline, initscript vs. /etc/default/zfs-fuse on some systems. * debian/zfs-fuse.init, debian/zfs-fuse.default: Deprecating DAEMON_OPTS. * debian/zfs-fuse.init: - Removing import -a -f. - Removing the now unnecessary 'sleep 2'. - Extended shutdown wait to allow for zfs-fuse daemon's own shutdown timeouts. - Re-ordered dubious PATH setting. * debian/zfs-fuse.init: Move existing zpool.cache to new location if possible. -- Mike Hommey Wed, 30 Jun 2010 18:03:52 +0200 zfs-fuse (0.6.0+critical20100301-5) unstable; urgency=low * Silence the init script a bit in case zfs-fuse was disabled (Closes: #581668). -- Sebastien Delafond Thu, 20 May 2010 14:36:06 +0200 zfs-fuse (0.6.0+critical20100301-4) unstable; urgency=low * Start the daemon with limits removed and LANG unset, and immunize it against the OOM killer, as per http://rudd-o.com/en/linux-and-free-software/starting-zfs-fuse-up-properly. -- Sebastien Delafond Wed, 12 May 2010 12:53:09 +0200 zfs-fuse (0.6.0+critical20100301-3) unstable; urgency=low * Disable debug mode, per http://zfs-fuse.net/issues/33 (LP: #538847). -- Sebastien Delafond Tue, 27 Apr 2010 13:59:45 +0200 zfs-fuse (0.6.0+critical20100301-2) unstable; urgency=low * Updated Homepage: field, and removed incorrect Vcs-*: info, from control file. * Moved to quilt (3.0) source format. -- Sebastien Delafond Thu, 08 Apr 2010 13:00:04 +0200 zfs-fuse (0.6.0+critical20100301-1) unstable; urgency=low * Build from the official/critical branch, which contains several important fixes (Closes: #571978). -- Sebastien Delafond Mon, 01 Mar 2010 11:34:44 +0100 zfs-fuse (0.6.0-2) unstable; urgency=low * Added a watch file. * Bumped up Standards-Version. * Lintian fixes. -- Sebastien Delafond Sun, 21 Feb 2010 18:36:50 +0100 zfs-fuse (0.6.0-1) unstable; urgency=low * New upstream release. -- Sebastien Delafond Mon, 18 Jan 2010 14:25:14 +0100 zfs-fuse (0.6.0~beta+433snapshot-4) unstable; urgency=low * Versioned build-dep on libfuse-dev >= 2.8.1, since before that libfuse didn't set shlibs correctly, per #557143 (Closes: #559970). -- Sebastien Delafond Tue, 08 Dec 2009 09:07:45 +0100 zfs-fuse (0.6.0~beta+433snapshot-3) unstable; urgency=low * Start the init.d script a bit later (Closes: #558331). * Include a patch that fixes an out-of-memory error (Closes: #559552). * Add Mike Hommey to the list of uploaders. -- Sebastien Delafond Mon, 07 Dec 2009 20:40:16 +0100 zfs-fuse (0.6.0~beta+433snapshot-2) unstable; urgency=low * Optimistic Arch:any, waiting for potential FTBFS (#556944). -- Sebastien Delafond Wed, 18 Nov 2009 15:49:42 +0100 zfs-fuse (0.6.0~beta+433snapshot-1) unstable; urgency=low * Original release, based on Filip Brcic's () work (Closes: #419746). -- Sebastien Delafond Mon, 26 Oct 2009 16:22:44 +0100 debian/prerm0000644000000000000000000000171612013347557010252 0ustar #!/bin/sh # prerm script for zfs-fuse # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|deconfigure) invoke-rc.d zfs-fuse stop || exit $? rm -f /var/lib/zfs/zpool.cache ;; upgrade) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/compat0000644000000000000000000000000212013347557010373 0ustar 7 debian/postinst0000644000000000000000000000175512013347557011013 0ustar #!/bin/sh # postinst script for zfs-fuse # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) invoke-rc.d zfs-fuse restart --upgrade ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/dirs0000644000000000000000000000007512013347557010063 0ustar etc/zfs etc/bash_completion.d var/lib/zfs usr/share/man/man8 debian/README.Debian0000644000000000000000000000165112013347557011241 0ustar zfs-fuse for Debian ------------------- ZFS uses a very different configuration system than traditional filesystems in Debian. The full details may be found in zfs(8) and zpool(8); you can get started quickly with: # zpool create zfs hdx4 This will create a ZFS filesystem mounted at /zfs on /dev/hdx4. For more details please see the relevant manpages and/or the website[1]. zfs-fuse currently should not be used with system volumes such as /var or /usr. /home will probably work (but see below about stability). zfs-fuse requires a FUSE module for your kernel. Pre-built modules are included in recent debian kernels. Please note that zfs-fuse is not proven stable enough for production use, although we have gone long times without reported data loss. It is not yet recommended for production data or on production systems. [1] - http://zfs-fuse.net/ -- Mike Hommey Fri, 11 Jun 2010 16:20:42 +0200 debian/patches/0000755000000000000000000000000012161600566010620 5ustar debian/patches/fixing-xattr-lookup-for-symlinks.patch0000644000000000000000000000232712013347557020237 0ustar From 43db46c01365f2402be46d5b24ec5d2d8da90679 Mon Sep 17 00:00:00 2001 From: Seth Heeren Date: Fri, 19 Aug 2011 16:02:22 +0200 Subject: [PATCH 5/7] Fixing xattr lookup for symlinks Merged from commit a36c6f75b7b53499410d55d90c6bd4a4176ceda3 Author: Emmanuel Anne Date: Fri Aug 19 00:22:38 2011 +0200 a better fix for xattrs on symlinks apparently someone at sun just forgot to transfer the lookup operation to the table of operations for symlinks. Now xattrs work for symlinks too. --- src/zfs-fuse/zfs_vnops.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/zfs-fuse/zfs_vnops.c b/src/zfs-fuse/zfs_vnops.c index b45fc7d..d26a37c 100644 --- a/src/zfs-fuse/zfs_vnops.c +++ b/src/zfs-fuse/zfs_vnops.c @@ -4740,6 +4740,7 @@ const fs_operation_def_t zfs_symvnodeops_template[] = { VOPNAME_GETATTR, { .vop_getattr = zfs_getattr }, VOPNAME_SETATTR, { .vop_setattr = zfs_setattr }, VOPNAME_ACCESS, { .vop_access = zfs_access }, + VOPNAME_LOOKUP, { .vop_lookup = zfs_lookup }, VOPNAME_RENAME, { .vop_rename = zfs_rename }, VOPNAME_READLINK, { .vop_readlink = zfs_readlink }, VOPNAME_INACTIVE, { .vop_inactive = zfs_inactive }, -- 1.7.7.1 debian/patches/hanoi.cron.daily.patch0000644000000000000000000000441612013347557015011 0ustar diff --git a/contrib/hanoi.cron.daily b/contrib/hanoi.cron.daily new file mode 100644 index 0000000..a92b021 --- /dev/null +++ b/contrib/hanoi.cron.daily @@ -0,0 +1,68 @@ +#!/bin/bash + +# This algorithm implements a variation of the Towers of Hanoi rotation method +# (see http://en.wikipedia.org/wiki/Backup_rotation_scheme#Towers_of_Hanoi). +# +# Unlike traditional ToH rotation, which uses a finite set of physical tapes, +# we operate on a set of snapshots whose size doesn't necessarily have to be +# bounded. Note that the number of snapshots only grows logarithmically with +# time, which makes it very hard to fill your hard disk (even when running +# unbounded). +# +# The result is that once we've run this for long enough, we'll find that for +# recent dates (e.g. last few days) almost all snapshots are available, and the +# older the date we're searching the more spread available snapshots will be. + +set -e + +. /etc/default/zfs + +# Does $1 belong to class $2 ? +isclass () +{ + if [ "$2" == "$AUTOSNAP_MAX_SNAPSHOTS" ] ; then + # Special-case. Treat all snapshots as if they belong to + # this class (in addition to their real class). + return 0 + fi + local remainder=$((2 ** ($2 - 1))) + local divisor=$((${remainder} * 2)) + [ $(($1 % ${divisor})) == ${remainder} ] +} + +classify () +{ + local creation="$1" + local creation_in_days="$(($(LANG=C date +%s -d "@${creation}") / 86400))" + local class="1" + # Find the class ${creation_in_days} belongs to. + while ! isclass "${creation_in_days}" "${class}" ; do + class=$((${class}+1)) + done + echo "${class}" +} + +for fs in $AUTOSNAP_FILESYSTEMS ; do + # Create today's snapshot. + echo zfs snapshot ${fs}@autosnap-$(date +%F) + zfs snapshot ${fs}@autosnap-$(date +%F) + + # Remove any snapshots in the same class as today's addition. + LANG=C zfs list -r ${fs} -t snapshot -H -o name,creation \ + | grep @autosnap- \ + | while read name creation_human ; do + creation="$(LANG=C date +%s -d "${creation_human}")" + echo "$(classify "${creation}") ${creation} ${name}" + done \ + | sort -nr \ + | while read class creation name ; do + echo ${class} ${name} + if [ ${class} == "${previous_class}" ] ; then + echo zfs destroy "${name}" + zfs destroy "${name}" + fi + previous_class="${class}" + done +done + +exit 0 -- 1.7.10.4 debian/patches/fix-manpage-section-mismatch.patch0000644000000000000000000000606412013347557017314 0ustar --- zfs-fuse-0.7.0.orig/doc/zfs.8 +++ zfs-fuse-0.7.0/doc/zfs.8 @@ -6,7 +6,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH zfs 1M "21 Dec 2009" "SunOS 5.11" "System Administration Commands" +.TH zfs 8 "21 Dec 2009" "SunOS 5.11" "System Administration Commands" .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS --- zfs-fuse-0.7.0.orig/doc/zstreamdump.8 +++ zfs-fuse-0.7.0/doc/zstreamdump.8 @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH zstreamdump 1M "21 Sep 2009" "SunOS 5.11" "System Administration Commands" +.TH zstreamdump 8 "21 Sep 2009" "SunOS 5.11" "System Administration Commands" .SH NAME zstreamdump \- filter data in zfs send stream .SH SYNOPSIS --- zfs-fuse-0.7.0.orig/doc/zpool.8 +++ zfs-fuse-0.7.0/doc/zpool.8 @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH zpool 1M "4 Jan 2010" "SunOS 5.11" "System Administration Commands" +.TH zpool 8 "4 Jan 2010" "SunOS 5.11" "System Administration Commands" .SH NAME zpool \- configures ZFS storage pools .SH SYNOPSIS debian/patches/fix-ec_atomic_cas.patch0000644000000000000000000000440512013347557015205 0ustar diff --git a/src/lib/libumem/sol_compat.h b/src/lib/libumem/sol_compat.h index 858a026..9250e18 100644 --- a/src/lib/libumem/sol_compat.h +++ b/src/lib/libumem/sol_compat.h @@ -176,23 +176,15 @@ static INLINE uint_t ec_atomic_cas(uint_t *mem, uint_t with, uint_t cmp) : "memory"); return prev; } -# endif - -# ifndef ec_atomic_inc -static INLINE uint_t ec_atomic_inc(uint_t *mem) +# elif defined(__sparc__) && defined(__GNUC__) +static INLINE uint_t ec_atomic_cas(uint_t *mem, uint_t with, uint_t cmp) { - register uint_t last; - do { - last = *mem; - } while (ec_atomic_cas(mem, last+1, last) != last); - return ++last; + __asm volatile ("cas [%3],%2,%0" + : "+r"(with), "=m"(*(mem)) + : "r"(cmp), "r"(mem), "m"(*(mem)) ); + return with; } # endif -# ifndef ec_atomic_inc64 - /* yeah, it's not great. It's only used to bump failed allocation - * counts, so it is not critical right now. */ -# define ec_atomic_inc64(a) (*a)++ -# endif #endif @@ -208,8 +200,37 @@ static INLINE uint_t ec_atomic_inc(uint_t *mem) #define ISP2(x) (((x) & ((x) - 1)) == 0) /* beware! umem only uses these atomic adds for incrementing by 1 */ +#if defined(_WIN32) || (defined(__GNUC__) && \ + (defined(__i386__) || defined(__x86_64__) || defined(__sparc__))) +# ifndef ec_atomic_inc +static INLINE uint_t ec_atomic_inc(uint_t *mem) +{ + register uint_t last; + do { + last = *mem; + } while (ec_atomic_cas(mem, last+1, last) != last); + return ++last; +} +# endif +# ifndef ec_atomic_inc64 + /* yeah, it's not great. It's only used to bump failed allocation + * counts, so it is not critical right now. */ +# define ec_atomic_inc64(a) (*a)++ +# endif + #define atomic_add_64(lvalptr, delta) ec_atomic_inc64(lvalptr) #define atomic_add_32_nv(a, b) ec_atomic_inc(a) +#elif defined(__powerpc) || defined(__powerpc__) ||\ + defined(__powerpc64) || defined(__powerpc64__) +# ifndef ec_atomic_inc64 +# define ec_atomic_inc64(a) (*a)++ +# endif +#define atomic_add_64(lvalptr, delta) ec_atomic_inc64(lvalptr) +#define atomic_add_32_nv(a, b) ec_atomic_inc(a) +#else +extern uint32_t atomic_add_32_nv(volatile uint32_t *, int32_t); +extern void atomic_add_64(volatile uint64_t *, int64_t); +#endif #ifndef NANOSEC #define NANOSEC 1000000000 debian/patches/fix-segfault.patch0000644000000000000000000000120312013347557014237 0ustar diff --git a/src/zfs-fuse/main.c b/src/zfs-fuse/main.c index e8191bc..c57fc01 100644 --- a/src/zfs-fuse/main.c +++ b/src/zfs-fuse/main.c @@ -401,8 +401,12 @@ static void read_cfg() { { // prepend dashes for short or long options const char* original = argv[1]; - if ('-'!=*original) - VERIFY(-1 != asprintf(&argv[1], strlen(original)>1? "--%s" : "-%s", original)); + int original_len; + original_len = strlen(original); + if ('-'!=*original) { + argv[1] = malloc(original_len + 2); + snprintf(argv[1], original_len + 2, strlen(original)>1? "--%s" : "-%s", original); + } // parse parse_args(argc,argv); debian/patches/fixed-a-rogue-pointer-in-the-handling-of-pidfile-opt.patch0000644000000000000000000000150412013347557023537 0ustar From 7b2127a04471412b435be8ecc542971ea2773183 Mon Sep 17 00:00:00 2001 From: Seth Heeren Date: Wed, 7 Sep 2011 03:00:35 +0200 Subject: [PATCH 7/7] Fixed a rogue pointer in the handling of pidfile option --- src/zfs-fuse/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/zfs-fuse/main.c b/src/zfs-fuse/main.c index 32543ab..668ba4a 100644 --- a/src/zfs-fuse/main.c +++ b/src/zfs-fuse/main.c @@ -251,7 +251,7 @@ static void parse_args(int argc, char *argv[]) if (cf_pidfile != NULL) syslog(LOG_WARNING,"%s: duplicate pid-file setting, prior setting '%s' ignored", progname, cf_pidfile); - cf_pidfile = optarg; + cf_pidfile = strdup(optarg); if (cf_pidfile == NULL) { fprintf(stderr, "%s: you need to specify a file name\n\n", progname); -- 1.7.7.1 debian/patches/fixed-wrong-flag-value-on-enable-xattr.patch0000644000000000000000000000115112013347557021113 0ustar From d66593d025263f4deb4fe6d5df9c6a01fea6a2c7 Mon Sep 17 00:00:00 2001 From: Seth Heeren Date: Thu, 18 Aug 2011 22:01:05 +0200 Subject: [PATCH 3/7] fixed wrong flag value on --enable-xattr Reported by Hannes Landeholm --- src/zfs-fuse/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/zfs-fuse/main.c b/src/zfs-fuse/main.c index e8191bc..32543ab 100644 --- a/src/zfs-fuse/main.c +++ b/src/zfs-fuse/main.c @@ -158,7 +158,7 @@ static struct option longopts[] = { { "enable-xattr", 0, &cf_enable_xattr, - 0 + 1 }, { 0, 0, 0, 0 } }; -- 1.7.7.1 debian/patches/flush.patch0000644000000000000000000000114312020063666012757 0ustar diff --git a/src/lib/libzpool/flushwc.c b/src/lib/libzpool/flushwc.c index 344a61f..d625db2 100644 --- a/src/lib/libzpool/flushwc.c +++ b/src/lib/libzpool/flushwc.c @@ -130,12 +130,16 @@ static int flushATAwc(int fd) { */ int flushwc(vnode_t *vn) { int major_number; + int minor_number; if(!S_ISBLK(vn->v_stat.st_mode)) // We can only flush the write cache of a block device. return ENOTSUP; major_number = major(vn->v_stat.st_rdev); + minor_number = minor(vn->v_stat.st_rdev); + if (minor_number % 16 != 0) + return ENOTSUP; switch(major_number) { case SCSI_DISK0_MAJOR: debian/patches/series0000644000000000000000000000061012161600566012032 0ustar fixed-a-rogue-pointer-in-the-handling-of-pidfile-opt.patch fixed-wrong-flag-value-on-enable-xattr.patch fixing-xattr-lookup-for-symlinks.patch reviewed-INSTALL-file-as-per-1331.patch fix-scons-warnings.patch fix-manpage-section-mismatch.patch fix-segfault.patch fix-ec_atomic_cas.patch fix-malloc-for-newer-glibc.patch zfs-fuse.automated.scrub.cron.d.patch hanoi.cron.daily.patch flush.patch debian/patches/fix-scons-warnings.patch0000644000000000000000000000467512013347557015420 0ustar From e23fc0bbee1da912523dd70616116228980400ed Mon Sep 17 00:00:00 2001 From: "Stefan G. Weichinger" Date: Mon, 14 Mar 2011 19:44:25 +0100 Subject: [PATCH 1/7] fix scons warnings --- src/lib/libnvpair/SConscript | 4 ++-- src/lib/libzfscommon/SConscript | 4 ++-- src/lib/libzpool/SConscript | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/libnvpair/SConscript b/src/lib/libnvpair/SConscript index 4562f82..ada74fa 100644 --- a/src/lib/libnvpair/SConscript +++ b/src/lib/libnvpair/SConscript @@ -1,7 +1,7 @@ Import('env') -BuildDir('build-user', '.', duplicate = 0) -BuildDir('build-kernel', '.', duplicate = 0) +VariantDir('build-user', '.', duplicate = 0) +VariantDir('build-kernel', '.', duplicate = 0) objects = Split('libnvpair.c nvpair.c nvpair_alloc_fixed.c nvpair_alloc_system.c') diff --git a/src/lib/libzfscommon/SConscript b/src/lib/libzfscommon/SConscript index c4eedf4..4c23a85 100644 --- a/src/lib/libzfscommon/SConscript +++ b/src/lib/libzfscommon/SConscript @@ -1,7 +1,7 @@ Import('env') -BuildDir('build-user', '.', duplicate = 0) -BuildDir('build-kernel', '.', duplicate = 0) +VariantDir('build-user', '.', duplicate = 0) +VariantDir('build-kernel', '.', duplicate = 0) objects = Split('compress.c list.c zfs_comutil.c zfs_deleg.c zfs_namecheck.c zfs_prop.c zpool_prop.c zprop_common.c') diff --git a/src/lib/libzpool/SConscript b/src/lib/libzpool/SConscript index e9700e8..1e56b39 100644 --- a/src/lib/libzpool/SConscript +++ b/src/lib/libzpool/SConscript @@ -1,7 +1,7 @@ Import('env') -BuildDir('build-user', '.', duplicate = 0) -BuildDir('build-kernel', '.', duplicate = 0) +VariantDir('build-user', '.', duplicate = 0) +VariantDir('build-kernel', '.', duplicate = 0) objects = Split('arc.c bplist.c dbuf.c dnode_sync.c dmu.c dmu_object.c dmu_objset.c dmu_send.c dmu_traverse.c dmu_tx.c dmu_zfetch.c dnode.c dsl_dataset.c dsl_deleg.c dsl_dir.c dsl_pool.c dsl_prop.c dsl_scrub.c dsl_synctask.c fletcher.c flushwc.c gzip.c lzjb.c metaslab.c refcount.c rprwlock.c rrwlock.c sha256.c spa.c spa_config.c spa_errlog.c spa_history.c spa_misc.c space_map.c txg.c uberblock.c unique.c util.c vdev.c vdev_cache.c vdev_file.c vdev_label.c vdev_mirror.c vdev_missing.c vdev_queue.c vdev_raidz.c vdev_root.c zap.c zap_leaf.c zap_micro.c zfs_byteswap.c zfs_fm.c zfs_fuid.c zfs_znode.c zil.c zio.c zio_checksum.c zio_compress.c zio_inject.c kmem_asprintf.c ddt.c ddt_zap.c zle.c') -- 1.7.7.1 debian/patches/fix-malloc-for-newer-glibc.patch0000644000000000000000000000073012161600365016651 0ustar Description: Newer GLibC changes the way __malloc_initialize_hook is initialized Author: Ben Collins --- zfs-fuse-0.7.0.orig/src/lib/libumem/malloc.c +++ zfs-fuse-0.7.0/src/lib/libumem/malloc.c @@ -453,7 +453,7 @@ static void __attribute__((constructor)) } } -void (*__malloc_initialize_hook)(void) = umem_malloc_init_hook; +void (* __volatile __malloc_initialize_hook)(void) = umem_malloc_init_hook; #else void __attribute__((constructor)) debian/patches/reviewed-INSTALL-file-as-per-1331.patch0000644000000000000000000000552512013347557017261 0ustar From 6215be75de69bc6a911e0b2838b72b2cfc301a73 Mon Sep 17 00:00:00 2001 From: Seth Heeren Date: Wed, 15 Jun 2011 11:48:46 +0200 Subject: [PATCH 2/7] reviewed INSTALL file as per #1331 --- INSTALL | 45 +++++++++++++++++++++++---------------------- 1 files changed, 23 insertions(+), 22 deletions(-) diff --git a/INSTALL b/INSTALL index 5e5cf98..81d67b7 100644 --- a/INSTALL +++ b/INSTALL @@ -5,31 +5,22 @@ In order to compile and use zfs-fuse, you need the following: * Linux kernel 2.6.x (2.6.15 or later recommended). - * FUSE 2.5.x or greater (Gentoo users: FUSE-2.6.0rc1 and some -earlier pre-release versions have a bug that prevents zfs-fuse -from compiling correctly, simply upgrade to FUSE-2.6.0 or later). + * FUSE 2.8.x or greater You will need the fuse, fuse-utils and/or libfuse packages (and associated -dev packages), depending on the distribution. - * libaio and libaio-dev (or libaio-devel) packages. + * scons + * libfuse-dev (>= 2.8.1) + * zlib1g-dev + * libaio-dev + * libssl-dev + * libattr1-dev - * zlib (and associated headers usually provided by -dev package). +For building a debian package, you need debhelper (>= 7.0.50~) - * glibc version 2.3.3 or newer with NPTL enabled. - You can check these requirements with following commands: - - getconf GNU_LIBC_VERSION - getconf GNU_LIBPTHREAD_VERSION - - The output should be "glibc 2.3.3" and "NTPL 2.3.3" (or newer, - of course). - - * SCons (packaged in most distributions) - Only needed for compilation. - Website: http://www.scons.org - -Currently, it only works on the x86, amd64 and sparc64 architectures. +Currently, it only works on the x86, amd64 and powerpc (untested) +architectures. In order to use pools created on Solaris, you will probably need kernel support for GPT/EFI partitions. EVMS is highly recommended in this case, @@ -47,13 +38,23 @@ To compile follow these steps: 2) scons That's it! +The recommended flags for packaging are + + scons debug=1 optim=-O2 + +That way, you won't have the debug asserts (which _will_ fire in known +situations where recoverery would be possible; you don't want to enable debug +asserts if you want to have a resilient zfs-fuse setup). But the binaries will +have debug info attached. In most distributions it is customary to strip +binaries, but keep the versions with symbols so you can interpret stack traces +'from the wild'. -If the compilation fails, please report a bug. See the BUGS file for -instructions. +If the compilation fails, please report a bug. See http://zfs-fuse.net/issues Manpage ------- -If you want to update the zfs-fuse man page, edit doc/zfs-fuse.man.xml and run (on a debian-like host) +If you want to update the zfs-fuse man page, edit doc/zfs-fuse.man.xml and run +(on a debian-like host) apt-get install xsltproc docbook-xml docbook-xsl make -C doc/ -- 1.7.7.1 debian/patches/zfs-fuse.automated.scrub.cron.d.patch0000644000000000000000000000130112013347557017663 0ustar diff --git a/contrib/zfs-fuse.automated.scrub.cron.d b/contrib/zfs-fuse.automated.scrub.cron.d new file mode 100644 index 0000000..29f8d36 --- /dev/null +++ b/contrib/zfs-fuse.automated.scrub.cron.d @@ -0,0 +1,10 @@ +# +# Copyright © martin f. krafft +# distributed under the terms of the Artistic Licence 2.0 +# + +# By default, run at 00:57 on every Sunday, but do nothing unless the day of +# the month is less than or equal to 7. Thus, only run on the first Sunday of +# each month. crontab(5) sucks, unfortunately, in this regard; therefore this +# hack (see #380425). +57 0 * * 0 root if [ $(date +\%d) -le 7 ]; then zpool list -H -o name | xargs zpool scrub; fi -- 1.7.10.4 debian/copyright0000644000000000000000000005175412013347557011144 0ustar This package was debianized by Bryan Donlan on Tue, 17 Apr 2007 16:24:53 -0400. It was later modified by Filip Brcic and Sébastien Delafond . It was downloaded from http://zfs-fuse.net/ Upstream Authors: Ricardo Correia Copyright: zfs-fuse's source is a combination of: - Copyright (c) 1992-2001/2004/2006/2007/2008, Sun Microsystems Inc. - Copyright (c) 2006/2007 Ricardo Correia. - Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T. - Copyright (c) 1982, 1986, 1988 The Regents of the University of California. - Copyright (c) 1991-2006 Unicode, Inc. - Copyright (c) 1989 by Hewlett-Packard Company & Digital Equipment Corporation. - Copyright (c) 1990-1993, 1996 Open Software Foundation, Inc. - Copyright (c) 1998 Microsoft. - Copyright (c) 2007 Jeremy Teo. - Copyright (c) 2008 Eric Anopolsky - Copyright (c) 2006 OmniTI, Inc. The ZFS-FUSE software and manual pages are licenced under the CDDL, which is reproduced at the end of this file. The Debian packaging is Copyright (c) 2007, Bryan Donlan and is dual-licensed under the GPL, see `/usr/share/common-licenses/GPL-2', and the CDDL. The text of the CDDL follows: COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 1. Definitions. 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications. 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. 1.4. "Executable" means the Covered Software in any form other than Source Code. 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License. 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. 1.7. "License" means this document. 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. "Modifications" means the Source Code and Executable form of any of the following: A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; B. Any new file that contains any part of the Original Software or previous Modification; or C. Any new file that is contributed or otherwise made available under the terms of this License. 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License. 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants. 2.1. The Initial Developer Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. 2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Availability of Source Code. Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. 3.2. Modifications. The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. 3.3. Required Notices. You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. 3.4. Application of Additional Terms. You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipientsÕ rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.5. Distribution of Executable Versions. You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipientÕs rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.6. Larger Works. You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. 4. Versions of the License. 4.1. New Versions. Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. 4.2. Effect of New Versions. You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. 4.3. Modified Versions. When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. 5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 6. TERMINATION. 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. 7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYÕS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 8. U.S. GOVERNMENT END USERS. The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. § 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. 9. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictionÕs conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneysÕ fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. 10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. debian/docs0000644000000000000000000000020312013347557010043 0ustar BUGS README README.NFS STATUS TESTING TODO contrib/zfs_pool_alert contrib/zfs-fuse.automated.scrub.cron.d contrib/hanoi.cron.daily debian/watch0000644000000000000000000000021612013347557010225 0ustar # format version number, currently 3; this line is compulsory! version=3 http://zfs-fuse.net/releases/(\d.+)/ \ .*zfs-fuse-(\d.+)\.tar\.bz2 debian/zfs-fuse.init0000644000000000000000000001463112013347557011631 0ustar #! /bin/bash ### BEGIN INIT INFO # Provides: zfs-fuse # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: S # Default-Stop: 0 6 # Short-Description: Daemon for ZFS support via FUSE # Description: Mounts and makes available ZFS volumes ### END INIT INFO # Author: Bryan Donlan set -u # Error on uninitialized variabled set -e # Error on uncaught non-zero exit codes PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin DAEMON=/sbin/zfs-fuse NAME=zfs-fuse DESC=zfs-fuse # also overriden from /etc/default/zfs-fuse: ENABLE_ZFS=yes DAEMON_OPTS="" # deprecated, prefer /etc/zfs/zfsrc RESTART_ON_UPGRADE=no if [ -r /lib/lsb/init-functions ]; then . /lib/lsb/init-functions fi FORCE_STOP=no upgrade_zpool_cache_location() { oldcache=/etc/zfs/zpool.cache # this changed per 0.6.9, only needed when upgrading from earlier versions newcache=/var/lib/zfs/zpool.cache if [[ -f $oldcache && ! -e $newcache ]]; then log_action_msg "Moving existing zpool.cache to new location" mkdir -p $(dirname $newcache) mv $oldcache $newcache else if [ -e $oldcache ]; then log_action_msg "Note: old zpool.cache present but no longer used ($oldcache)" fi fi } is_running() { ### XXX: this produces output for some reason start-stop-daemon --stop --test --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON &>/dev/null } do_stop() { if is_running; then log_action_begin_msg "Unmounting ZFS filesystems" if ! zfs umount -a; then log_action_end_msg 1 "possibly due to open files on mounted zfs volumes" if [ "x$FORCE_STOP" = "xyes" ]; then log_action_msg "Will forcibly terminate ZFS daemon" else return 1 fi else log_action_end_msg 0 fi log_daemon_msg "Stopping $NAME" "zfs-fuse" if start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON then ## wait for it to stop, up to 12 seconds ## 10 seconds is the wait time for worker threads to complete their ## work before the daemon forcibly terminates them and completes ## shutdown COUNTER=0 while is_running; do sleep 1 COUNTER=$(($COUNTER + 1)) if [ $COUNTER -ge 12 ]; then log_end_msg 1 "Timed out" exit 1 fi done rm -f /var/run/$NAME.pid log_end_msg 0 return 0 else log_end_msg 1 return 1 fi fi } do_start() { if is_running; then log_action_msg "zfs-fuse is already running." return 0 fi if [ "x$ENABLE_ZFS" != "xyes" ]; then log_action_msg "zfs-fuse is disabled by /etc/default/$NAME." >&2 return 0 fi upgrade_zpool_cache_location log_daemon_msg "Starting $NAME" "zfs-fuse" if [ -n "$DAEMON_OPTS" ]; then log_action_cont_msg "Warning: use of DAEMON_OPTS deprecated: use /etc/zfs/zfsrc instead" fi ulimit -v unlimited ulimit -c 512000 ulimit -l unlimited ulimit -s unlimited unset LANG if start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS --pidfile /var/run/$NAME.pid then log_end_msg 0 log_action_begin_msg "Immunizing $NAME against OOM kills and sendsigs signals" if [ -f "/proc/$(cat /var/run/$NAME.pid)/oom_score_adj" ] then echo -1000 > "/proc/$(cat /var/run/$NAME.pid)/oom_score_adj" else echo -17 > "/proc/$(cat /var/run/$NAME.pid)/oom_adj" fi ES_TO_REPORT=$? if [ "$ES_TO_REPORT" = 0 ] ; then log_action_end_msg 0 else log_action_end_msg 1 "code $ES_TO_REPORT" exit 3 fi log_action_begin_msg "Mounting ZFS filesystems" if zfs mount -a then zfs share -a; log_action_end_msg 0; return 0 else log_action_end_msg 1; return 1 fi else log_end_msg 1 return 1 fi } do_restart() { if is_running; then ## We don't want restart to act like stop ENABLE_ZFS=yes fi do_stop && sleep 1 && do_start } upgrade_restart() { if is_running && [ "x$RESTART_ON_UPGRADE" = "xno" ]; then echo "Not restarting $NAME; \$RESTART_ON_UPGRADE is set to 'no'" >&2 echo "Administrative binaries (zfs, zpool) may not work until" >&2 echo "zfs-fuse is restarted." >&2 exit 0 fi do_restart || { echo "Proceeding with upgrade anyway. Please note that administrative binaries" >&2 echo "such as zfs or zpool may not work properly until the zfs-fuse daemon is" >&2 echo "restarted." >&2 exit 0 } } test -x $DAEMON || exit 0 # Include zfs-fuse defaults if available if [ -f /etc/default/zfs-fuse ] ; then . /etc/default/zfs-fuse fi case "$1" in start) do_start || exit $? ;; stop) do_stop || exit $? ;; force-stop) FORCE_STOP=yes do_stop || exit $? ;; reload) echo "Nothing to do, exiting." >&2 exit 0 ;; # # If the daemon can reload its config files on the fly # for example by sending it SIGHUP, do it here. # # If the daemon responds to changes in its config file # directly anyway, make this a do-nothing entry. # # echo "Reloading $DESC configuration files." # start-stop-daemon --stop --signal 1 --quiet --pidfile \ # /var/run/$NAME.pid --exec $DAEMON #;; force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart" except that it does nothing if the # daemon isn't already running. # check wether $DAEMON is running. If so, restart is_running && $0 restart || exit $? ;; restart) ## --upgrade is an undocumented flag used by the postinst ## $2 may be undefined here set +u UPGRADE_FLAG="$2" set -u if [ "x$UPGRADE_FLAG" = "x--upgrade" ]; then upgrade_restart || exit $?; exit $? fi do_restart || exit $? ;; force-restart) FORCE_STOP=yes do_restart || exit $? ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|force-stop|restart|force-restart|force-reload}" >&2 exit 1 ;; esac exit 0 debian/zfs-fuse.lintian-overrides0000644000000000000000000000035112013347557014316 0ustar # the few code that really is GPL is dual-licensed anyways zfs-fuse: possible-gpl-code-linked-with-openssl # the script does have a stop rule, it looks like a false positive from lintian zfs-fuse: init.d-script-possible-missing-stop