]> git.proxmox.com Git - mirror_zfs-debian.git/log
mirror_zfs-debian.git
12 years agoAlign parition end on 1 MiB boundary
Ned Bass [Wed, 29 Feb 2012 18:08:20 +0000 (10:08 -0800)]
Align parition end on 1 MiB boundary

Some devices have exhibited sensitivity to the ending alignment of
partitions.  In particular, even if the first partition begins at 1
MiB, we have seen many sd driver task abort errors with certain SSDs
if the first partition doesn't end on a 1 MiB boundary.  This occurs
when the vdev label is read during pool creation or importation and
causes a delay of about 30 seconds per device.  It can also be
simulated with dd when the pool isn't imported:

  dd if=/dev/sda1 of=/dev/null bs=262144 count=1

For the record, this problem was observed with SMARTMOD
SG9XCA2E200GE01 200GB SSDs.  Unfortunately I don't have a good
explanation for this behavior. It seems to have something to do with
highly fragmented single-sector requests being issued to the device,
which it may not support.  With end-aligned partitions at least
page-sized requests were queued and issued to the driver according
to blktrace. In any case, aligning the partition end is a fairly
innocuous work-around, wasting at most 1 MiB of space.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #574

12 years agoUse SA_HDL_PRIVATE for SA xattrs
Brian Behlendorf [Fri, 2 Mar 2012 18:35:50 +0000 (10:35 -0800)]
Use SA_HDL_PRIVATE for SA xattrs

A private SA handle must be used to ensure we can drop the dbuf
hold on the spill block prior to calling dmu_tx_commit().  If we
call dmu_tx_commit() before sa_handle_destroy(), then our hold
will trigger a copy of the dbuf to be made.  This is done to
prevent data from leaking in to the syncing txg.  As a result
the original dirty spill block will remain cached.

Additionally, relying on the shared zp->z_sa_hdl is unsafe in
the xattr context because the znode may be asynchronously dropped
from the cache.  It's far safer and simpler just to use a private
handle for xattrs.  Plus any additional overhead is offset by
the avoidance of the previously mentioned memory copy.

These forever dirty buffers can be noticed in the arcstats under
the anon_size.  On a quiescent system the value should be zero.
Without this fix and a SA xattr write workload you will see
anon_size increase.  Eventually, if enough dirty data builds up
your system it will appear to hang.  This occurs because the dmu
won't allow new txs to be assigned until that dirty data is
flushed, and it won't be because it's not part of an assigned tx.

As an aside, I typically see anon_size lurk around 16k so I think
there is another place in the code which needs a similar fix.
However, this value doesn't grow over time so it isn't critical.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #503
Issue #513

12 years agoCleanly support debug packages
Brian Behlendorf [Mon, 27 Feb 2012 18:12:40 +0000 (10:12 -0800)]
Cleanly support debug packages

Allow a source rpm to be rebuilt with debugging enabled.  This
avoids the need to have to manually modify the spec file.  By
default debugging is still largely disabled.  To enable specific
debugging features use the following options with rpmbuild.

  '--with debug'               - Enables ASSERTs

  # For example:
  $ rpmbuild --rebuild --with debug zfs-modules-0.6.0-rc6.src.rpm

Additionally, ZFS_CONFIG has been added to zfs_config.h for
packages which build against these headers.  This is critical
to ensure both zfs and the dependant package are using the same
prototype and structure definitions.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd 'dmu_tx' kstats entry
Brian Behlendorf [Fri, 20 Jan 2012 18:58:57 +0000 (10:58 -0800)]
Add 'dmu_tx' kstats entry

Keep counters for the various reasons that a thread may end up
in txg_wait_open() waiting on a new txg.  This can be useful
when attempting to determine why a particular workload is
under performing.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd arc_state_t stats to arcstats
Brian Behlendorf [Mon, 30 Jan 2012 21:28:40 +0000 (13:28 -0800)]
Add arc_state_t stats to arcstats

To ensure the arc is behaving properly we need greater visibility
in to exactly how it's managing the systems memory.  This patch
takes one step in that direction be adding the current arc_state_t
for the anon, mru, mru_ghost, mfu, and mfs_ghost lists.  The l2
arc_state_t is already well represented in the arcstats.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoReturn success from check_slice() if device doesn't exist
Ned Bass [Sat, 25 Feb 2012 00:37:41 +0000 (16:37 -0800)]
Return success from check_slice() if device doesn't exist

When creating a new pool, make_root_vdev() calls check_in_use() to
ensure that none of the consituent disks are in use.  If the disk
contains a valid vdev label it is read to retrieve the list of its
child vdevs and these are checked recursively.  However, the
partitions stored in the vdev label my no longer exist, for example
if the partition table has since been altered.  In any such case we
would want the pool creation to proceed, so this change removes the
check from check_slice() that returns an error if the device doesn't
exist.  As an added assurance, the Solaris implementation also
returns sucess on ENOENT.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoExport symbols for zero-copy
Alex Zhuravlev [Fri, 17 Feb 2012 20:09:21 +0000 (12:09 -0800)]
Export symbols for zero-copy

Export additional symbols to make use of the DMU's zero-copy
API.  This allows external modules to move data in to and out of
the ARC without incurring the cost of a memory copy.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoSupport ashift=13 for 8KB SSD block sizes
Richard Yao [Mon, 13 Feb 2012 15:38:58 +0000 (10:38 -0500)]
Support ashift=13 for 8KB SSD block sizes

New SSDs are now available which use an internal 8k block size.
To make sure ZFS can get the maximum performance out of these
devices we're increasing the maximum ashift to 13 (8KB).

This value is still small enough that we can fit 16 uberblocks
in the vdev ring label.  However, I don't want to increase this
any futher or it will limit the ability the safely roll back a
pool to recover it.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #565

12 years agoAdd 'fsid' mount option to allowed options.
Turbo Fredriksson [Mon, 13 Feb 2012 09:27:01 +0000 (10:27 +0100)]
Add 'fsid' mount option to allowed options.

Resolves nfs-utils-1.0.x compatibility issue which requires
that the fsid be set in the export options.

  exportfs: Warning: /tank/dir requires fsid= for NFS export

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #570

12 years agoExport symbols for zero-copy
Brian Behlendorf [Fri, 10 Feb 2012 19:53:09 +0000 (11:53 -0800)]
Export symbols for zero-copy

Exported the required symbols to make use of the DMU's zero-copy
API.  This allows external modules to move data in to and out of
the ARC without incurring the cost of a memory copy.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoUse spl_debug_* helpers
Brian Behlendorf [Fri, 10 Feb 2012 00:33:55 +0000 (16:33 -0800)]
Use spl_debug_* helpers

When configuring the spl debug log support use the provided wrapper
functions.  This ensures that if --disable-debug-log was used when
buiding the spl the functions will have no effect.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd support for DISCARD to ZVOLs.
Etienne Dechamps [Fri, 2 Sep 2011 13:23:12 +0000 (15:23 +0200)]
Add support for DISCARD to ZVOLs.

DISCARD (REQ_DISCARD, BLKDISCARD) is useful for thin provisioning.
It allows ZVOL clients to discard (unmap, trim) block ranges from
a ZVOL, thus optimizing disk space usage by allowing a ZVOL to
shrink instead of just grow.

We can't use zfs_space() or zfs_freesp() here, since these functions
only work on regular files, not volumes. Fortunately we can use the
low-level function dmu_free_long_range() which does exactly what we
want.

Currently the discard operation is not added to the log. That's not
a big deal since losing discard requests cannot result in data
corruption. It would however result in disk space usage higher than
it should be. Thus adding log support to zvol_discard() is probably
a good idea for a future improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoSupport the fallocate() file operation.
Etienne Dechamps [Fri, 2 Sep 2011 07:42:07 +0000 (09:42 +0200)]
Support the fallocate() file operation.

Currently only the (FALLOC_FL_PUNCH_HOLE) flag combination is
supported, since it's the only one that matches the behavior of
zfs_space(). This makes it pretty much useless in its current
form, but it's a start.

To support other flag combinations we would need to modify
zfs_space() to make it more flexible, or emulate the desired
functionality in zpl_fallocate().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #334

12 years agoCheck permissions in zfs_space().
Etienne Dechamps [Fri, 2 Sep 2011 07:37:53 +0000 (09:37 +0200)]
Check permissions in zfs_space().

