]> git.proxmox.com Git - mirror_zfs-debian.git/log
mirror_zfs-debian.git
13 years agoMerge branch 'upstream' into kfreebsd
Darik Horn [Thu, 7 Apr 2011 18:48:28 +0000 (13:48 -0500)]
Merge branch 'upstream' into kfreebsd

13 years agoPrep zfs-0.6.0-rc3 tag
Brian Behlendorf [Thu, 7 Apr 2011 17:49:55 +0000 (10:49 -0700)]
Prep zfs-0.6.0-rc3 tag

Create the third 0.6.0 release candidate tag (rc3).

13 years agoUpdate zfs.fedora init script
Manuel Amador (Rudd-O) [Thu, 7 Apr 2011 17:34:20 +0000 (10:34 -0700)]
Update zfs.fedora init script

Apply all of Rudd-O's changes for the Fedora init script.  The
initial init script was one I threw together based on Rudd-O's
original work.  It worked for me but it has some flaws.

Rudd-O has invested considerable time updating it to be significantly
smarter.  It now handles using ZFS as your root filesystem plus
various other quirks.  Since he is familiar with the right
way to do things on Fedora and has tested this init script we
are integrating all of his changes.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
13 years agoUpstream zfs-0.6.0-rc3 tag. Use 0.6.0.7 instead.
Darik Horn [Thu, 7 Apr 2011 17:40:25 +0000 (12:40 -0500)]
Upstream zfs-0.6.0-rc3 tag. Use 0.6.0.7 instead.

13 years agoMerge branch 'upstream' into kfreebsd
Darik Horn [Thu, 7 Apr 2011 17:39:50 +0000 (12:39 -0500)]
Merge branch 'upstream' into kfreebsd

13 years agoPermit both mountpoint=legacy and mountpoint=/ in initrd
Manuel Amador (Rudd-O) [Wed, 6 Apr 2011 16:52:58 +0000 (09:52 -0700)]
Permit both mountpoint=legacy and mountpoint=/ in initrd

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
13 years agoAdded .gitignore for mount.zfs and zvol_id
Manuel Amador (Rudd-O) [Wed, 23 Mar 2011 05:18:07 +0000 (22:18 -0700)]
Added .gitignore for mount.zfs and zvol_id

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
13 years agoFix ASSERTION(!dsl_pool_sync_context(tx->tx_pool))
Brian Behlendorf [Thu, 31 Mar 2011 17:05:58 +0000 (10:05 -0700)]
Fix ASSERTION(!dsl_pool_sync_context(tx->tx_pool))

Disable the normal reclaim path for the txg_sync thread.  This
ensures the thread will never enter dmu_tx_assign() which can
otherwise occur due to direct reclaim.  If this is allowed to
happen the system can deadlock.  Direct reclaim call path:

  ->shrink_icache_memory->prune_icache->dispose_list->
  clear_inode->zpl_clear_inode->zfs_inactive->dmu_tx_assign

13 years agoAdd direct+indirect ARC reclaim
Brian Behlendorf [Wed, 30 Mar 2011 01:08:59 +0000 (18:08 -0700)]
Add direct+indirect ARC reclaim

Under OpenSolaris all memory reclaim is done asyncronously.  Under
Linux memory reclaim is done asynchronously _and_ synchronously.
When a process allocates memory with GFP_KERNEL it explicitly allows
the kernel to do reclaim on its behalf to satify the allocation.
If that GFP_KERNEL allocation fails the kernel may take more drastic
measures to reclaim the memory such as killing user space processes.

This was observed to happen with ZFS because the ARC could consume
a large fraction of the system memory but no synchronous reclaim
could be performed on it.  The result was GFP_KERNEL allocations
could fail resulting in OOM events, and only moments latter the
arc_reclaim thread would free unused memory from the ARC.

This change leaves the arc_thread in place to manage the fundamental
ARC behavior.  But it adds a synchronous (direct) reclaim path for
the ARC which can be called when memory is badly needed.  It also
adds an asynchronous (indirect) reclaim path which is called
much more frequently to prune the ARC slab caches.

13 years agoAdd missing arcstats
Brian Behlendorf [Thu, 24 Mar 2011 19:13:55 +0000 (12:13 -0700)]
Add missing arcstats

The following useful values were missing the arcstats.  This change
adds them in to provide greater visibility in to the arcs behavior.

arc_no_grow                     4    0
arc_tempreserve                 4    0
arc_loaned_bytes                4    0
arc_meta_used                   4    624774592
arc_meta_limit                  4    400785408
arc_meta_max                    4    625594176

13 years agoCall d_instantiate before unlocking inode
Brian Behlendorf [Wed, 30 Mar 2011 06:04:39 +0000 (23:04 -0700)]
Call d_instantiate before unlocking inode

