Commit Graph

1849 Commits

Author SHA1 Message Date
Darik Horn
04e6a04428 Add the /etc/default/zfs import to the init script.
The init script is disabled by default.
2011-03-30 16:00:45 -05:00
Darik Horn
306e8c226f 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.
2011-03-30 15:37:08 -05:00
Darik Horn
8fe86da5bd Manually update the debian/changelog. 2011-03-30 13:56:13 -05:00
Darik Horn
c5cc1c565f Merge branch 'master' into kfreebsd
Conflicts:
	debian/changelog
2011-03-30 12:25:02 -05:00
Darik Horn
daf3069029 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.
2011-03-29 23:35:14 -05:00
Darik Horn
2a146a6299 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.
2011-03-29 23:22:50 -05:00
Darik Horn
1e72baf3e7 Disable volinit and volfini in the init script.
The `zfs volinit` and `zfs volfini` commands are unimplemented.
2011-03-29 12:49:43 -05:00
Darik Horn
21181f858a Disable zfs ushare -a, which is unimplemented on Linux. 2011-03-29 12:46:51 -05:00
Darik Horn
fe7ab85dbf Add standard Linux paths to the init script. 2011-03-29 12:26:13 -05:00
Darik Horn
4664faef74 Manually update the debian/changelog. 2011-03-29 12:20:07 -05:00
Darik Horn
3d2f411bb0 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.
2011-03-29 12:13:07 -05:00
Darik Horn
f35fcf4869 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)
2011-03-29 12:02:14 -05:00
Darik Horn
adfbb73cb1 Manually update the debian/changelog. 2011-03-29 11:07:46 -05:00
Darik Horn
525f35fd5c 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.
2011-03-29 11:04:56 -05:00
Darik Horn
f2fc86d78e Use git-dch to update the debian/changelog. 2011-03-29 09:19:11 -05:00
Darik Horn
b2a859dccc Change usr/lib/include to usr/include in the libzfs-dev.install file.
The libzfs-dev.install file has an incorrect path.
2011-03-29 09:10:30 -05:00
Darik Horn
9e5db36fa3 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.
2011-03-29 09:03:58 -05:00
Darik Horn
ba60bc28be Use git-dch to update the debian/changelog. 2011-03-27 22:14:51 -05:00
Darik Horn
a1c01b895e Handle the GRUB zfs-bootfs parameter in the initramfs. 2011-03-27 22:10:24 -05:00
Darik Horn
05bac65109 Use /sbin/mount.zfs for the root mount in the initramfs. 2011-03-25 23:04:38 -05:00
Fajar A. Nugraha
1f5fd9d478 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>
2011-03-25 10:08:49 -07:00
Brian Behlendorf
1d82906dea 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.
2011-03-25 10:05:09 -07:00
Darik Horn
4db4de46d0 Replace zfs-lib by libzfs0 and zfs by zfsutils
in the debian/control file.
2011-03-24 15:29:15 -05:00
Darik Horn
712910f1d4 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.
2011-03-24 14:58:56 -05:00
Darik Horn
80a3ae582b Import the zfsutils init script from Debian kFreeBSD. 2011-03-24 14:56:54 -05:00
Darik Horn
f38f4dc599 Remove the KQ init script that was imported from zfs-linux/lzfs. 2011-03-24 14:54:39 -05:00
Darik Horn
01b298ec0c Restrict the package architecture to linux-any.
This source package is specifically for Linux and incompatible
with the Hurd and kFreeBSD kernels.
2011-03-24 14:29:37 -05:00
Darik Horn
0a1dbd11af 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.
2011-03-24 14:29:19 -05:00
Fajar A. Nugraha
a5729f7b22 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>
2011-03-24 11:48:18 -07:00
Darik Horn
e546eb4b3f Rename the zfs-lib package to libzfs0.
This change reflects the Debian kFreeBSD packaging.
2011-03-24 13:36:47 -05:00
Darik Horn
cb1b5cd769 Rename the zfs package to zfsutils.
This change reflects the Debian kFreeBSD packaging.
2011-03-24 13:33:56 -05:00
Darik Horn
51c06ddc1a Use git-dch to update the debian/changelog. 2011-03-24 12:38:16 -05:00
Darik Horn
824214dc05 Include /sbin/mount.zfs in the zfs package. 2011-03-24 12:36:58 -05:00
Darik Horn
d64815aeb0 Use git-dch to update the debian/changelog. 2011-03-22 23:08:52 -05:00
Darik Horn
93da34ec50 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.
2011-03-22 23:05:11 -05:00
Darik Horn
69ed3baa13 Properly strip the bootfs= and rpool= kernel command line parameters. 2011-03-22 21:05:04 -05:00
Darik Horn
cd8afdc357 Quilt refresh. 2011-03-22 16:41:00 -05:00
Darik Horn
a3a6b5d37d Revert the init script commit in debian/patches.
Revert ae26d0465a because the system
init should be sacrosanct and handled exclusively by the packager.
2011-03-22 16:33:18 -05:00
Darik Horn
ddd9880e8f Revert the dracut commit in debian/patches.
Revert ae26d0465a because dracut
is experimental and not currently tested with the PPA builds.
2011-03-22 16:29:43 -05:00
Darik Horn
dfe9a0f301 Full upstream merge. Use zfs-0.6.0.5 as the unofficial upstream version. 2011-03-22 16:24:38 -05:00
Darik Horn
d6c837a764 Merge branch 'upstream' 2011-03-22 16:13:53 -05:00
Darik Horn
8b9fee25db Merge remote-tracking branch 'behlendorf/master' into upstream 2011-03-22 16:12:42 -05:00
Brian Behlendorf
7a1cdc0775 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.
2011-03-22 12:17:24 -07:00
Brian Behlendorf
81e97e2187 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.
2011-03-22 12:15:54 -07:00
Brian Behlendorf
bdf4328b04 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.
2011-03-22 12:15:54 -07:00
Brian Behlendorf
3517f0b7e9 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.
2011-03-22 12:15:54 -07:00
Brian Behlendorf
1073d746d6 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
2011-03-22 12:15:54 -07:00
Brian Behlendorf
d6bd8eaae4 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.
2011-03-22 12:14:55 -07:00
Brian Behlendorf
691f6ac4c2 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.
2011-03-22 12:14:55 -07:00
Brian Behlendorf
f47c42e214 Merge branch 'dracut' 2011-03-22 12:13:04 -07:00