This isn't done on Solaris because on this OS zfs_space() can
only be called with an opened file handle. Since the addition of
zpl_truncate_range() this isn't the case anymore, so we need to
enforce access rights.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #334

12 years agoImplement the truncate_range() inode operation.
Etienne Dechamps [Thu, 1 Sep 2011 11:59:41 +0000 (13:59 +0200)]
Implement the truncate_range() inode operation.

This operation allows "hole punching" in ZFS files. On Solaris this
is done via the vop_space() system call, which maps to the zfs_space()
function. So we just need to write zpl_truncate_range() as a wrapper
around zfs_space().

Note that this only works for regular files, not ZVOLs.

This is currently an insecure implementation without permission
checking, although this isn't that big of a deal since truncate_range()
isn't even callable from userspace.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #334

12 years agoFix zconfig.sh non-optimal alignment
Brian Behlendorf [Thu, 9 Feb 2012 18:38:03 +0000 (10:38 -0800)]
Fix zconfig.sh non-optimal alignment

The recent zvol improvements have changed default suggested alignment
for zvols from 512b (default) to 8k (zvol blocksize).  Because of this
the zconfig.sh tests which create paritions are now generating a
warning about non-optimal alignments.

This change updates the need zconfig.sh tests such that a partition
will be properly aligned.  In the process, it shifts from using the
sfdisk utility to the parted utility to create partitions.  It also
moves the creation of labels, partitions, and filesystems in to
generic functions in common.sh.in.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoUse 32 as the default number of zvol threads.
Etienne Dechamps [Wed, 8 Feb 2012 21:41:41 +0000 (22:41 +0100)]
Use 32 as the default number of zvol threads.

Currently, the `zvol_threads` variable, which controls the number of worker
threads which process items from the ZVOL queues, is set to the number of
available CPUs.

This choice seems to be based on the assumption that ZVOL threads are
CPU-bound. This is not necessarily true, especially for synchronous writes.
Consider the situation described in the comments for `zil_commit()`, which is
called inside `zvol_write()` for synchronous writes:

> itxs are committed in batches. In a heavily stressed zil there will be a
> commit writer thread who is writing out a bunch of itxs to the log for a
> set of committing threads (cthreads) in the same batch as the writer.
> Those cthreads are all waiting on the same cv for that batch.
>
> There will also be a different and growing batch of threads that are
> waiting to commit (qthreads). When the committing batch completes a
> transition occurs such that the cthreads exit and the qthreads become
> cthreads. One of the new cthreads becomes he writer thread for the batch.
> Any new threads arriving become new qthreads.

We can easily deduce that, in the case of ZVOLs, there can be a maximum of
`zvol_threads` cthreads and qthreads. The default value for `zvol_threads` is
typically between 1 and 8, which is way too low in this case. This means
there will be a lot of small commits to the ZIL, which is very inefficient
compared to a few big commits, especially since we have to wait for the data
to be on stable storage. Increasing the number of threads will increase the
amount of data waiting to be commited and thus the size of the individual
commits.

On my system, in the context of VM disk image storage (lots of small
synchronous writes), increasing `zvol_threads` from 8 to 32 results in a 50%
increase in sequential synchronous write performance.

We should choose a more sensible default for `zvol_threads`. Unfortunately
the optimal value is difficult to determine automatically, since it depends
on the synchronous write latency of the underlying storage devices. In any
case, a hardcoded value of 32 would probably be better than the current
situation. Having a lot of ZVOL threads doesn't seem to have any real
downside anyway.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Fixes #392

12 years agoImprove ZVOL queue behavior.
Etienne Dechamps [Mon, 5 Sep 2011 13:15:45 +0000 (15:15 +0200)]
Improve ZVOL queue behavior.

The Linux block device queue subsystem exposes a number of configurable
settings described in Linux block/blk-settings.c. The defaults for these
settings are tuned for hard drives, and are not optimized for ZVOLs. Proper
configuration of these options would allow upper layers (I/O scheduler) to
take better decisions about write merging and ordering.

Detailed rationale:

 - max_hw_sectors is set to unlimited (UINT_MAX). zvol_write() is able to
   handle writes of any size, so there's no reason to impose a limit. Let the
   upper layer decide.

 - max_segments and max_segment_size are set to unlimited. zvol_write() will
   copy the requests' contents into a dbuf anyway, so the number and size of
   the segments are irrelevant. Let the upper layer decide.

 - physical_block_size and io_opt are set to the ZVOL's block size. This
   has the potential to somewhat alleviate issue #361 for ZVOLs, by warning
   the upper layers that writes smaller than the volume's block size will be
   slow.

 - The NONROT flag is set to indicate this isn't a rotational device.
   Although the backing zpool might be composed of rotational devices, the
   resulting ZVOL often doesn't exhibit the same behavior due to the COW
   mechanisms used by ZFS. Setting this flag will prevent upper layers from
   making useless decisions (such as reordering writes) based on incorrect
   assumptions about the behavior of the ZVOL.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix synchronicity for ZVOLs.
Etienne Dechamps [Mon, 5 Sep 2011 09:11:38 +0000 (11:11 +0200)]
Fix synchronicity for ZVOLs.

zvol_write() assumes that the write request must be written to stable storage
if rq_is_sync() is true. Unfortunately, this assumption is incorrect. Indeed,
"sync" does *not* mean what we think it means in the context of the Linux
block layer. This is well explained in linux/fs.h:

    WRITE:       A normal async write. Device will be plugged.
    WRITE_SYNC:  Synchronous write. Identical to WRITE, but passes down
                 the hint that someone will be waiting on this IO
                 shortly.
    WRITE_FLUSH: Like WRITE_SYNC but with preceding cache flush.
    WRITE_FUA:   Like WRITE_SYNC but data is guaranteed to be on
                 non-volatile media on completion.

In other words, SYNC does not *mean* that the write must be on stable storage
on completion. It just means that someone is waiting on us to complete the
write request. Thus triggering a ZIL commit for each SYNC write request on a
ZVOL is unnecessary and harmful for performance. To make matters worse, ZVOL
users have no way to express that they actually want data to be written to
stable storage, which means the ZIL is broken for ZVOLs.

The request for stable storage is expressed by the FUA flag, so we must
commit the ZIL after the write if the FUA flag is set. In addition, we must
commit the ZIL before the write if the FLUSH flag is set.

Also, we must inform the block layer that we actually support FLUSH and FUA.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoSupport "sync=always" for ZVOLs.
Etienne Dechamps [Fri, 2 Sep 2011 07:57:35 +0000 (09:57 +0200)]
Support "sync=always" for ZVOLs.

Currently the "sync=always" property works for regular ZFS datasets, but not
for ZVOLs. This patch remedies that.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Fixes #374.

12 years agoLet libnvpair be linked independently of libzfs.
Darik Horn [Sun, 5 Feb 2012 02:54:43 +0000 (20:54 -0600)]
Let libnvpair be linked independently of libzfs.

Autoconf will fail to detect the ZoL libnvpair on systems that do not
implicitly link library runtime dependencies, which is anything that
has the GCC 4.5 DCO update.

Build libuutil before libnvpair, and put it on the the LDADD line of
the libnvpair automake template.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #560
12 years agoLinux 3.3 compat, sops->show_options()
Brian Behlendorf [Thu, 2 Feb 2012 19:55:48 +0000 (11:55 -0800)]
Linux 3.3 compat, sops->show_options()

The second argument of sops->show_options() was changed from a
'struct vfsmount *' to a 'struct dentry *'.  Add an autoconf check
to detect the API change and then conditionally define the expected
interface.  In either case we are only interested in the zfs_sb_t.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #549

12 years agoCleanup ZFS debug infrastructure
Brian Behlendorf [Fri, 20 Jan 2012 23:02:57 +0000 (15:02 -0800)]
Cleanup ZFS debug infrastructure

Historically the internal zfs debug infrastructure has been
scattered throughout the code.  Since we expect to start making
more use of this code this patch performs some cleanup.

* Consolidate the zfs debug infrastructure in the zfs_debug.[ch]
  files.  This includes moving the zfs_flags and zfs_recover
  variables, plus moving the zfs_panic_recover() function.

* Remove the existing unused functionality in zfs_debug.c and
  replace it with code which correctly utilized the spl logging
  infrastructure.