Under Linux a dentry referencing an inode must be instantiated before
the inode is unlocked.  To accomplish this without overly modifing
the core ZFS code the dentry it passed via the vattr_t.  There are
cases such as replay when a dentry is not available.  In which case
it is obviously not initialized at inode creation time, if a dentry
is needed it will be spliced as when required via d_lookup().

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Thu, 7 Apr 2011 15:53:18 +0000 (10:53 -0500)]
Use git-dch to update the debian/changelog.

13 years agoPartial autogen updates.
Darik Horn [Wed, 6 Apr 2011 14:04:00 +0000 (09:04 -0500)]
Partial autogen updates.

The previous commit failed to compile properly in the PPA build
environment because the configure script was not updated.

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Wed, 6 Apr 2011 03:11:03 +0000 (22:11 -0500)]
Use git-dch to update the debian/changelog.

13 years agoFull upstream merge. Use zfs-0.6.0.6 as the unofficial upstream version.
Darik Horn [Wed, 6 Apr 2011 03:05:43 +0000 (22:05 -0500)]
Full upstream merge. Use zfs-0.6.0.6 as the unofficial upstream version.

13 years agoRemove volume and swap handling from the init script.
Darik Horn [Wed, 6 Apr 2011 02:41:01 +0000 (21:41 -0500)]
Remove volume and swap handling from the init script.

Managing volumes and swap areas in the init script like
Debian kFreeBSD does is appealing, but providing an
alternative management facility for these things adds
unnecessary complexity.

13 years agoAdd ${shlibs:Depends} to each control stanza.
Darik Horn [Wed, 6 Apr 2011 02:15:17 +0000 (21:15 -0500)]
Add ${shlibs:Depends} to each control stanza.

Satisfy the dpkg-gencontrol warning and specify the external
dependencies for each library package.

13 years agoMove udev rules from /etc to /lib.
Darik Horn [Wed, 6 Apr 2011 01:44:56 +0000 (20:44 -0500)]
Move udev rules from /etc to /lib.

Install 60-zpool.rules and 60-zvol.rules to /lib/udev/rules.d
instead of /etc/udev/rules.d according to packaging convention.

13 years agoDisable dracut instead of reverting it.
Darik Horn [Wed, 6 Apr 2011 01:29:51 +0000 (20:29 -0500)]
Disable dracut instead of reverting it.

13 years agoRename /etc/default/zfsload during upgrades.
Darik Horn [Wed, 6 Apr 2011 01:06:00 +0000 (20:06 -0500)]
Rename /etc/default/zfsload during upgrades.

Preserve the /etc/default/zfsload configuration file by
renaming it to /etc/default/zfs during the replacement
upgrade from the zfs package to the zfsutils package.

13 years agoIgnore `zfs unmount -a` errors in the init script.
Darik Horn [Wed, 6 Apr 2011 00:42:49 +0000 (19:42 -0500)]
Ignore `zfs unmount -a` errors in the init script.

The default dh_installinit prerm script tries to stop the zfs init
script, which causes package upgrade errors on busy systems.

13 years agoRemove `make distclean` kludge.
Darik Horn [Wed, 6 Apr 2011 00:37:00 +0000 (19:37 -0500)]
Remove `make distclean` kludge.

The module/Makefile.in template is updated such that
`make distclean` succeeds after `./configure --with-config=user`.

13 years agoMerge branch 'upstream' into kfreebsd
Darik Horn [Wed, 6 Apr 2011 00:36:11 +0000 (19:36 -0500)]
Merge branch 'upstream' into kfreebsd