* Remove the __dprintf() function from zfs_ioctl.c.  This is
  dead code, the dprintf() functionality in the kernel relies
  on the spl log support.

* Remove dprintf() from hdr_recl().  This wasn't particularly
  useful and was missing the required format specifier anyway.

* Subsequent patches should unify the dprintf() and zfs_dbgmsg()
  functions.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAllow multiple values per directory entry
Brian Behlendorf [Fri, 27 Jan 2012 21:43:23 +0000 (13:43 -0800)]
Allow multiple values per directory entry

When using zfs to back a Lustre filesystem it's advantageous to
to store a fid with the object id in the directory zap.  The only
technical impediment to doing this is that the zpl code expects
a single value in the zap per directory entry.

This change relaxes that requirement such that multiple entries
are allowed provided the first one is the object id.  The zpl
code will just ignore additional entries.  This allows the ZoL
count to mount datasets which are being used as Lustre server
backends.

Once the upstream feature flags support is merged in this change
should be updated to a read-only feature.  Until this occurs
other zfs implementations will not be able to read the zfs
filesystems created by Lustre.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoExport symbol zfs_attr_table
Brian Behlendorf [Fri, 27 Jan 2012 17:15:42 +0000 (09:15 -0800)]
Export symbol zfs_attr_table

Export the zfs_attr_table symbol so it may be used by non-zpl
consumers which are still interested in writing a zpl compatible
dataset (e.g. Lustre).

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoIgnore dataset if the dds_type is DMU_OST_OTHER
Prakash Surya [Wed, 18 Jan 2012 23:31:52 +0000 (15:31 -0800)]
Ignore dataset if the dds_type is DMU_OST_OTHER

Since the zpios and potentially other ZFS tests use the
DMU_OST_OTHER type to label their datasets, the zpool and
zfs commands should gracefully handle this type when it is
encountered.  This patch modifies the commands' behavior
to ignore any datasets with a dds_type of DMU_OST_OTHER.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #536

12 years agoFix rpm dependencies
Brian Behlendorf [Wed, 18 Jan 2012 00:20:43 +0000 (16:20 -0800)]
Fix rpm dependencies

This change updates the rpm spec files to have strictly correct
package dependencies.  That means a few things:

* The zfs-modules package is now tied to a specific build of
  the spl-modules packages based on the kernel version.  This
  ensures that the correct spl-modules packages will always get
  installed and not just the newest.

* The zfs package now requires both the zfs-modules and spl
  packages.  Thus a 'yum install zfs' will pull in the minimal
  set of packages required for a functional system.

* The zfs-devel packages now require the zfs package to be
  installed which is normal behavior for -devel packages.

* Remove the redundant distribution release extension.  This
  is already added once because it is part of the kernel package
  release name.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd the release component to headers
Brian Behlendorf [Wed, 18 Jan 2012 00:19:43 +0000 (16:19 -0800)]
Add the release component to headers

When the original build system code was added the release
component was accidentally omited from the development header
install path.  This patch adds the missing path component so
it's always clear exactly what release your compiling against.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAllow GPT+EFI vdev replacement in boot pools.
Darik Horn [Wed, 18 Jan 2012 18:28:11 +0000 (12:28 -0600)]
Allow GPT+EFI vdev replacement in boot pools.

Commit zfsonlinux/zfs@57a4eddc4d5e1e6c10d8d7dcf87a9fc27398adcd
allows the bootfs property to be set on any pool, but does not
accommodate subsequent vdev changes. For example:

# zpool replace rpool /dev/sda /dev/sdb
operation not supported on this type of pool
property 'bootfs' is not supported on EFI labeled devices

For non-Solaris builds, disable the check that emits this error.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoCombine libraries: spl, avl, efi, share, unicode.
Darik Horn [Sat, 31 Dec 2011 23:30:52 +0000 (17:30 -0600)]
Combine libraries: spl, avl, efi, share, unicode.

These libraries, which are an artifact of the ZoL development
process, conflict with packages that are already in distribution:

  * libspl: SPL Programming Language
  * libavl: AVL for Linux
  * libefi: GRUB

And these libraries are potential conflicts:

  * libshare: the Linux Mount Manager
  * libunicode: Perl and Python

Recompose these five ZoL components into the four libraries that are
conventionally provided by Solaris and FreeBSD systems:

  + libnvpair
  + libuutil
  + libzpool
  + libzfs

This change resolves the name conflict, makes ZoL more compatible
with existing software that uses autotools to detect ZFS, and allows
pkg-zfs to better reflect the official Debian kFreeBSD packaging.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #430
12 years agoAllow setting bootfs on any pool
Richard Laager [Fri, 13 Jan 2012 22:24:15 +0000 (16:24 -0600)]
Allow setting bootfs on any pool

The vdev_is_bootable() restrictions are no longer necessary
with recent GRUB2 code.  FreeBSD has implemented the same
change, except that I moved the Solaris comment to be inside
the #ifdef __sun__ block.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #317

12 years agoReduce number of zio free threads
Ned Bass [Fri, 13 Jan 2012 21:51:39 +0000 (13:51 -0800)]
Reduce number of zio free threads

As described in Issue #458 and #258, unlinking large amounts of data
can cause the threads in the zio free wait queue to start spinning.
Reducing the number of z_fr_iss threads from a fixed value of 100 to 1
per cpu signficantly reduces contention on the taskq spinlock and
improves throughput.

Instrumenting the taskq code showed that __taskq_dispatch() can spend
a long time holding tq->tq_lock if there are a large number of threads
in the queue.  It turns out the time spent in wake_up() scales
linearly with the number of threads in the queue.  When a large number
of short work items are dispatched, as seems to be the case with
unlink, the worker threads drain the queue faster than the dispatcher
can fill it.  They then all pile into the work wait queue to wait for
new work items.  So if 100 threads are in the queue, wake_up() takes
about 100 times as long, and the woken threads have to spin until the
dispatcher releases the lock.

Reducing the number of threads helps with the symptoms, but doesn't
get to the root of the problem.  It would seem that wake_up()
shouldn't scale linearly in time with queue depth, particularly if we
are only trying to wake up one thread.  In that vein, I tried making
all of the waiting processes exclusive to prevent the scheduler from
iterating over the entire list, but I still saw the linear time
scaling.  So further investigation is needed, but in the meantime
reducing the thread count is an easy workaround.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #258
Issue #458

12 years agoIncrease link count limit to 2^31-1
Brian Behlendorf [Fri, 13 Jan 2012 19:35:05 +0000 (11:35 -0800)]
Increase link count limit to 2^31-1

Originally, the per-file link limit was set to 65536 because the
exact Linux VFS limit was unclear.  Internally ZFS is able to
support 64-bit link counts.  After a more careful investigation
the limit can be safely raised to 2^31-1.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #514

12 years agoRun ZFS_AC_PACMAN only if $VENDOR is "arch"
Prakash Surya [Fri, 13 Jan 2012 01:24:05 +0000 (17:24 -0800)]
Run ZFS_AC_PACMAN only if $VENDOR is "arch"

Unfortunately, Arch's package manager `pacman` shares it's name with a
popular arcade video game. Thus, in order to refrain from executing the
video game when we mean to execute the package manager, ZFS_AC_PACMAN is
now only run when $VENDOR is determined to be "arch".

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #517

12 years agoAdd overlay(-O) mount option support
Suman Chakravartula [Thu, 12 Jan 2012 00:48:02 +0000 (16:48 -0800)]
Add overlay(-O) mount option support

Linux supports mounting over non-empty directories by default.
In Solaris this is not the case and -O option is required for
zfs mount to mount a zfs filesystem over a non-empty directory.

For compatibility, I've added support for -O option to mount
zfs filesystems over non-empty directories if the user wants
to, just like in Solaris.

I've defined MS_OVERLAY to record it in the flags variable if
the -O option is supplied.  The flags variable passes through
a few functions and its checked before performing the empty
directory check in zfs_mount function.  If -O is given, the
check is not performed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #473

12 years agoApply the ZoL coding standard to zpl_xattr.c
Darik Horn [Thu, 5 Jan 2012 20:27:36 +0000 (14:27 -0600)]
Apply the ZoL coding standard to zpl_xattr.c

Make the indenting in the zpl_xattr.c file consistent with the Sun
coding standard by removing soft tabs.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoLinux 3.2 compat, security_inode_init_security()
Brian Behlendorf [Thu, 12 Jan 2012 21:59:44 +0000 (13:59 -0800)]
Linux 3.2 compat, security_inode_init_security()

The security_inode_init_security() API has been changed to include
a filesystem specific callback to write security extended attributes.
This was done to support the initialization of multiple LSM xattrs
and the EVM xattr.

This change updates the code to use the new API when it's available.
Otherwise it falls back to the previous implementation.

In addition, the ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY
autoconf test has been made more rigerous by passing the expected
types.  This is done to ensure we always properly the detect the
correct form for the security_inode_init_security() API.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #516

12 years agoTreat /dev/vd* as whole disks
Richard Laager [Mon, 9 Jan 2012 22:50:26 +0000 (16:50 -0600)]
Treat /dev/vd* as whole disks

Correctly detect /dev/vd devices as whole disks and attempt to
create an EFI partition table.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAvoid using awk in the zpool_id script.
Darik Horn [Fri, 30 Dec 2011 20:18:58 +0000 (14:18 -0600)]
Avoid using awk in the zpool_id script.

Some implementations of `awk` incorrectly parse the \< and \> regex
symbols, so use a `while read` loop and regular globbing instead.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #259
12 years agoLinux 3.1 compat, super_block->s_shrink
Brian Behlendorf [Thu, 22 Dec 2011 20:20:43 +0000 (12:20 -0800)]
Linux 3.1 compat, super_block->s_shrink

The Linux 3.1 kernel has introduced the concept of per-filesystem
shrinkers which are directly assoicated with a super block.  Prior
to this change there was one shared global shrinker.

The zfs code relied on being able to call the global shrinker when
the arc_meta_limit was exceeded.  This would cause the VFS to drop
references on a fraction of the dentries in the dcache.  The ARC
could then safely reclaim the memory used by these entries and
honor the arc_meta_limit.  Unfortunately, when per-filesystem
shrinkers were added the old interfaces were made unavailable.

This change adds support to use the new per-filesystem shrinker
interface so we can continue to honor the arc_meta_limit.  The
major benefit of the new interface is that we can now target
only the zfs filesystem for dentry and inode pruning.  Thus we
can minimize any impact on the caching of other filesystems.

In the context of making this change several other important
issues related to managing the ARC were addressed, they include:

* The dnlc_reduce_cache() function which was called by the ARC
to drop dentries for the Posix layer was replaced with a generic
zfs_prune_t callback.  The ZPL layer now registers a callback to
drop these dentries removing a layering violation which dates
back to the Solaris code.  This callback can also be used by
other ARC consumers such as Lustre.

  arc_add_prune_callback()
  arc_remove_prune_callback()

* The arc_reduce_dnlc_percent module option has been changed to
arc_meta_prune for clarity.  The dnlc functions are specific to
Solaris's VFS and have already been largely eliminated already.
The replacement tunable now represents the number of bytes the
prune callback will request when invoked.

* Less aggressively invoke the prune callback.  We used to call
this whenever we exceeded the arc_meta_limit however that's not
strictly correct since it results in over zeleous reclaim of
dentries and inodes.  It is now only called once the arc_meta_limit
is exceeded and every effort has been made to evict other data from
the ARC cache.

* More promptly manage exceeding the arc_meta_limit.  When reading
meta data in to the cache if a buffer was unable to be recycled
notify the arc_reclaim thread to invoke the required prune.

* Added arcstat_prune kstat which is incremented when the ARC
is forced to request that a consumer prune its cache.  Remember
this will only occur when the ARC has no other choice.  If it
can evict buffers safely without invoking the prune callback
it will.

* This change is also expected to resolve the unexpect collapses
of the ARC cache.  This would occur because when exceeded just the
arc_meta_limit reclaim presure would be excerted on the arc_c
value via arc_shrink().  This effectively shrunk the entire cache
when really we just needed to reclaim meta data.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #466
Closes #292

12 years agoMove Arch Linux's VENDOR check above Ubuntu's
Prakash Surya [Sat, 17 Dec 2011 06:32:54 +0000 (22:32 -0800)]
Move Arch Linux's VENDOR check above Ubuntu's

If the lsb-release package is installed on an Arch Linux distribution,
the configure step will incorrectly detect the running distribution as
Ubuntu. This is a result of both distributions providing an
/etc/lsb-release file, and the Ubuntu VENDOR check being performed
first.

Since the Arch Linux test check's for a file more specific to the Arch
Linux distribution, moving Arch Linux's VENDOR check above Unbuntu's
check provides a quick and easy solution.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd LIBSELINUX to mount_zfs_LDFLAGS.
Darik Horn [Sat, 17 Dec 2011 01:02:41 +0000 (19:02 -0600)]
Add LIBSELINUX to mount_zfs_LDFLAGS.