13 years agoFix `make distclean` for `./configure --with-config=user
Brian Behlendorf [Tue, 5 Apr 2011 20:13:01 +0000 (13:13 -0700)]
Fix `make distclean` for `./configure --with-config=user

    Making distclean in module
    make[1]: Entering directory `/zfs/module'
    make -C  SUBDIRS=`pwd`  clean
    make: Entering an unknown directory
    make: *** SUBDIRS=/zfs/module: No such file or directory.  Stop.

When using --with-config=user the 'distclean' target would fail
because it assumes the kernel configuration infrastrure is set up.
This is not the case, nor does it need to be, because the
'--with-config=user' option will prune the entire ./module subtree
from SUBDIRS.  This prevents most build rules from operating in the
./module directory.

However, the 'dist*' rules will still traverse this directory
because it is listed in DIST_SUBDIRS.  This is correct because we
need to ensure the dist rules package the directory contents
regardless of the configuration for the 'dist' rule.  The correct
way to handle this is to only invoke the kernel build system as
part of the 'clean' rule when CONFIG_KERNEL_TRUE is set.

Initial fix provided by Darik Horn <dajhorn@vanadac.com>.
This commit is a slightly refined form of the original.

13 years agoCall udevadm trigger more safely
Ned Bass [Fri, 1 Apr 2011 16:47:05 +0000 (09:47 -0700)]
Call udevadm trigger more safely

Some udev hooks are not designed to be idempotent, so calling udevadm
trigger outside of the distribution's initialization scripts can have
unexpected (and potentially dangerous) side effects.  For example, the
system time may change or devices may appear multiple times.  See Ubuntu
launchpad bug 320200 and this mailing list post for more details:

https://lists.ubuntu.com/archives/ubuntu-devel/2009-January/027260.html

To avoid these problems we call udevadm trigger with --action=change
--subsystem-match=block.  The first argument tells udev just to refresh
devices, and make sure everything's as it should be.  The second
argument limits the scope to block devices, so devices belonging to
other subsystems cannot be affected.

This doesn't fix the problem on older udev implementations that don't
provide udevadm but instead have udevtrigger as a standalone program.
In this case the above options aren't available so there's no way to
call call udevtrigger safely.  But we can live with that since this
issue only exists in optional test and helper scripts, and most
zfs-on-linux users are running newer systems anyways.

13 years agoUpdate CHAOS 5 Packaging
Brian Behlendorf [Thu, 31 Mar 2011 20:43:49 +0000 (13:43 -0700)]
Update CHAOS 5 Packaging

The CHAOS 5 kernels are now packaged identially to the RHEL6 kernels.
Therefore we can simply use the RHEL6 rules in the spec file when
building packages.

13 years agoFix libzpool cv_* build error
Brian Behlendorf [Thu, 31 Mar 2011 19:16:24 +0000 (12:16 -0700)]
Fix libzpool cv_* build error

This build failure was accidentally introduced by previous commit
bfd214a which fixed the load average.  Unfortunately, the wrapper
for cv_wait_interruptible was not available in the zfs_context.h
user compatibility code.  I failed to notice this because I didn't
rebuild everything cleanly before committing.

  undefined reference to `cv_wait_interruptible'
  collect2: ld returned 1 exit status

Closes #181

13 years agoFix inflated load average
Brian Behlendorf [Fri, 1 Apr 2011 00:07:12 +0000 (17:07 -0700)]
Fix inflated load average

Kernel threads which sleep uninterruptibly on Linux are marked in the (D)
state.  These threads are usually in the process of performing IO and are
thus counted against the load average.  The txg_quiesce and txg_sync threads
were always sleeping uninterruptibly and thus inflating the load average.

This change makes them sleep interruptibly.  Some care is required however
because these threads may now be woken early by signals.  In this case the
callers are all careful to check that the required conditions are met after
waking up.  If we're woken early due to a signal they will simply go back
to sleep.  In this case these changes are safe.

Closes #175

13 years agoManually update the debian/changelog.
Darik Horn [Thu, 31 Mar 2011 16:04:23 +0000 (11:04 -0500)]
Manually update the debian/changelog.

13 years agoForce the dkms.conf file into the zfs-dkms package.
Darik Horn [Thu, 31 Mar 2011 15:54:06 +0000 (10:54 -0500)]
Force the dkms.conf file into the zfs-dkms package.

Rename the debian/dkms file to debian/zfs-dkms.dkms so that
the dkms.conf file is included in the zfs-dkms package.

The dh_dkms debhelper put the dkms.conf file into the
libavl0 package after the library decomposition, which
caused upgrade errors.

13 years agoManually update the debian/changelog.
Darik Horn [Wed, 30 Mar 2011 21:14:16 +0000 (16:14 -0500)]
Manually update the debian/changelog.

13 years agoAdd the /etc/default/zfs import to the init script.
Darik Horn [Wed, 30 Mar 2011 21:00:45 +0000 (16:00 -0500)]
Add the /etc/default/zfs import to the init script.

The init script is disabled by default.

13 years agoLink /proc/mounts to /etc/mtab.
Darik Horn [Wed, 30 Mar 2011 20:37:08 +0000 (15:37 -0500)]
Link /proc/mounts to /etc/mtab.

During system start, the /etc/init/mountall.conf on Ubuntu is unable to
generate the /etc/mtab file from the /proc/mounts file if a ZFS filesystem is
already mounted.

However, mountall 2.18 behaves properly if /etc/mtab is a symlink to
/proc/mounts.  This version was first published in Ubuntu Maverick.

Additionally, the mountall package is peculiar to Ubuntu, so the mountall
dependency breaks Debian compatibility.  A better solution would be to update
mountall to recognize ZFS mounts, or to find a proc syntax that mountall
already recognizes.

13 years agoManually update the debian/changelog.
Darik Horn [Wed, 30 Mar 2011 18:56:13 +0000 (13:56 -0500)]
Manually update the debian/changelog.

13 years agoMerge branch 'master' into kfreebsd
Darik Horn [Wed, 30 Mar 2011 17:25:02 +0000 (12:25 -0500)]
Merge branch 'master' into kfreebsd

Conflicts:
debian/changelog

13 years agoPrint initramfs errors in a sensible order.
Darik Horn [Wed, 30 Mar 2011 04:35:14 +0000 (23:35 -0500)]
Print initramfs errors in a sensible order.

If the zfs script must drop into a recovery shell, then print the error message
and error number after the command invocation that failed.

13 years agoUse `mount.zfs` instead of `zfs mount` in the initramfs.
Darik Horn [Wed, 30 Mar 2011 04:07:29 +0000 (23:07 -0500)]
Use `mount.zfs` instead of `zfs mount` in the initramfs.

Revert to mounting the root filesytem like this:

  mount -t zfs -o zfsutil "$ZFS_BOOTFS" "$rootmnt"

Ideally, the root filesystem would be mounted like this:

  zpool import -R "$rootmnt" -N "$ZFS_RPOOL"
  zfs mount -o mountpoint=/ "$ZFS_BOOTFS"

but the MOUNTPOINT prefix is preserved on descendent filesystems after the
pivot into the regular root, which later breaks things like `zfs mount -a` and
the /etc/mtab refresh.

Assuming one filesystem on the pivot and implicitly remapping it is sensible
behavior for the exec init.  Keeping the -R prefix is similarly sensible
behavior for the zfs utility.  Thus, the initramfs is probably the best place
to do something unusual.

13 years agoDisable volinit and volfini in the init script.
Darik Horn [Tue, 29 Mar 2011 17:49:43 +0000 (12:49 -0500)]
Disable volinit and volfini in the init script.

The `zfs volinit` and `zfs volfini` commands are unimplemented.

13 years agoDisable `zfs ushare -a`, which is unimplemented on Linux.
Darik Horn [Tue, 29 Mar 2011 17:46:51 +0000 (12:46 -0500)]
Disable `zfs ushare -a`, which is unimplemented on Linux.

13 years agoAdd standard Linux paths to the init script.
Darik Horn [Tue, 29 Mar 2011 17:26:13 +0000 (12:26 -0500)]
Add standard Linux paths to the init script.

13 years agoManually update the debian/changelog.
Darik Horn [Tue, 29 Mar 2011 17:19:34 +0000 (12:19 -0500)]
Manually update the debian/changelog.

13 years agoAdd a zfs conflict to the zfsutils package.
Darik Horn [Tue, 29 Mar 2011 17:13:07 +0000 (12:13 -0500)]
Add  a zfs conflict to the zfsutils package.

This is required because the kFreeBSD /etc/init.d/zfs script
conflicts with the KQ /etc/init.d/zfsload script.

13 years agoChange BSD runlevels to Linux runlevels.
Darik Horn [Tue, 29 Mar 2011 17:02:14 +0000 (12:02 -0500)]
Change BSD runlevels to Linux runlevels.

The unmodified init script from Debian kFreeBSD causes
these warnings during installation:

  update-rc.d: warning: zfs start runlevel arguments (2 3 4 5)
    do not match LSB Default-Start values (S)
  update-rc.d: warning: zfs stop runlevel arguments (0 1 6)
    do not match LSB Default-Stop values (0 6)

13 years agoManually update the debian/changelog.
Darik Horn [Tue, 29 Mar 2011 16:07:46 +0000 (11:07 -0500)]
Manually update the debian/changelog.

13 years agoAdd a zfs-lib replacement to each constituent library.
Darik Horn [Tue, 29 Mar 2011 16:04:56 +0000 (11:04 -0500)]
Add a zfs-lib replacement to each constituent library.

Add "Replaces: zfs-lib" to each library in the debian/control
so that upgrades happen smooothly.

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Tue, 29 Mar 2011 14:19:11 +0000 (09:19 -0500)]
Use git-dch to update the debian/changelog.

13 years agoChange usr/lib/include to usr/include in the libzfs-dev.install file.
Darik Horn [Tue, 29 Mar 2011 14:10:30 +0000 (09:10 -0500)]
Change usr/lib/include to usr/include in the libzfs-dev.install file.

The libzfs-dev.install file has an incorrect path.

13 years agoAdd libzfs-dev to the debian/control file.
Darik Horn [Thu, 24 Mar 2011 20:38:28 +0000 (15:38 -0500)]
Add libzfs-dev to the debian/control file.

The libzfs-dev package provides a virtual libuutil-dev
and a virtual libnvpair-for compatibility with Debian kFreeBSD.

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Mon, 28 Mar 2011 03:14:51 +0000 (22:14 -0500)]
Use git-dch to update the debian/changelog.

13 years agoHandle the GRUB zfs-bootfs parameter in the initramfs.
Darik Horn [Sat, 26 Mar 2011 05:23:31 +0000 (00:23 -0500)]
Handle the GRUB zfs-bootfs parameter in the initramfs.

13 years agoUse /sbin/mount.zfs for the root mount in the initramfs.
Darik Horn [Sat, 26 Mar 2011 04:04:38 +0000 (23:04 -0500)]
Use /sbin/mount.zfs for the root mount in the initramfs.

13 years agoSpec file compat, %{datadir}
Fajar A. Nugraha [Fri, 25 Mar 2011 17:01:28 +0000 (10:01 -0700)]
Spec file compat, %{datadir}