Regenerating the autotools configuration on Debian and Ubuntu systems
causes compilation to fail with this error message:

  cmd/mount_zfs/../../cmd/mount_zfs/mount_zfs.c:403:
    undefined reference to `is_selinux_enabled'

In the automake template, set "mount_zfs_LDFLAGS = ... $(LIBSELINUX)"
so that the /sbin/mount.zfs utility is linked to libselinux.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoLinux 3.2 compat: set_nlink()
Darik Horn [Fri, 16 Dec 2011 21:15:12 +0000 (15:15 -0600)]
Linux 3.2 compat: set_nlink()

Directly changing inode->i_nlink is deprecated in Linux 3.2 by commit

  SHA: bfe8684869601dacfcb2cd69ef8cfd9045f62170

Use the new set_nlink() kernel function instead.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #462
12 years agoUpdate the character class in the zpool man page.
Darik Horn [Fri, 16 Dec 2011 20:17:00 +0000 (14:17 -0600)]
Update the character class in the zpool man page.

ZoL and all Solaris derivatives allow pool names to contain the colon
and space characters. Update the man page to reflect current behavior.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #438
12 years agoAdd make rule for building Arch Linux packages
Prakash Surya [Thu, 8 Dec 2011 01:02:42 +0000 (17:02 -0800)]
Add make rule for building Arch Linux packages

Added the necessary build infrastructure for building packages
compatible with the Arch Linux distribution. As such, one can now run:

    $ ./configure
    $ make pkg     # Alternatively, one can run 'make arch' as well

on the Arch Linux machine to create two binary packages compatible with
the pacman package manager, one for the zfs userland utilities and
another for the zfs kernel modules. The new packages can then be
installed by running:

    # pacman -U $package.pkg.tar.xz

In addition, source-only packages suitable for an Arch Linux chroot
environment or remote builder can also be build using the 'sarch' make
rule.

NOTE: Since the source dist tarball is created on the fly from the head
of the build tree, it's MD5 hash signature will be continually influx.
As a result, the md5sum variable was intentionally omitted from the
PKGBUILD files, and the '--skipinteg' makepkg option is used. This may
or may not have any serious security implications, as the source tarball
is not being downloaded from an outside source.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #491

12 years agoIllumos #734: Use taskq_dispatch_ent() interface
Garrett D'Amore [Tue, 8 Nov 2011 00:26:52 +0000 (16:26 -0800)]
Illumos #734: Use taskq_dispatch_ent() interface

It has been observed that some of the hottest locks are those
of the zio taskqs.  Contention on these locks can limit the
rate at which zios are dispatched which limits performance.

This upstream change from Illumos uses new interface to the
taskqs which allow them to utilize a prealloc'ed taskq_ent_t.
This removes the need to perform an allocation at dispatch
time while holding the contended lock.  This has the effect
of improving system performance.

Reviewed by: Albert Lee <trisk@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Alexey Zaytsev <alexey.zaytsev@nexenta.com>
Reviewed by: Jason Brian King <jason.brian.king@gmail.com>
Reviewed by: George Wilson <gwilson@zfsmail.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>

References to Illumos issue:
  https://www.illumos.org/issues/734

Ported-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #482

12 years agoSet zvol_major/zvol_threads permissions
Brian Behlendorf [Wed, 7 Dec 2011 17:23:44 +0000 (09:23 -0800)]
Set zvol_major/zvol_threads permissions

The zvol_major and zvol_threads module options were being created
with 0 permission bits.  This prevented them from being listed in
the /sys/module/zfs/parameters/ directory, although they were
visible in `modinfo zfs`.  This patch fixes the issue by updating
the permission bits to 0444.  For the moment these options must
be read-only because they are used during module initialization.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #392

12 years agoUpdate default ARC memory limits
Brian Behlendorf [Mon, 5 Dec 2011 18:08:29 +0000 (10:08 -0800)]
Update default ARC memory limits

In the upstream OpenSolaris ZFS code the maximum ARC usage is
limited to 3/4 of memory or all but 1GB, whichever is larger.
Because of how Linux's VM subsystem is organized these defaults
have proven to be too large which can lead to stability issues.

To avoid making everyone manually tune the ARC the defaults are
being changed to 1/2 of memory or all but 4GB.  The rational for
this is as follows:

* Desktop Systems (less than 8GB of memory)

  Limiting the ARC to 1/2 of memory is desirable for desktop
  systems which have highly dynamic memory requirements.  For
  example, launching your web browser can suddenly result in a
  demand for several gigabytes of memory.  This memory must be
  reclaimed from the ARC cache which can take some time.  The
  user will experience this reclaim time as a sluggish system
  with poor interactive performance.  Thus in this case it is
  preferable to leave the memory as free and available for
  immediate use.

* Server Systems (more than 8GB of memory)

  Using all but 4GB of memory for the ARC is preferable for
  server systems.  These systems often run with minimal user
  interaction and have long running daemons with relatively
  stable memory demands.  These systems will benefit most by
  having as much data cached in memory as possible.

These values should work well for most configurations.  However,
if you have a desktop system with more than 8GB of memory you may
wish to further restrict the ARC.  This can still be accomplished
by setting the 'zfs_arc_max' module option.

Additionally, keep in mind these aren't currently hard limits.
The ARC is based on a slab implementation which can suffer from
memory fragmentation.  Because this fragmentation is not visible
from the ARC it may believe it is within the specified limits while
actually consuming slightly more memory.  How much more memory get's
consumed will be determined by how badly fragmented the slabs are.

In the long term this can be mitigated by slab defragmentation code
which was OpenSolaris solution.  Or preferably, using the page cache
to back the ARC under Linux would be even better.  See issue #75
for the benefits of more tightly integrating with the page cache.

This change also fixes a issue where the default ARC max was being
set incorrectly for machines with less than 2GB of memory.  The
constant in the arc_c_max comparison must be explicitly cast to
a uint64_t type to prevent overflow and the wrong conditional
branch being taken.  This failure was typically observed in VMs
which are commonly created with less than 2GB of memory.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #75

12 years agoQuote variables in the zfs.lsb script.
Darik Horn [Sun, 4 Dec 2011 21:32:18 +0000 (15:32 -0600)]
Quote variables in the zfs.lsb script.

For consistency and safety, quote all variables in the zfs.lsb script.
This protects in the unlikely case that any of the file names contain
whitespace.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #439

12 years agoSource /etc/default/zfs after setting defaults.
Darik Horn [Sun, 4 Dec 2011 20:18:28 +0000 (14:18 -0600)]
Source /etc/default/zfs after setting defaults.

Let the administrator override all script variables by sourcing the
/etc/default/zfs file after the default values are set.

The spelling mistake in the old path name makes it unlikely that this
bug affected any users.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #371
12 years agoDemote the whackbang in the zpool_id script.
Darik Horn [Sun, 4 Dec 2011 20:01:58 +0000 (14:01 -0600)]
Demote the whackbang in the zpool_id script.

The zpool_id script is posixly correct and does not use bash
features, so change its whackbang from /bin/bash to /bin/sh.

Debian policy also stipulates that system scripts be dash compatible.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoDemote egrep to grep in the zpool_id script.
Darik Horn [Sun, 4 Dec 2011 19:58:53 +0000 (13:58 -0600)]
Demote egrep to grep in the zpool_id script.

Direct invocation of GNU egrep is deprecated by its man page, and the
its argument in the zpool_id script is not an extended expression.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoQuote variables in the zpool_id script.
Darik Horn [Sun, 4 Dec 2011 19:50:27 +0000 (13:50 -0600)]
Quote variables in the zpool_id script.

For consistency and safety, quote all variables in the zpool_id
script. This accomodates a `-c CONFIG` parameter value with
whitespace in the path name.

Also fix a typo in the usage synopsis for `-h`.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #439

12 years agoSupport path_id changes in udev 174.
Darik Horn [Sun, 4 Dec 2011 19:10:46 +0000 (13:10 -0600)]
Support path_id changes in udev 174.

The /lib/udev/path_id helper became a builtin command in the udev 174
release, so test whether path_id is external in the zpool_id script.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #429
12 years agoAdded comments for libshare's NFS functions.
Gunnar Beutner [Sat, 3 Dec 2011 22:01:06 +0000 (23:01 +0100)]
Added comments for libshare's NFS functions.

Some of the functions' purpose wasn't immediately obvious without
additional explanations. This commit adds these missing comments.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix configure tests to play nice with GCC 4.6
Prakash Surya [Tue, 29 Nov 2011 22:31:20 +0000 (14:31 -0800)]
Fix configure tests to play nice with GCC 4.6

As of GCC 4.6, specific kernel 2.6.32 header files do not compile
cleanly without warnings. One specific example of this is the
arch/x86/include/asm/percpu.h file. Thus, a few of the configure tests
were getting hung up on this and the '-Wno-unsued-but-set-variables'
compile option had to be introduced.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #459

12 years agoAllow xattrs on symlinks
Brian Behlendorf [Tue, 29 Nov 2011 17:05:04 +0000 (09:05 -0800)]
Allow xattrs on symlinks

The Solaris version of ZFS does not allow xattrs to be set on
symlinks due to the way they implemented the attropen() system
call.  Linux however implements xattrs through the lgetxattr()
and lsetxattr() system calls which do not have this limitation.

The only reason this hasn't always worked under ZFS on Linux
is that the xattr handlers were not registered for symlink type
inodes.  This was done simply to be consistent with the Solaris
behavior.

Upon futher reflection I believe this should be allowed under
Linux.  The only ill effect would be that the xattrs on symlinks
will not be visible when the pool is imported on a Solaris
system.  This also has the benefit that it allows for SELinux
style security xattr labeling which expects to be able to set
xattrs on all inode types.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #272

12 years agoImplement SA based xattrs
Brian Behlendorf [Mon, 24 Oct 2011 23:55:20 +0000 (16:55 -0700)]
Implement SA based xattrs

The current ZFS implementation stores xattrs on disk using a hidden
directory.  In this directory a file name represents the xattr name
and the file contexts are the xattr binary data.  This approach is
very flexible and allows for arbitrarily large xattrs.  However,
it also suffers from a significant performance penalty.  Accessing
a single xattr can requires up to three disk seeks.

  1) Lookup the dnode object.
  2) Lookup the dnodes's xattr directory object.
  3) Lookup the xattr object in the directory.

To avoid this performance penalty Linux filesystems such as ext3
and xfs try to store the xattr as part of the inode on disk.  When
the xattr is to large to store in the inode then a single external
block is allocated for them.  In practice most xattrs are small
and this approach works well.

The addition of System Attributes (SA) to zfs provides us a clean
way to make this optimization.  When the dataset property 'xattr=sa'
is set then xattrs will be preferentially stored as System Attributes.
This allows tiny xattrs (~100 bytes) to be stored with the dnode and
up to 64k of xattrs to be stored in the spill block.  If additional
xattr space is required, which is unlikely under Linux, they will be
stored using the traditional directory approach.

This optimization results in roughly a 3x performance improvement
when accessing xattrs which brings zfs roughly to parity with ext4
and xfs (see table below).  When multiple xattrs are stored per-file
the performance improvements are even greater because all of the
xattrs stored in the spill block will be cached.

However, by default SA based xattrs are disabled in the Linux port
to maximize compatibility with other implementations.  If you do
enable SA based xattrs then they will not be visible on platforms
which do not support this feature.

----------------------------------------------------------------------
   Time in seconds to get/set one xattr of N bytes on 100,000 files
------+--------------------------------+------------------------------
      |            setxattr            |            getxattr
bytes |  ext4     xfs zfs-dir  zfs-sa  |  ext4     xfs zfs-dir  zfs-sa
------+--------------------------------+------------------------------
1     |  2.33   31.88   21.50    4.57  |  2.35    2.64    6.29    2.43
32    |  2.79   30.68   21.98    4.60  |  2.44    2.59    6.78    2.48
256   |  3.25   31.99   21.36    5.92  |  2.32    2.71    6.22    3.14
1024  |  3.30   32.61   22.83    8.45  |  2.40    2.79    6.24    3.27
4096  |  3.57  317.46   22.52   10.73  |  2.78   28.62    6.90    3.94
16384 |   n/a 2342.39   34.30   19.20  |   n/a   45.44  145.90    7.55
65536 |   n/a 2941.39  128.15  131.32* |   n/a  141.92  256.85  262.12*

Legend:
* ext4      - Stock RHEL6.1 ext4 mounted with '-o user_xattr'.
* xfs       - Stock RHEL6.1 xfs mounted with default options.
* zfs-dir   - Directory based xattrs only.
* zfs-sa    - Prefer SAs but spill in to directories as needed, a
              trailing * indicates overflow in to directories occured.

NOTE: Ext4 supports 4096 bytes of xattr name/value pairs per file.
NOTE: XFS and ZFS have no limit on xattr name/value pairs per file.
NOTE: Linux limits individual name/value pairs to 65536 bytes.
NOTE: All setattr/getattr's were done after dropping the cache.
NOTE: All tests were run against a single hard drive.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #443

12 years agoIn autoconf v2.68, AC_LANG_PROGRAM must be quoted
Prakash Surya [Fri, 25 Nov 2011 00:37:27 +0000 (16:37 -0800)]
In autoconf v2.68, AC_LANG_PROGRAM must be quoted

This change updates the AC_LANG_PROGRAM autoconf macro invocations to be
wrapped in quotes. As of autoconf version 2.68, the quotes are necessary
to prevent warnings from appearing. Specifically, the autoconf v2.68
Forward Porting Notes specifies:

    It is important to note that you need to ensure that the call to
    AC_LANG_SOURCE is quoted and not expanded, otherwise that will
    cause the warning to appear nonetheless.

Finally, because of the additional quoting we can drop the extra
quotas used by the ZFS_AC_CONFIG_USER_STACK_GUARD autoconf check.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #464

12 years agoAllow leading digits in userquota/groupquota names
Suman Chakravartula [Sat, 19 Nov 2011 19:53:12 +0000 (11:53 -0800)]
Allow leading digits in userquota/groupquota names

While setting/getting userquota and groupquota properties, the input
was not treated as a possible username or groupname if it had a
leading digit. While useradd in linux recommends the regexp
[a-z_][a-z0-9_-]*[$]? , it is not enforced. This causes problem for
usernames with leading digits in them. We need to be able to support
getting and setting properties for this unconventional but possible
input category

I've updated the code to validate the username or groupname directly
via the API. Also, note that I moved this validation to the beginning
before the check for SID names with @. This also supports usernames
with @ character in them which are valid. Only when input with @ is
not a valid username, it is interpreted as a potential SID name.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #428

12 years agoLimit maximum ashift value to 12
Brian Behlendorf [Fri, 11 Nov 2011 22:50:15 +0000 (14:50 -0800)]
Limit maximum ashift value to 12

While we initially allowed you to set your ashift as large as 17
(SPA_MAXBLOCKSIZE) that is actually unsafe.  What wasn't considered
at the time is that each uberblock written to the vdev label ring
buffer will be of this size.  Now the buffer is statically sized
to 128k and we need to be able to fit several uberblocks in it.
With a large ashift that becomes a problem.

Therefore I'm reducing the maximum configurable ashift value to 12.
This is large enough for the 4k sector drives and small enough that
we can still keep the most recent 32 uberblock in the vdev label
ring buffer.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #425

12 years agoFix depmod warning
Brian Behlendorf [Thu, 10 Nov 2011 18:22:39 +0000 (10:22 -0800)]
Fix depmod warning

The depmod utility from module-init-tools 3.12-pre3 generates a
warning when the -e option is used without -E or -F.  This was
observed under OpenSuse 11.4.  To resolve the issue when the
exact System.map-* for your kernel cannot be found fallback to
a generic safe '/sbin/depmod -a'.

  WARNING: -e needs -E or -F

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoLinux 3.1 compat, fops->fsync()
Brian Behlendorf [Thu, 10 Nov 2011 04:47:59 +0000 (20:47 -0800)]
Linux 3.1 compat, fops->fsync()

The Linux 3.1 kernel updated the fops->fsync() callback yet again.
They now pass the requested range and delegate the responsibility
for calling filemap_write_and_wait_range() to the callback.  In
addition imutex is no longer held by the caller and the callback
is responsible for taking the lock if required.

This commit updates the code to provide a zpl_fsync() function
for the updated API.  Implementations for the previous two APIs
are also maintained for compatibility.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #445

12 years agoSuppress packaging warning
Brian Behlendorf [Tue, 8 Nov 2011 19:07:02 +0000 (11:07 -0800)]
Suppress packaging warning

Only under Ubuntu Lucid the rpm packaging step mistakenly adds
the following files twice to the package because of the /lib
naming convention.  This is harmless but results in a warning
which the buildot flags as a failure.  Suppress this warning.

  warning: File listed twice: /lib/udev/rules.d
  warning: File listed twice: /lib/udev/rules.d/60-zpool.rules
  warning: File listed twice: /lib/udev/rules.d/60-zvol.rules
  warning: File listed twice: /lib/udev/rules.d/90-zfs.rules
  warning: File listed twice: /lib/udev/sas_switch_id
  warning: File listed twice: /lib/udev/zpool_id
  warning: File listed twice: /lib/udev/zvol_id

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoSimplify BDI integration
Brian Behlendorf [Tue, 8 Nov 2011 00:39:03 +0000 (16:39 -0800)]
Simplify BDI integration

Update the code to use the bdi_setup_and_register() helper to
simplify the bdi integration code.  The updated code now just
registers the bdi during mount and destroys it during unmount.

The only complication is that for 2.6.32 - 2.6.33 kernels the
helper wasn't available so in these cases the zfs code must
provide it.  Luckily the bdi_setup_and_register() function
is trivial.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #367

12 years agoDisown dataset in zfs_sb_create()
Brian Behlendorf [Tue, 8 Nov 2011 00:25:49 +0000 (16:25 -0800)]
Disown dataset in zfs_sb_create()

Fix an unlikely failure cause in zfs_sb_create() which could
leave the dataset owned on error and thus unavailable until
after a reboot.  Disown the dataset if SA are expected but
are in fact missing.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoImprove meta data performance
Brian Behlendorf [Tue, 1 Nov 2011 23:56:48 +0000 (16:56 -0700)]
Improve meta data performance

Profiling the system during meta data intensive workloads such
as creating/removing millions of files, revealed that the system
was cpu bound.  A large fraction of that cpu time was being spent
waiting on the virtual address space spin lock.

It turns out this was caused by certain heavily used kmem_caches
being backed by virtual memory.  By default a kmem_cache will
dynamically determine the type of memory used based on the object
size.  For large objects virtual memory is usually preferable
and for small object physical memory is a better choice.  See
the spl_slab_alloc() function for a longer discussion on this.

However, there is a certain amount of gray area when defining a
'large' object.  For the following caches it turns out they were
just over the line:

  * dnode_cache
  * zio_cache
  * zio_link_cache
  * zio_buf_512_cache
  * zfs_data_buf_512_cache

Now because we know there will be a lot of churn in these caches,
and because we know the slabs will still be reasonably sized.
We can safely request with the KMC_KMEM flag that the caches be
backed with physical memory addresses.  This entirely avoids the
need to serialize on the virtual address space lock.

As a bonus this also reduces our vmalloc usage which will be good
for 32-bit kernels which have a very small virtual address space.
It will also probably be good for interactive performance since
unrelated processes could also block of this same global lock.
Finally, we may see less cpu time being burned in the arc_reclaim
and txg_sync_threads.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #258

12 years agoFix NULL deref in balance_pgdat()
Brian Behlendorf [Tue, 1 Nov 2011 20:07:41 +0000 (13:07 -0700)]
Fix NULL deref in balance_pgdat()

Be careful not to unconditionally clear the PF_MEMALLOC bit in
the task structure.  It may have already been set when entering
zpl_putpage() in which case it must remain set on exit.  In
particular the kswapd thread will have PF_MEMALLOC set in
order to prevent it from entering direct reclaim.  By clearing
it we allow the following NULL deref to potentially occur.

  BUG: unable to handle kernel NULL pointer dereference at (null)
  IP: [<ffffffff8109c7ab>] balance_pgdat+0x25b/0x4ff

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #287

12 years agoFix a race condition in zfs_getattr_fast()
Gunnar Beutner [Thu, 3 Nov 2011 05:48:13 +0000 (06:48 +0100)]
Fix a race condition in zfs_getattr_fast()

zfs_getattr_fast() was missing a lock on the ZFS superblock which
could result in zfs_znode_dmu_fini() clearing the zp->z_sa_hdl member
while zfs_getattr_fast() was accessing the znode. The result of this
would usually be a panic.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Fixes #431

12 years agoIllumos #1661: Fix flaw in sa_find_sizes() calculation
Xin Li [Fri, 21 Oct 2011 23:39:53 +0000 (16:39 -0700)]
Illumos #1661: Fix flaw in sa_find_sizes() calculation

When calculating space needed for SA_BONUS buffers, hdrsize is
always rounded up to next 8-aligned boundary. However, in two places
the round up was done against sum of 'total' plus hdrsize. On the
other hand, hdrsize increments by 4 each time, which means in certain
conditions, we would end up returning with will_spill == 0 and
(total + hdrsize) larger than full_space, leading to a failed
assertion because it's invalid for dmu_set_bonus.

Reviewed by: Matthew Ahrens <matt@delphix.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Approved by: Gordon Ross <gwr@nexenta.com>

References to Illumos issue:
  https://www.illumos.org/issues/1661

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #426

12 years agoChange sun.com URLs to zfsonlinux.org
Darik Horn [Sat, 22 Oct 2011 15:44:03 +0000 (10:44 -0500)]
Change sun.com URLs to zfsonlinux.org

ZFS contains error messages that point to the defunct www.sun.com
domain, which is currently offline.  Change these error messages
to use the zfsonlinux.org mirror instead.

This commit depends on:

  zfsonlinux/zfsonlinux.github.com@8e10ead3dc66e2204ae893d81528371405f107e7

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoInclude distribution in release
Brian Behlendorf [Wed, 19 Oct 2011 18:43:11 +0000 (11:43 -0700)]
Include distribution in release

Common practice is to include the distribution in the package release.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoSet mtime on symbolic links
Brian Behlendorf [Tue, 18 Oct 2011 21:51:03 +0000 (14:51 -0700)]
Set mtime on symbolic links

Register the setattr/getattr callbacks for symlinks.  Without these
the generic inode_setattr() and generic_fillattr() functions will
be used.  In the setattr case this will only result in the inode being
updated in memory, the dirty_inode callback would also normally run
but none is registered for zfs.

The straight forward fix is to set the setattr/getattr callbacks
for symlinks so they are handled just like files and directories.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #412

12 years agoIllumos #755: dmu_recv_stream builds incomplete guid_to_ds_map
Alexander Stetsenko [Sun, 16 Oct 2011 06:41:05 +0000 (08:41 +0200)]
Illumos #755: dmu_recv_stream builds incomplete guid_to_ds_map

An incomplete guid_to_ds_map would cause restore_write_byref() to fail
while receiving a de-duplicated backup stream.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Garrett D`Amore <garrett@nexenta.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Approved by: Gordon Ross <gwr@nexenta.com>