The dracut change caused an error during "make rpm".  The cause
is simple, RHEL5 does not recognize the %{datarootdir} macro in
zfs.spec.  It was changed to %{datadir} which fixes the build.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
13 years agoSet cmd paths in udev rules using --prefix
Brian Behlendorf [Thu, 24 Mar 2011 18:34:41 +0000 (11:34 -0700)]
Set cmd paths in udev rules using --prefix

The udev/rules.d scripts must use absolute paths to their support
binaries.  However, where those binaries get installed depends
on what --prefix was set to when the package was configured.
This change makes the udev/rules.d helpers to *.in files which
are processed by configure.  This allows them to be dynamically
updated to include the specified --prefix.

Additionally, this change updates 60-zvol.rules to handle both
the 'add' and 'change' actions.  This ensures that that all
valid zvol devices are correctly linked.

13 years agoReplace zfs-lib by libzfs0 and zfs by zfsutils
Darik Horn [Thu, 24 Mar 2011 20:29:15 +0000 (15:29 -0500)]
Replace zfs-lib by libzfs0 and zfs by zfsutils
in the debian/control file.

13 years agoCheck zvols for Linux swap areas instead of FreeBSD swap areas.
Darik Horn [Thu, 24 Mar 2011 19:58:56 +0000 (14:58 -0500)]
Check zvols for Linux swap areas instead of FreeBSD swap areas.

Debian kFreeBSD checks for the org.freebsd:swap property on
zvols at startup, so do the same on Linux systems.

13 years agoImport the zfsutils init script from Debian kFreeBSD.
Darik Horn [Thu, 24 Mar 2011 19:56:54 +0000 (14:56 -0500)]
Import the zfsutils init script from Debian kFreeBSD.

13 years agoRemove the KQ init script that was imported from zfs-linux/lzfs.
Darik Horn [Thu, 24 Mar 2011 19:54:39 +0000 (14:54 -0500)]
Remove the KQ init script that was imported from zfs-linux/lzfs.

13 years agoRestrict the package architecture to linux-any.
Darik Horn [Thu, 24 Mar 2011 19:29:37 +0000 (14:29 -0500)]
Restrict the package architecture to linux-any.

This source package is specifically for Linux and incompatible
with the Hurd and kFreeBSD kernels.

13 years agoDecompose the zfs-lib package.
Darik Horn [Thu, 24 Mar 2011 19:21:49 +0000 (14:21 -0500)]
Decompose the zfs-lib package.

The constituent packages are libspl0, libavl0, libefi0, libnvpair0,
libunicode0, libuutil0, libzpool0, and libzfs0.

This change reflects the Debian kFreeBSD packaging.

13 years agoFixes to enable zvol symlink creation
Fajar A. Nugraha [Thu, 24 Mar 2011 08:22:52 +0000 (15:22 +0700)]
Fixes to enable zvol symlink creation

This commit fixes issue on
https://github.com/behlendorf/zfs/issues/#issue/172
Changes:
- update BLKZNAME to use _IOR instead of _IO.  Kernel 2.6.32 allows
read parameters (copy_to_user) with _IO, while newer kernels (tested
Archlinux's 2.6.37 kernel) enforces _IOR (which is correct)
- fix return code and message on error

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
13 years agoRename the zfs-lib package to libzfs0.
Darik Horn [Thu, 24 Mar 2011 18:36:47 +0000 (13:36 -0500)]
Rename the zfs-lib package to libzfs0.

This change reflects the Debian kFreeBSD packaging.

13 years agoRename the zfs package to zfsutils.
Darik Horn [Thu, 24 Mar 2011 18:33:56 +0000 (13:33 -0500)]
Rename the zfs package to zfsutils.

This change reflects the Debian kFreeBSD packaging.

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Thu, 24 Mar 2011 17:38:16 +0000 (12:38 -0500)]
Use git-dch to update the debian/changelog.

13 years agoInclude /sbin/mount.zfs in the zfs package.
Darik Horn [Thu, 24 Mar 2011 17:36:58 +0000 (12:36 -0500)]
Include /sbin/mount.zfs in the zfs package.

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Wed, 23 Mar 2011 04:08:52 +0000 (23:08 -0500)]
Use git-dch to update the debian/changelog.

13 years agoRemove the whack-bang and execute bit from the initramfs boot script.
Darik Horn [Wed, 23 Mar 2011 02:08:15 +0000 (21:08 -0500)]
Remove the whack-bang and execute bit from the initramfs boot script.

This change reflects the scripts/local and scripts/nfs files that
are provided by the initramfs-tools package.

13 years agoProperly strip the bootfs= and rpool= kernel command line parameters.
Darik Horn [Wed, 23 Mar 2011 02:02:59 +0000 (21:02 -0500)]
Properly strip the bootfs= and rpool= kernel command line parameters.

13 years agoQuilt refresh.
Darik Horn [Tue, 22 Mar 2011 21:41:00 +0000 (16:41 -0500)]
Quilt refresh.