References to Illumos issue and patch:
- https://www.illumos.org/issues/755
- https://github.com/illumos/illumos-gate/commit/ec5cf9d53a

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #372

12 years agoUse @ZFS_META LICENSE@ in spec.in files
Ned Bass [Mon, 17 Oct 2011 18:43:55 +0000 (11:43 -0700)]
Use @ZFS_META LICENSE@ in spec.in files

zfs.spec.in and zfs-modules.spec.in had the License field incorrectly
set to @LICENSE@, causing generated rpm packages to report an invalid
license string.  Fix this by using @ZFS_META_LICENSE@.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #422

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoDisable 90-zfs.rules for test suite
Brian Behlendorf [Tue, 11 Oct 2011 21:36:42 +0000 (14:36 -0700)]
Disable 90-zfs.rules for test suite

When running the zconfig.sh, zpios-sanity.sh, and zfault.sh
from the installed packages the 90-zfs.rules can cause failures.
These will occur because the test suite assumes it has full
control over loading/unloading the module stack.  If the stack
gets asynchronously loaded by the udev rule the test suite
will treat it as a failure.  Resolve the issue by disabling
the offending rule during the tests and enabling it on exit.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoExport symbols for the VFS API
Brian Behlendorf [Mon, 10 Oct 2011 17:42:59 +0000 (10:42 -0700)]
Export symbols for the VFS API