13 years agoRevert the init script commit in debian/patches.
Darik Horn [Tue, 22 Mar 2011 21:33:18 +0000 (16:33 -0500)]
Revert the init script commit in debian/patches.

Revert ae26d0465a234d7b340566287908c78fe24901e1 because the system
init should be sacrosanct and handled exclusively by the packager.

13 years agoRevert the dracut commit in debian/patches.
Darik Horn [Tue, 22 Mar 2011 21:29:43 +0000 (16:29 -0500)]
Revert the dracut commit in debian/patches.

Revert ae26d0465a234d7b340566287908c78fe24901e1 because dracut
is experimental and not currently tested with the PPA builds.

13 years agoFull upstream merge. Use zfs-0.6.0.5 as the unofficial upstream version.
Darik Horn [Tue, 22 Mar 2011 21:24:38 +0000 (16:24 -0500)]
Full upstream merge. Use zfs-0.6.0.5 as the unofficial upstream version.

13 years agoMerge branch 'upstream'
Darik Horn [Tue, 22 Mar 2011 21:13:53 +0000 (16:13 -0500)]
Merge branch 'upstream'

13 years agoMerge remote-tracking branch 'behlendorf/master' into upstream
Darik Horn [Tue, 22 Mar 2011 21:12:42 +0000 (16:12 -0500)]
Merge remote-tracking branch 'behlendorf/master' into upstream

13 years agoLinux 2.6.29 compat, .freeze_fs/.unfreeze_fs
Brian Behlendorf [Tue, 22 Mar 2011 18:22:49 +0000 (11:22 -0700)]
Linux 2.6.29 compat, .freeze_fs/.unfreeze_fs

The .freeze_fs/.unfreeze_fs hooks were not added until Linux 2.6.29
Since these hooks are currently unused they are being removed to
allow support of older kernels.

13 years agoLinux 2.6.29 compat, credentials
Brian Behlendorf [Tue, 22 Mar 2011 18:13:41 +0000 (11:13 -0700)]
Linux 2.6.29 compat, credentials

As of Linux 2.6.29 a clean credential API was added to the Linux kernel.
Previously the credential was embedded in the task_struct.  Because the
SPL already has considerable support for handling this API change the
ZPL code has been updated to use the Solaris credential API.

13 years agoLinux 2.6.28 compat, insert_inode_locked()
Brian Behlendorf [Tue, 22 Mar 2011 16:55:09 +0000 (09:55 -0700)]
Linux 2.6.28 compat, insert_inode_locked()

Added insert_inode_locked() helper function, prior to this most callers
used insert_inode_hash().  The older method doesn't check for collisions
in the inode_hashtable but it still acceptible for use.  Fallback to
using insert_inode_hash() when insert_inode_locked() is unavailable.

13 years agoLinux 2.6.27 compat, blk_queue_stackable()
Brian Behlendorf [Tue, 22 Mar 2011 16:26:38 +0000 (09:26 -0700)]
Linux 2.6.27 compat, blk_queue_stackable()

The blk_queue_stackable() queue flag was added in 2.6.27 to handle dm
stacking drivers.  Prior to this request stacking drivers were detected
by checking (q->request_fn == NULL), for earlier kernels we revert to
this legacy behavior.

13 years agoLinux compat, umount2(2) flags
Brian Behlendorf [Mon, 21 Mar 2011 23:54:59 +0000 (16:54 -0700)]
Linux compat, umount2(2) flags

Older glibc <sys/mount.h> headers did not define all the available
umount2(2) flags.  Both MNT_FORCE and MNT_DETACH are supported in the
kernel back to 2.4.11 so we define them correctly if they are missing.

Closes #95

13 years agoFix evict() deadlock
Brian Behlendorf [Mon, 21 Mar 2011 17:19:30 +0000 (10:19 -0700)]
Fix evict() deadlock

Now that KM_SLEEP is not defined as GFP_NOFS there is the possibility
of synchronous reclaim deadlocks.  These deadlocks never existed in the
original OpenSolaris code because all memory reclaim on Solaris is done
asyncronously.  Linux does both synchronous (direct) and asynchronous
(indirect) reclaim.

This commit addresses a deadlock caused by inode eviction.  A KM_SLEEP
allocation may trigger direct memory reclaim and shrink the inode cache.
This can occur while a mutex in the array of ZFS_OBJ_HOLD mutexes is
held.  Through the ->shrink_icache_memory()->evict()->zfs_inactive()->
zfs_zinactive() call path the same mutex may be reacquired resulting
in a deadlock.  To avoid this deadlock the process must not reacquire
the mutex when it is already holding it.

This is a reasonable fix for now but longer term the ZFS_OBJ_HOLD
mutex locking should be reevaluated.  This infrastructure already
prevents us from ever using the Linux lock dependency analysis tools,
and it may limit scalability.