Export all symbols already marked extern in the zfs_vfsops.h
header.  Several non-static symbols have also been added to
the header and exportewd.  This allows external modules to
more easily create and manipulate properly created ZFS
filesystem type datasets.

Rename zfsvfs_teardown() to zfs_sb_teardown and export it.
This is done simply for consistency with the rest of the code
base.  All other zfsvfs_* functions have already been renamed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd provides lustre-backend-fs to rpm
Brian Behlendorf [Fri, 7 Oct 2011 16:14:12 +0000 (09:14 -0700)]
Add provides lustre-backend-fs to rpm

The Lustre packages satify their backend fs requirement by
checking that lustre-backend-fs is provided.  Update the zfs
packaging accordingly.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoPrep zfs-0.6.0-rc6 tag
Brian Behlendorf [Thu, 6 Oct 2011 21:10:45 +0000 (14:10 -0700)]
Prep zfs-0.6.0-rc6 tag

Create the sixth 0.6.0 release candidate tag (rc6).

12 years agoExport symbols for the full SA API
Brian Behlendorf [Fri, 30 Sep 2011 17:33:26 +0000 (10:33 -0700)]
Export symbols for the full SA API

Export all the symbols for the system attribute (SA) API.  This
allows external module to cleanly manipulate the SAs associated
with a dnode.  Documention for the SA API can be found in the
module/zfs/sa.c source.

This change also removes the zfs_sa_uprade_pre, and
zfs_sa_uprade_post prototypes.  The functions themselves were
dropped some time ago.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoSynchronize initramfs and system hostid
Brian Behlendorf [Fri, 30 Sep 2011 17:33:26 +0000 (10:33 -0700)]
Synchronize initramfs and system hostid

Relying on an /etc/hostid file which is installed in the system
image breaks diskless systems which share an image.  Certain
cluster infrastructure such as MPI relies on all nodes having
a unique hostid.  However, we still must be careful to ensure
the hostid is syncronized between the initramfs and system
images when using zfs root filesystems.

To accompish this the automatically created /etc/hostid file has
been removed from the spl rpm packaging.  The /etc/hostid file
is now dynamically created for your initramfs as part of the
dracut install process.  This avoids the need to install it in
the actual system images.

This change also resolves the spl_hostid parameter handling
for dracut.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #398
Closes #399

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix 'unexpected operator' bashism
Oleg Stepura [Thu, 29 Sep 2011 20:59:07 +0000 (23:59 +0300)]
Fix 'unexpected operator' bashism

The == operator is specific to bash, replace it with the more
correct = operator for sh.  This bug can prevent correct booting
when using a zfs root pool.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #416

12 years agozpl: Fix "df -i" to have better free inodes value
Andreas Dilger [Fri, 16 Sep 2011 09:22:00 +0000 (03:22 -0600)]
zpl: Fix "df -i" to have better free inodes value

Due to the confusion in Linux statfs between f_frsize and f_bsize
the blocks counts were changed to be in units of z_max_blksize
instead of SPA_MINBLOCKSIZE as it is on other platforms.

However, the free files calculation in zfs_statvfs() is limited by
the free blocks count, since each dnode consumes one block/sector.
This provided a reasonable estimate of free inodes, but on Linux
this meant that the free inodes count was underestimated by a large
amount, since 256 512-byte dnodes can fit into a 128kB block, and
more if the max blocksize is increased to 1MB or larger.

Also, the use of SPA_MINBLOCKSIZE is semantically incorrect since
DNODE_SIZE may change to a value other than SPA_MINBLOCKSIZE and
may even change per dataset, and devices with large sectors setting
ashift will also use a larger blocksize.

Correct the f_ffree calculation to use (availbytes >> DNODE_SHIFT)
to more accurately compute the maximum number of dnodes that can
be created.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #413
Closes #400

12 years agoFix uninitialized varible in zfs_do_userspace()
Brian Behlendorf [Tue, 27 Sep 2011 23:32:53 +0000 (16:32 -0700)]
Fix uninitialized varible in zfs_do_userspace()

When compiling under Debian Lenny with gcc version 4.3.2
(Debian 4.3.2-1.1) the following warning occurs.  To quiet
the warning initialize 'error' to zero.  Newer versions of
gcc correctly determine that this uninitialized varible is
impossible because ZFS_NUM_USERQUOTA_PROPS is known to be
greater than zero.

  cmd/zfs/zfs_main.c:2377: warning: "error" may be
  used uninitialized in this function

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoExport symbols for the full ZAP API
Brian Behlendorf [Tue, 27 Sep 2011 23:07:35 +0000 (16:07 -0700)]
Export symbols for the full ZAP API

Export all the symbols for the ZAP API.  This allows external modules
to cleanly interface with ZAP type objects.  Previously only a subset
of the functionality was exposed.  Documention for the ZAP API can be
found in the sys/zap.h header.

This change also removes a duplicate zap_increment_int() prototype.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoMake libefi-created GPT compatible with gptfdisk
Zachary Bedell [Mon, 19 Sep 2011 01:35:42 +0000 (21:35 -0400)]
Make libefi-created GPT compatible with gptfdisk

GPT's created by libefi set the HeaderSize attribute in the GPT
header to 512 -- size of the GPT header INCLUDING the 420 padding
bytes at the end.  Most other tools set the size to 92 -- size of
the actual header itself excluding the padding.  Most tools check
the recorded HeaderSize when verifying CRC, but gptfdisk hardcodes
92 and thus reports CRC verification problems for full-disk vdevs
created IE with `zpool create pool sdc`.

This commit changes libefi's behavior for GPT creation and also
fixes several edge cases where libefi's behavior was similar
(though in an incompatible manner) to gptfdisk.  Libefi assumed
HeaderSize was always 512 even if the GPT recorded a different
value.  Sanity checks of the GPT headersize read from disk were
added before applying checksum calculation -- this will prevent
segfault in cases of bogus on-disk values.

Zpools created with the resuling libefi are verified as correct
both by parted and gptfdisk.  Also pool have been tested to
import correctly on ZFS on Linux as well as Solaris Express 11
livecd.

Signed-off-by: Zachary Bedell <zac@thebedells.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #344

12 years agoFix boot failure in Dracut scripts.
Zachary Bedell [Sun, 18 Sep 2011 03:42:43 +0000 (23:42 -0400)]
Fix boot failure in Dracut scripts.

mount-zfs.sh script incorrectly parsed results from zpool list.  Correct
bootfs attribute was only found on systems with a single pool or where
the bootable pool's name alphabetized to before all other pool names.
Boot failed when the bootable pool's name came after other pools
(IE 'rpool' and 'mypool' would fail to find bootfs on rpool.)

Patch correctly discards pools whose bootfs attribute is blank ('-').

Signed-off-by: Zachary Bedell <zac@thebedells.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #402

12 years agoUse automatic variable in Makefile
Ned Bass [Thu, 22 Sep 2011 22:36:42 +0000 (15:36 -0700)]
Use automatic variable in Makefile

As written, the $(init_SCRIPTS) rule in etc/init.d/Makefule.am
would not work as expected if the init_SCRIPTS variable were
to contain any elements other than zfs.  Fix this by replacing
the hard-coded 'zfs' reference with $@.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #410

12 years agoSuppress kmem_alloc() warning in zfs_prop_set_special()
Brian Behlendorf [Fri, 16 Sep 2011 03:23:50 +0000 (20:23 -0700)]
Suppress kmem_alloc() warning in zfs_prop_set_special()

Suppress the warning for this large kmem_alloc() because it is not
that far over the warning threshhold (8k) and it is short lived.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoInstall zfs-devel headers in /usr/include
Brian Behlendorf [Mon, 12 Sep 2011 18:42:33 +0000 (11:42 -0700)]
Install zfs-devel headers in /usr/include

The zfs-devel header files for linking with the libspl/libzfs
libraries should be installed under /usr/include not /include.
Ensure the correct install location is used when building an
rpm package.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix usage of zsb after free
Brian Behlendorf [Fri, 9 Sep 2011 17:24:55 +0000 (10:24 -0700)]
Fix usage of zsb after free

Caught by code inspection, the variable zsb was referenced after
being freed.  Move the kmem_free() to the end of the function.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoEnsure FC15 boots when zfs isn't used for boot partition
Jeremy Gill [Fri, 26 Aug 2011 17:55:26 +0000 (13:55 -0400)]
Ensure FC15 boots when zfs isn't used for boot partition

It seems that dracut version 009 through 013 won't boot correctly when
the zfs-dracut rpm package has been installed, but 'root=zfs' isn't
used on the boot commandline, for example when the package has been
installed on a system that _doesn't_ boot from a zfs filesystem.

Signed-off-by: Jeremy Gill <jgill@parallax-innovations.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #377

12 years agoFix zfs.spec.in to use @LICENSE@ variable
Prakash Surya [Thu, 25 Aug 2011 22:20:25 +0000 (15:20 -0700)]
Fix zfs.spec.in to use @LICENSE@ variable

The zfs.spec.in file had the license field hard coded to specify the
CDDL. This was changed to use the @LICENSE@ variable, maintaining
consistency with the zfs-modules.spec.in file.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix package URLs to use the github repository
Prakash Surya [Thu, 25 Aug 2011 22:09:24 +0000 (15:09 -0700)]
Fix package URLs to use the github repository

The URL field in the zfs-modules and zfs package spec files were
updated to point to the ZFS on Linux repository hosted by github.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoConvert 'if' statements to AS_IF in kernel.m4
Prakash Surya [Wed, 24 Aug 2011 16:52:16 +0000 (09:52 -0700)]
Convert 'if' statements to AS_IF in kernel.m4

The 'if' statements found in kernel.m4 were converted to use the
portable alternative provided by autoconf, the AS_IF macro.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix minor autoconf error message inconsistencies
Prakash Surya [Wed, 24 Aug 2011 16:23:44 +0000 (09:23 -0700)]
Fix minor autoconf error message inconsistencies

A few of the autoconf error messages were inconsistent with the rest of
the build system. To be specific, the inconsistencies addressed by this
commit are the following:

 * The second line of the error message for the CONFIG_PREEMPT check
   was missing it's third asterisk.

 * A few of the error messages were prefixed by two tabs, whereas the
   majority of error messages are only prefixed by a single tab.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix incorrect zpool_cache substitution
Brian Behlendorf [Mon, 22 Aug 2011 22:58:54 +0000 (15:58 -0700)]
Fix incorrect zpool_cache substitution

This regression was accidentally introduced by commit aa2b489.
I was attempting to simplify the init scripts and accidentally
confused the /etc/init.d and /etc/zfs paths.  This change reverts
the init script modifications.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #370

12 years agoMerge branch 'udev'
Brian Behlendorf [Mon, 22 Aug 2011 16:25:30 +0000 (09:25 -0700)]
Merge branch 'udev'

Merge the remaining udev restructuring changes and cleanup.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Kyle Fuller <inbox@kylefuller.co.uk>
Signed-off-by: Zachary Bedell <zac@thebedells.org>
Closes #356

12 years agoFix autoconf variable substitution in init scripts.
Brian Behlendorf [Tue, 9 Aug 2011 23:49:18 +0000 (16:49 -0700)]
Fix autoconf variable substitution in init scripts.

Change the variable substitution in the init script templates
according to the method described in the Autoconf manual;
Chapter 4.7.2: Installation Directory Variables.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoMake dracut module-setup.sh an autoconf config file
Kyle Fuller [Tue, 9 Aug 2011 21:39:47 +0000 (22:39 +0100)]
Make dracut module-setup.sh an autoconf config file

This ensures that module-setup.sh script will always be able to
install the required dracut components regardless of how the zfs
package was configured.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>