13 years agoUse KM_PUSHPAGE instead of KM_SLEEP
Brian Behlendorf [Sat, 19 Mar 2011 21:34:30 +0000 (14:34 -0700)]
Use KM_PUSHPAGE instead of KM_SLEEP

It used to be the case that all KM_SLEEP allocations were GFS_NOFS.
Unfortunately this often resulted in the kernel being unable to
reclaim the ARC, inode, and dentry caches in a timely manor.
The fix was to make KM_SLEEP a GFP_KERNEL allocation in the SPL.

However, this increases the posibility of deadlocking the system
on a zfs write thread.  If a zfs write thread attempts to perform
an allocation it may trigger synchronous reclaim.  This reclaim
may attempt to flush dirty data/inode to disk to free memory.
Unforunately, this write cannot finish because the write thread
which would handle it is holding the previous transaction open.
Deadlock.

To avoid this all allocations in the zfs write thread path must
use KM_PUSHPAGE which prohibits synchronous reclaim for that
thread.  In this way forward progress in ensured.  The risk
with this change is I missed updating an allocation for the
write threads leaving an increased posibility of deadlock.  If
any deadlocks remain they will be unlikely but we'll have to
make sure they all get fixed.

13 years agoMerge branch 'dracut'
Brian Behlendorf [Tue, 22 Mar 2011 19:13:04 +0000 (12:13 -0700)]
Merge branch 'dracut'

13 years agoUpdate debian/changelog using git-dch.
Darik Horn [Mon, 21 Mar 2011 00:11:46 +0000 (19:11 -0500)]
Update debian/changelog using git-dch.

Correct typos in the debian/debuild-ppa.sh helper.

Set extend-diff-ignore='.*' in the debian/source/options file to
disable the automatic patch generated by the implied
--single-debian-patch during PPA builds for more than one series.

The debian/patches/debian-changes-* files do not contain a useful
history and only add cruft to the PPA builds.  If this source
package is added to a regular repository, then the
extend-diff-ignore option should be disabled.

13 years agoRemove the init-top/hostname script and force BUSYBOX=y instead.
Darik Horn [Sun, 20 Mar 2011 22:51:59 +0000 (17:51 -0500)]
Remove the init-top/hostname script and force BUSYBOX=y instead.

The pre-init script in the initramfs environment sets the hostname
if the regular /bin/hostname binary and the /etc/hostname file are
included by the hook.

The pre-init invokes `/bin/hostname -b -F /etc/hostname`, which is
incompatible with the busybox builtin because it lacks the '-b'
switch.

This commit mysteriously resolves the console corruption that
occasionally happens on systems that boot into a native ZFS root
filesystem.

13 years agoTrivial typo correction in the debian/copyright file.
Darik Horn [Sun, 20 Mar 2011 22:40:17 +0000 (17:40 -0500)]
Trivial typo correction in the debian/copyright file.

13 years agoUpdate debian/changelog using git-dch.
Darik Horn [Sun, 20 Mar 2011 20:29:18 +0000 (15:29 -0500)]
Update debian/changelog using git-dch.

13 years agoAdd the pkg-zfs repository to the debian/copyright file.
Darik Horn [Sun, 20 Mar 2011 20:10:00 +0000 (15:10 -0500)]
Add the pkg-zfs repository to the debian/copyright file.

13 years agoAdd fix-gentoo-ldflags.patch from behlendorf/master.
Darik Horn [Sun, 20 Mar 2011 20:07:30 +0000 (15:07 -0500)]
Add fix-gentoo-ldflags.patch from behlendorf/master.

13 years agoAdd fix-getcwd-warning.patch from behlendorf/master.
Darik Horn [Sun, 20 Mar 2011 20:02:35 +0000 (15:02 -0500)]
Add fix-getcwd-warning.patch from behlendorf/master.

13 years agoFix 'LDFLAGS=-Wl,--as-needed' build error
Brian Behlendorf [Fri, 18 Mar 2011 21:47:19 +0000 (14:47 -0700)]
Fix 'LDFLAGS=-Wl,--as-needed' build error

Compiling with 'LDFLAGS=-Wl,--as-needed' exposed the fact that
there were some library linking problems introduced by mount_zfs.
In particular, the libzfs library does use nvpair symbols, and
mount_zfs contains no dependencies on libzpool.

Closes #161
Closes #162

13 years agoFix getcwd() warning
Brian Behlendorf [Fri, 18 Mar 2011 20:54:27 +0000 (13:54 -0700)]
Fix getcwd() warning

New versions glibc declare getcwd() with the warn_unused_result attribute.
This results in a warning because the updated mount helper was not
checking this return value.  This issue was fixed by checking the return
type and in the case of an error simply returning the passed dataset.
One possible, but unlikely, error would be having your cwd directory
unlinked while the mount command was running.

  cmd/mount_zfs/mount_zfs.c: In function ‘parse_dataset’:
  cmd/mount_zfs/mount_zfs.c:223:2: error: ignoring return value of
      ‘getcwd’, declared with attribute warn_unused_result

13 years agoAdd dracut support
Manuel Amador (Rudd-O) [Thu, 17 Mar 2011 22:18:13 +0000 (15:18 -0700)]
Add dracut support

To simplify the process of using zfs as your root filesystem a
zfs-drucat sub-package has been added.  This sub-package adds a zfs
dracut module which allows your initramfs to be rebuilt with zfs
support.  The process for doing this is still complicated but there
is clearly interest from the community about getting this working
well and documented.  This should help lay some of the groundwork.

Longer term these changes should be pushed in the upstream dracut
package.  Once that occurs this subpackage will no longer be
required for new systems, however we may want to conditionally
build this package in the future for systems running older
dracut versions.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
13 years agoAdd init scripts
Brian Behlendorf [Thu, 17 Mar 2011 22:02:28 +0000 (15:02 -0700)]
Add init scripts

To support automatically mounting your zfs on filesystem on boot
a basic init script is needed.  Unfortunately, every distribution
has their own idea of the _right_ way to do things.  Rather than
write one very complicated portable init script, which would be
invariably replaced by the distributions own anyway.  I have
instead added support to provide multiple distribution specific
init scripts.

The correct init script for your distribution will be selected
by ZFS_AC_DEFAULT_PACKAGE which will set DEFAULT_INIT_SCRIPT.
During 'make install' the correct script for your system will
be installed from zfs/etc/init.d/zfs.DEFAULT_INIT_SCRIPT to the
usual /etc/init.d/zfs location.

Currently, there is zfs.fedora and a more generic zfs.lsb init
script.  Hopefully, the distribution maintainers who know best
how they want their init scripts to function will feedback their
approved versions to be included in the project.

This change does not consider upstart jobs but I'm not at all
opposed to add that sort of thing.

13 years agoAdd the debuild-ppa.sh script for Launchpad PPA build convenience.
Darik Horn [Wed, 16 Mar 2011 17:12:59 +0000 (12:12 -0500)]
Add the debuild-ppa.sh script for Launchpad PPA build convenience.

13 years agoAdd behlendorf/dracut patch for better dismount handling at shutdown.
Darik Horn [Wed, 16 Mar 2011 14:18:22 +0000 (09:18 -0500)]
Add behlendorf/dracut patch for better dismount handling at shutdown.

13 years agoRegister .remount_fs handler
Brian Behlendorf [Tue, 15 Mar 2011 19:41:19 +0000 (12:41 -0700)]
Register .remount_fs handler

Register the missing .remount_fs handler.  This handler isn't strictly
required because the VFS does a pretty good job updating most of the
MS_* flags.  However, there's no harm in using the hook to call the
registered zpl callback for various MS_* flags.  Additionaly, this
allows us to lay the ground work for more complicated argument parsing
in the future.

13 years agoRegister .sync_fs handler
Brian Behlendorf [Tue, 15 Mar 2011 19:03:42 +0000 (12:03 -0700)]
Register .sync_fs handler

Register the missing .sync_fs handler.  This is a noop in most cases
because the usual requirement is that sync just be initiated.  As part
of the DMU's normal transaction processing txgs will be frequently
synced.  However, when the 'wait' flag is set the requirement is that
.sync_fs must not return until the data is safe on disk.  With the
addition of the .sync_fs handler this is now properly implemented.

13 years agoStrip 'zfsutil,remount' from /etc/mtab
Brian Behlendorf [Tue, 15 Mar 2011 18:17:33 +0000 (11:17 -0700)]
Strip 'zfsutil,remount' from /etc/mtab

When updating /etc/mtab we should be careful and strip certain
options.  In particular, we need to strip 'zfsutil' because if
we don't the mount utility will helpfull provide it to the
mount helper when we issue mount(8) again.  This subverts the
check that the caller is zfs(8) and not mount(8).

13 years agoAlways allow '-o remount,ro'
Brian Behlendorf [Tue, 15 Mar 2011 16:34:56 +0000 (09:34 -0700)]
Always allow '-o remount,ro'

Allow the mount(8) utility to always operate on all datasets when
remounting them read-only.  This critical for rc.sysinit/umountroot
which remounts the root filesystem read-only during shutdown to
ensure everything is correctly flushed to disk.

Fix minor typo, the check to set zfsutil should use the bitwise
'&'.  I must have accidentally hit the adjacent '*' and obviously
neither the compiler or my code review caught this.  Fix it now.

13 years agoAdd gawk dependency to the zfs-initramfs package.
Darik Horn [Mon, 14 Mar 2011 03:56:36 +0000 (22:56 -0500)]
Add gawk dependency to the zfs-initramfs package.

13 years agoAdd patches from behlendorf/master:
Darik Horn [Mon, 14 Mar 2011 03:41:50 +0000 (22:41 -0500)]
Add patches from behlendorf/master:
  check-for-trailing-slash-in-mount.patch
  do-not-set-io-scheduler-for-partitions.patch