]> git.proxmox.com Git - mirror_zfs-debian.git/log
mirror_zfs-debian.git
11 years agoAdd d_clear_d_op() compatibility
Brian Behlendorf [Wed, 23 Jan 2013 00:14:43 +0000 (16:14 -0800)]
Add d_clear_d_op() compatibility

Added d_clear_d_op() helper function which clears some flags and the
registered dentry->d_op table.  This is required because d_set_d_op()
issues a warning when the dentry operations table is already set.
For the .zfs control directory to work properly we must be able to
override the default operations table and register custom .d_automount
and .d_revalidate callbacks.

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

11 years agofzap_cursor_move_to_key() should drop l_rwlock
Ned Bass [Tue, 22 Jan 2013 22:33:01 +0000 (14:33 -0800)]
fzap_cursor_move_to_key() should drop l_rwlock

Callers of zap_deref_leaf() must be careful to drop leaf->l_rwlock
since that function returns with the lock held on success.  All other
callers drop the lock correctly but it seems fzap_cursor_move_to_key()
does not.  This may block writers or cause VERIFY failures when the
lock is freed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1215
Closes zfsonlinux/spl#143
Closes zfsonlinux/spl#97

11 years agoFix zpl_revalidate() NULL deref
Brian Behlendorf [Tue, 22 Jan 2013 17:05:49 +0000 (09:05 -0800)]
Fix zpl_revalidate() NULL deref

In zpl_revalidate() it's possible for the nameidata to be NULL
for kernels which still accept the parameter.  In particular,
lookup_one_len() calls d_revalidate() with a NULL nameidata.

Resolve the issue by checking for a NULL nameidata in which case
just set the flags to 0.

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

11 years agoPPA 0.6.0.93-0ubuntu1 release.
Darik Horn [Sat, 19 Jan 2013 04:18:55 +0000 (22:18 -0600)]
PPA 0.6.0.93-0ubuntu1 release.

11 years agoAdd PPA_NEWS test to the debuild helper.
Darik Horn [Sat, 19 Jan 2013 04:16:22 +0000 (22:16 -0600)]
Add PPA_NEWS test to the debuild helper.

Most releases do not update the NEWS file.

11 years agoRefresh debian/patches after upstream merge.
Darik Horn [Sat, 19 Jan 2013 04:13:58 +0000 (22:13 -0600)]
Refresh debian/patches after upstream merge.

11 years agoMerge branch 'upstream'
Darik Horn [Sat, 19 Jan 2013 04:12:50 +0000 (22:12 -0600)]
Merge branch 'upstream'

11 years agoUse sb->s_d_op default dentry operations
Brian Behlendorf [Fri, 18 Jan 2013 22:11:40 +0000 (14:11 -0800)]
Use sb->s_d_op default dentry operations

As of Linux 2.6.37 the right way to register custom dentry
operations is to use the super block's ->s_d_op field.
For older kernels they should be registered as part of the
lookup operation.

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

11 years agoFix zpool on zvol deadlock
Massimo Maggi [Fri, 18 Jan 2013 17:44:09 +0000 (09:44 -0800)]
Fix zpool on zvol deadlock

Commit 65d56083b4617a4cade0cff68cbbaf68114169d6 fixes the lock
inversion between spa_namespace_lock and bdev->bd_mutex but only
for the first user of spa_namespace_lock: dmu_objset_own().
Later spa_namespace_lock gets acquired by dsl_prop_get_integer()
though dsl_prop_get()->dsl_dataset_hold()->dsl_dir_open_spa()->
spa_open()->spa_open_common() without this "protection".  By
moving the mutex release after this second use, even this
acquisition of the lock is "protected" by the ERESTARTSYS trick.

Signed-off-by: Massimo Maggi <me@massimo-maggi.eu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1220

11 years agoRevert "Revert "Fix unlink/xattr deadlock""
Brian Behlendorf [Thu, 17 Jan 2013 18:05:42 +0000 (10:05 -0800)]
Revert "Revert "Fix unlink/xattr deadlock""

This reverts commit 53c7411919a64d6f0889aa0d6974610f6cd35744
effectively reinstating the asynchronous xattr cleanup code.

These Linux changes were reverted because after testing
and careful contemplation I was convinced that due to the
89260a1c8851ce05ea04b23606ba438b271d890 commit they were no
longer required.

Unfortunately, the deadlock described in #1176  was a case
which wasn't considered.  At mount zfs_unlinked_drain() can
occur which will unlink a list of znodes in effectively a
random order which isn't safe.  The only reason it was safe
to originally revert this change was the we could guarantee
that the VFS would always prune the xattr leaves before the
parents.

Therefore, until we can cleanly resolve this deadlock for
all cases we need to keep this change in spite of the xattr
unlink performance penalty associated with it.

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

11 years agoFix 'zfs rollback' on mounted file systems
Brian Behlendorf [Wed, 16 Jan 2013 00:41:09 +0000 (16:41 -0800)]
Fix 'zfs rollback' on mounted file systems

Rolling back a mounted filesystem with open file handles and
cached dentries+inodes never worked properly in ZoL.  The
major issue was that Linux provides no easy mechanism for
modules to invalidate the inode cache for a file system.

Because of this it was possible that an inode from the previous
filesystem would not get properly dropped from the cache during
rolling back.  Then a new inode with the same inode number would
be create and collide with the existing cached inode.  Ideally
this would trigger an VERIFY() but in practice the error wasn't
handled and it would just NULL reference.

Luckily, this issue can be resolved by sprucing up the existing
Solaris zfs_rezget() functionality for the Linux VFS.

The way it works now is that when a file system is rolled back
all the cached inodes will be traversed and refetched from disk.
If a version of the cached inode exists on disk the in-core
copy will be updated accordingly.  If there is no match for that
object on disk it will be unhashed from the inode cache and
marked as stale.

This will effectively make the inode unfindable for lookups
allowing the inode number to be immediately recycled.  The inode
will then only be accessible from the cached dentries.  Subsequent
dentry lookups which reference a stale inode will result in the
dentry being invalidated.  Once invalidated the dentry will drop
its reference on the inode allowing it to be safely pruned from
the cache.

Special care is taken for negative dentries since they do not
reference any inode.  These dentires will be invalidate based
on when they were added to the dentry cache.  Entries added
before the last rollback will be invalidate to prevent them
from masking real files in the dataset.

Two nice side effects of this fix are:

* Removes the dependency on spl_invalidate_inodes(), it can now
  be safely removed from the SPL when we choose to do so.

* zfs_znode_alloc() no longer requires a dentry to be passed.
  This effectively reverts this portition of the code to its
  upstream counterpart.  The dentry is not instantiated more
  correctly in the Linux ZPL layer.

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

11 years agoFix false ENOENT on snapshot control dentries
Ned Bass [Mon, 14 Jan 2013 21:59:14 +0000 (13:59 -0800)]
Fix false ENOENT on snapshot control dentries

Lookups in the snapshot control directory for an existing snapshot
fail with ENOENT if an earlier lookup failed before the snapshot was
created.  This is because the earlier lookup causes a negative dentry
to be cached which is never invalidated.

The bug can be reproduced as follows (the second ls should succeed):

 $ ls /tank/.zfs/snapshot/s
 ls: cannot access /tank/.zfs/snapshot/s: No such file or directory
 $ zfs snap tank@s
 $ ls /tank/.zfs/snapshot/s
 ls: cannot access /tank/.zfs/snapshot/s: No such file or directory

To remedy this, always invalidate cached dentries in the snapshot
control directory.  Since these entries never exist on disk there is
no significant performance penalty for the extra lookups.

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

11 years agoFix quoting error in unmount command
Ned Bass [Wed, 16 Jan 2013 20:44:25 +0000 (12:44 -0800)]
Fix quoting error in unmount command

A misplaced single quote caused the umount command to fail with a
syntax error when unmounting snapshots under the .zfs/snapshot
control directory.

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

11 years agoEnsure that zfs diff prints unicode safely.
Darik Horn [Tue, 15 Jan 2013 01:27:39 +0000 (19:27 -0600)]
Ensure that zfs diff prints unicode safely.

In the stream_bytes() library function used by `zfs diff`, explicitly
cast each byte in the input string to an unsigned character so that the
Linux fprintf() correctly escapes to octal and does not mangle the output.

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

11 years agoDo debian/NEWS updates in the debuild helper.
Darik Horn [Tue, 15 Jan 2013 03:37:25 +0000 (21:37 -0600)]
Do debian/NEWS updates in the debuild helper.

11 years agoPPA 0.6.0.92-0ubuntu1 release.
Darik Horn [Tue, 15 Jan 2013 03:19:31 +0000 (21:19 -0600)]
PPA 0.6.0.92-0ubuntu1 release.

11 years agoAdd a configurable sleep timer to pre_mountroot.
Darik Horn [Tue, 15 Jan 2013 02:14:53 +0000 (20:14 -0600)]
Add a configurable sleep timer to pre_mountroot.

Add a new `/etc/default/zfs` option:

* `ZFS_INITRD_PRE_MOUNTROOT_SLEEP`, which wastes an arbitrary amount
of time in the initrd environment before wait_for_udev is called.

This option is primarily a kludge for bad mpt2sas hardware that can go dumb
during system initialization. Thirty seconds should be enough for most
affected computers, but five minutes might be required in the worst case.

Closes: dajhorn/pkg-zfs#71
11 years agoStrengthen the /etc/zfs test in the zdev hook.
Darik Horn [Tue, 15 Jan 2013 01:51:13 +0000 (19:51 -0600)]
Strengthen the /etc/zfs test in the zdev hook.

Double-check that /etc/zfs is a readable directory before adding it
to the initrd.

11 years agoAdd /etc/default/zfs to the initrd.
Darik Horn [Tue, 15 Jan 2013 01:40:46 +0000 (19:40 -0600)]
Add /etc/default/zfs to the initrd.

Userland tunables will eventually be set in this options file.

11 years agoMerge branch 'upstream'
Darik Horn [Tue, 15 Jan 2013 01:30:05 +0000 (19:30 -0600)]
Merge branch 'upstream'

11 years agoIllumos #3189 kernel panic in test hotspare_onoffline_004_neg
Christopher Siden [Mon, 14 Jan 2013 18:29:55 +0000 (10:29 -0800)]
Illumos #3189 kernel panic in test hotspare_onoffline_004_neg

3189 kernel panic in ZFS test suite during hotspare_onoffline_004_neg

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Dan McDonald <danmcd@nexenta.com>

References:
  illumos/illumos-gate@8f0b538d1dc99df23a6a89cfd9ffddc1b9804a00
  changeset: 13818:e9ad0a945d45
  https://www.illumos.org/issues/3189

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #1862 incremental zfs receive fails for sparse file > 8PB
Arne Jansen [Mon, 14 Jan 2013 18:26:31 +0000 (10:26 -0800)]
Illumos #1862 incremental zfs receive fails for sparse file > 8PB

1862 incremental zfs receive fails for sparse file > 8PB

Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: Simon Klinkert <klinkert@webgods.de>
Approved by: Eric Schrock <eric.schrock@delphix.com>

References:
  illumos/illumos-gate@31495a1e56860f4575614774a592fe33fc9c71f2
  illumos changeset: 13789:f0c17d471b7a
  https://www.illumos.org/issues/1862

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #3208 cross-endian incorrect user/group accounting
Matthew Ahrens [Mon, 14 Jan 2013 17:31:53 +0000 (09:31 -0800)]
Illumos #3208 cross-endian incorrect user/group accounting

3208 moving zpool cross-endian results in incorrect user/group
accounting

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

References:
  illumos/illumos-gate@e828a46d29ad418487f50d56b5c19e2a1f9033a7
  illumos changeset: 13835:eea81edc4f14
  https://www.illumos.org/issues/3208

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #627
Closes #1136

11 years agoIllumos #3397, #3398
Christopher Siden [Sat, 12 Jan 2013 00:42:50 +0000 (16:42 -0800)]
Illumos #3397, #3398

3397 zdb <pool> <objnum> output is too verbose
3398 zdb can't dump feature flags zap objects

Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@nexenta.com>

References:
  illumos/illumos-gate@e690fb27a7d1483f052505e1ff373d205f9dee99
  https://www.illumos.org/issues/3397
  https://www.illumos.org/issues/3398

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #1884, #3028, #3048, #3049, #3060, #3061, #3093
Yuri Pankov [Thu, 10 Jan 2013 22:25:47 +0000 (14:25 -0800)]
Illumos #1884, #3028, #3048, #3049, #3060, #3061, #3093

1884 Empty "used" field for zfs *space commands
3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID
3048 zfs {user,group}space [-s|-S] is broken
3049 zfs {user,group}space -t doesn't really filter the results
3060 zfs {user,group}space -H output isn't tab-delimited
3061 zfs {user,group}space -o doesn't use specified fields order
3093 zfs {user,group}space's -i is noop

Reviewed by: Garry Mills <gary_mills@fastmail.fm>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

References:
  illumos/illumos-gate@89f5d17b06fc4132c983112b24836a779a0ed736
  illumos changeset: 13803:b5e49d71ff0e
  https://www.illumos.org/issues/1884
  https://www.illumos.org/issues/3028
  https://www.illumos.org/issues/3048
  https://www.illumos.org/issues/3049
  https://www.illumos.org/issues/3060
  https://www.illumos.org/issues/3061
  https://www.illumos.org/issues/3093

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1194

11 years agoIllumos #1377 `zpool status -D' should tell if there are no DDT entries
Yuri Pankov [Fri, 11 Jan 2013 17:11:09 +0000 (09:11 -0800)]
Illumos #1377 `zpool status -D' should tell if there are no DDT entries

1337 `zpool status -D' should tell if there are no DDT entries

Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: George Wilson <gwilson@zfsmail.com>
Approved by: Albert Lee <trisk@nexenta.com>

References:
  illumos/illumos-gate@ce72e614c133351311e87bbbe4eba8fea9e77768
  illumos changeset: 13432:d1ad8d106d64
  https://www.illumos.org/issues/1337

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #1557 assertion failed in userland taskq_destroy()
Garrett D'Amore [Fri, 11 Jan 2013 17:04:23 +0000 (09:04 -0800)]
Illumos #1557 assertion failed in userland taskq_destroy()

1557 assertion failed in userland taskq_destroy()

Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: George Wilson <gwilson@zfsmail.com>
Approved by: Eric Schrock <eric.schrock@delphix.com>

References:
  illumos/illumos-gate@aa846ad9bc4785806bb6263657698d5890afbc08
  illumos changeset: 13597:3eac1e8e0f4c
  https://www.illumos.org/issues/1557

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #2618 arc.c mistypes in the comments
Bart Coddens [Fri, 11 Jan 2013 16:54:18 +0000 (08:54 -0800)]
Illumos #2618 arc.c mistypes in the comments

2618 arc.c mistypes in the comments

Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Josef Sipek <jeffpc@josefsipek.net>
Approved by: Richard Lowe <richlowe@richlowe.net>

References:
  illumos/illumos-gate@fc98fea58e89224f6f13d7fae246d6cb5dfa35ea
  illumos changeset: 13721:5b51a16a186f
  https://www.illumos.org/issues/2618

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoOnly use gcc -Wunused-but-set-variable when available
Brian Behlendorf [Fri, 11 Jan 2013 00:09:31 +0000 (16:09 -0800)]
Only use gcc -Wunused-but-set-variable when available

Certain versions of gcc generate an 'unrecognized command
line option' error message when -Wunused-but-set-variable
is used unconditionally.  This in turn can cause several
of the autoconf tests to misdetect an interface.

Now, the use of -Wunused-but-set-variable in the autoconf
tests was introduced by commit b9c59ec8 to address a gcc
4.6 compatibility problem.  So we really only need to pass
this option for version of gcc which are known to support it.

Therefore, the tests have been updated to use the result of
the existing ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
which determines if gcc supports this option.

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

11 years ago'zfs send' man page sync'ed with Illumos
Steven Burgess [Fri, 28 Dec 2012 21:53:18 +0000 (16:53 -0500)]
'zfs send' man page sync'ed with Illumos

* Move -R option up one position in the list to match
  the Illumos documentation.

* Move -D option up one position and refreshed it to
  match the Illumos documentation.

* Move -p option up one position and refreshed it to
  match the Illumos documentation.

* Add the -n, -P  documentation found in zfs receive
  in to zfs send where to belongs.

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

11 years ago'zfs receive' man page sync'ed with Illumos
Steven Burgess [Fri, 28 Dec 2012 21:36:10 +0000 (16:36 -0500)]
'zfs receive' man page sync'ed with Illumos

The only valid options are -vnFu, these other ones seem to be
misplaced zfs send options.

Remove: -D -r -p -n -P

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

11 years agoAdd /sbin/fsck.zfs helper
Brian Behlendorf [Wed, 9 Jan 2013 20:51:29 +0000 (12:51 -0800)]
Add /sbin/fsck.zfs helper

A fsck helper to accomidate distributions that expect to be able
to execute a fsck on all filesystem types.  Currently this script
does nothing but it could be extended to act as a compatibility
wrapper for 'zpool scrub'.

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

11 years agoReport realpath() canonicalization error
Brian Behlendorf [Wed, 9 Jan 2013 19:56:37 +0000 (11:56 -0800)]
Report realpath() canonicalization error

Rather than just reporting the failure include the passed
mount point and error number.

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

11 years agocall_usermodehelper() should wait for process
Ned Bass [Wed, 9 Jan 2013 23:46:31 +0000 (15:46 -0800)]
call_usermodehelper() should wait for process

As of Linux 3.4 the UMH_WAIT_* constants were renumbered.  In
particular, the meaning of "1" changed from UMH_WAIT_PROC (wait for
process to complete), to UMH_WAIT_EXEC (wait for the exec, but not the
process).  A number of call sites used the number 1 instead of the
constant name, so the behavior was not as expected on kernels with this
change.

One visible consequence of this change was that processes accessing
automounted snapshots received an ELOOP error because they failed to
wait for zfs.mount to complete.

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

11 years agoRevert "Avoid ELOOP on auto-mounted snapshots"
Brian Behlendorf [Wed, 9 Jan 2013 19:09:06 +0000 (11:09 -0800)]
Revert "Avoid ELOOP on auto-mounted snapshots"

This reverts commit 7afcf5b1da83549bfba70a61fae7a00eaa63c2b0 which
accidentally introduced a regression with the .zfs snapshot directory.
While the updated code still does correctly mount the requested
snapshot.  It updates the vfsmount such that it references the
original dataset vfsmount.  The result is that the snapshot itself
isn't visible.

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

11 years agoOnly reduce __zio_execute() stack usage in kernel space
Brian Behlendorf [Wed, 9 Jan 2013 00:16:46 +0000 (16:16 -0800)]
Only reduce __zio_execute() stack usage in kernel space

Related to 91579709fccd3e55a21970742b66c388fb1403db we need to
be very careful about not overrunning the stack in kernel space.
However, in user space we're already allowing slightly larger
stacks so this stack usage optimization is not required there.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoMerge branch 'feature-flags'
Brian Behlendorf [Tue, 8 Jan 2013 18:59:05 +0000 (10:59 -0800)]
Merge branch 'feature-flags'

Feature flags support for ZFS ported from Illumos.  Only minimal
compatibility changes were made where required to accomidate Linux.
For a detailed description of feature flags see original proposal
on zfs-discuss.  They are conceptually very similar to Linux's
ext[234] style of feature flags.

http://lists.freebsd.org/pipermail/freebsd-fs/2011-May/011568.html

NOTE: This branch updates the default pool version for new pools
from 28 to 5000.  Version 28 pools may still be created for
compatibility with Solaris by using the '-o version=28' option.

$ zpool create -o version=28 ...

Existing pools must be manually upgraded using 'zpool upgrade'.

$ zpool upgrade ...

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

11 years agoIllumos #3145, #3212
George Wilson [Fri, 21 Dec 2012 22:57:09 +0000 (14:57 -0800)]
Illumos #3145, #3212

3145 single-copy arc
3212 ztest: race condition between vdev_online() and spa_vdev_remove()

Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Justin T. Gibbs <gibbs@scsiguy.com>
Approved by: Eric Schrock <eric.schrock@delphix.com>

References:
  illumos-gate/commit/9253d63df408bb48584e0b1abfcc24ef2472382e
  illumos changeset: 13840:97fd5cdf328a
  https://www.illumos.org/issues/3145
  https://www.illumos.org/issues/3212

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #989
Closes #1137

11 years agoIllumos #3104: eliminate empty bpobjs
Matthew Ahrens [Sun, 23 Dec 2012 23:57:14 +0000 (15:57 -0800)]
Illumos #3104: eliminate empty bpobjs

3104 eliminate empty bpobjs
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Eric Schrock <eric.schrock@delphix.com>

References:
  illumos/illumos-gate@f17457368189aa911f774c38c1f21875a568bdca
  illumos changeset: 13782:8f78aae28a63
  https://www.illumos.org/issues/3104

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoFix __zio_execute() asynchronous dispatch
Brian Behlendorf [Tue, 18 Dec 2012 00:23:27 +0000 (16:23 -0800)]
Fix __zio_execute() asynchronous dispatch

To save valuable stack all zio's were made asynchronous when in the
tgx_sync_thread context or during pool initialization.  See commit
2fac4c2 for the original patch and motivation.

Unfortuantely, the changes to dsl_pool_sync_context() made by the
feature flags broke this logic causing in __zio_execute() to dispatch
itself infinitely when called during pool initialization.  This
commit refines the existing logic to specificly target only the two
cases we care about.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #3349: zpool upgrade -V bumps the on disk version number
George Wilson [Sat, 15 Dec 2012 00:28:49 +0000 (16:28 -0800)]
Illumos #3349: zpool upgrade -V bumps the on disk version number

3349 zpool upgrade -V bumps the on disk version number, but leaves
the in core version
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@nexenta.com>

References:
  illumos/illumos-gate@25345e466695fbe736faa53b8f3413d8e8f81981
  https://www.illumos.org/issues/3349

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #3086: unnecessarily setting DS_FLAG_INCONSISTENT on async
Matthew Ahrens [Sat, 15 Dec 2012 00:13:40 +0000 (16:13 -0800)]
Illumos #3086: unnecessarily setting DS_FLAG_INCONSISTENT on async

3086 unnecessarily setting DS_FLAG_INCONSISTENT on async
destroyed datasets
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Approved by: Eric Schrock <Eric.Schrock@delphix.com>

References:
  illumos/illumos-gate@ce636f8b38e8c9ff484e880d9abb27251a882860
  illumos changeset: 13776:cd512c80fd75
  https://www.illumos.org/issues/3086

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #2762: zpool command should have better support for feature flags
Christopher Siden [Fri, 14 Dec 2012 23:00:45 +0000 (15:00 -0800)]
Illumos #2762: zpool command should have better support for feature flags

2762 zpool command should have better support for feature flags
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Eric Schrock <Eric.Schrock@delphix.com>

References:
  illumos/illumos-gate@57221772c3fc05faba04bf48ddff45abf2bbf2bd
  https://www.illumos.org/issues/2762

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoIllumos #3090 and #3102
George Wilson [Fri, 14 Dec 2012 20:38:04 +0000 (12:38 -0800)]
Illumos #3090 and #3102

3090 vdev_reopen() during reguid causes vdev to be treated as corrupt
3102 vdev_uberblock_load() and vdev_validate() may read the wrong label

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Eric Schrock <Eric.Schrock@delphix.com>

References:
  illumos/illumos-gate@dfbb943217bf8ab22a1a9d2e9dca01d4da95ee0b
  illumos changeset: 13777:b1e53580146d
  https://www.illumos.org/issues/3090
  https://www.illumos.org/issues/3102

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #939

11 years agoRevert "Temporarily disable the reguid test."
Brian Behlendorf [Fri, 14 Dec 2012 20:24:04 +0000 (12:24 -0800)]
Revert "Temporarily disable the reguid test."

This reverts commit d13524579162b35189804c357a63993be758b84c.
Since feature flags have now been merged we can apply the real
upstream fix from Illumos.

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

11 years agoIllumos #2619 and #2747
Christopher Siden [Thu, 13 Dec 2012 23:24:15 +0000 (15:24 -0800)]
Illumos #2619 and #2747

2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Approved by: Eric Schrock <Eric.Schrock@delphix.com>

References:
  illumos/illumos-gate@53089ab7c84db6fb76c16ca50076c147cda11757
  illumos/illumos-gate@ad135b5d644628e791c3188a6ecbd9c257961ef8
  illumos changeset: 13700:2889e2596bd6
  https://www.illumos.org/issues/2619
  https://www.illumos.org/issues/2747

NOTE: The grub specific changes were not ported.  This change
must be made to the Linux grub packages.

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoFix duplicate words in zpool.8
Dominik Honnef [Fri, 4 Jan 2013 19:09:20 +0000 (20:09 +0100)]
Fix duplicate words in zpool.8

Remove the duplicate words 'cannot be' from the zpool.8 man page.

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

11 years agoAllow fake mounts to succeed on non-legacy filesystems.
Will Rouesnel [Thu, 27 Dec 2012 14:44:16 +0000 (01:44 +1100)]
Allow fake mounts to succeed on non-legacy filesystems.

mountall in Debian depends on being able to pass the -f parameter to
mount, which specifies a fake mount and just updates the mtab. Currently
mount.zfs will fail such a request if it is not passed with -o zfsutil.

This patch allows a fake mount on a non-legacy filesystem to succeed in
the same manner as a -o remount does, thus enabling mountall to work
correctly.

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

11 years agoFix gcc array subscript above bounds warning
Ned Bass [Wed, 26 Dec 2012 22:56:41 +0000 (14:56 -0800)]
Fix gcc array subscript above bounds warning

In a debug build, certain GCC versions flag an array bounds warning in
the below code from dnode_sync.c

    } else {
            int i;
            ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr);
            /* the blkptrs we are losing better be unallocated */
            for (i = dn->dn_next_nblkptr[txgoff];
                i < dnp->dn_nblkptr; i++)
                    ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));

This usage is in fact safe, since the ASSERT ensures the index does
not exceed to maximum possible number of block pointers. However gcc
can't determine that the assignment 'i = dn->dn_next_nblkptr[txgoff];'
falls within the array bounds so it issues a warning.  To avoid this,
initialize i to zero to make gcc happy but skip the elements before
dn->dn_next_nblkptr[txgoff] in the loop body.  Since a dnode contains
at most 3 block pointers this overhead should be negligible.

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

11 years agoMerge branch 'io_schedule'
Brian Behlendorf [Mon, 7 Jan 2013 18:54:56 +0000 (10:54 -0800)]
Merge branch 'io_schedule'

Currently ZFS doesn't show any I/O time in eg "top" wait% or in
/proc/$pid/stat's blkio_ticks.  Using io_schedule() instead of
schedule() in zio_wait()'s cv_wait() is the correct way to fix
this.

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

11 years agoUse cv_wait_io() which will will account for iowait
Matt Johnston [Fri, 21 Dec 2012 02:40:20 +0000 (10:40 +0800)]
Use cv_wait_io() which will will account for iowait

Update zio_wait() to use cv_wait_io() to ensure the iowait time
is properly accounted for.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRevert part of "Log I/Os longer than zio_delay_max (30s default)"
Matt Johnston [Fri, 21 Dec 2012 02:15:34 +0000 (10:15 +0800)]
Revert part of "Log I/Os longer than zio_delay_max (30s default)"

This reverts commit 9dcb97198338ba2d8764dd5604b278118612f74
which was originally introduced to debug occasional slow I/Os.
These I/Os would complete eventually but were observed to take
several 100 seconds.

The root cause of this issue was the CFQ scheduler which can,
under certain conditions, excessively delay an I/O from being
issued to the device.  This issue was mitigated somewhat by
commit 84daaddedbfc9cf4bd1490d8a6f4b2967051e308 which ensures
the I/O elevator gets changed even for DM style devices.

This change isn't in any way harmful but it does conflict with
a required change to properly account from I/O wait time.
Because Linux does not export the io_schedule_timeout() function
we must instead rely  on io_schedule() via cv_wait_io().

The additional debugging information which was added to the
delay event has been intentionally left in place.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoPPA 0.6.0.91-0ubuntu1 release. (rc13)
Darik Horn [Fri, 21 Dec 2012 03:28:54 +0000 (21:28 -0600)]
PPA 0.6.0.91-0ubuntu1 release. (rc13)

11 years agoSet the execute bit on 10zvol-test for os-prober.
Darik Horn [Fri, 21 Dec 2012 03:25:30 +0000 (21:25 -0600)]
Set the execute bit on 10zvol-test for os-prober.

Run-parts in `/usr/lib/os-probes` should be chmod 644.

11 years agoRefresh debian/patches after upstream merge.
Darik Horn [Fri, 21 Dec 2012 03:23:17 +0000 (21:23 -0600)]
Refresh debian/patches after upstream merge.

11 years agoMerge branch 'upstream'
Darik Horn [Fri, 21 Dec 2012 03:18:57 +0000 (21:18 -0600)]
Merge branch 'upstream'

11 years agoZFS 0.6.0-rc13
Brian Behlendorf [Thu, 20 Dec 2012 19:02:24 +0000 (11:02 -0800)]
ZFS 0.6.0-rc13

11 years agoFix zpool on zvol lock inversion deadlock
Brian Behlendorf [Wed, 19 Dec 2012 21:51:44 +0000 (13:51 -0800)]
Fix zpool on zvol lock inversion deadlock

In all but one case the spa_namespace_lock is taken before the
bdev->bd_mutex lock.  But Linux __blkdev_get() function calls
fops->open() with the bdev->bd_mutex lock held and we must
somehow still safely acquire the spa_namespace_lock.

To avoid a potential lock inversion deadlock we preemptively
try to take the spa_namespace_lock().  Normally it will not
be contended and this is safe because spa_open_common() handles
the case where the caller already holds the spa_namespace_lock.

When it is contended we risk a lock inversion if we were to
block waiting for the lock.  Luckily, the __blkdev_get()
function allows us to return -ERESTARTSYS which will result in
bdev->bd_mutex being dropped, reacquired, and fops->open() being
called again.  This process can be repeated safely until both
locks are acquired.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #612

11 years agoRevert "Remove TSD zfs_fsyncer_key"
Brian Behlendorf [Thu, 20 Dec 2012 17:55:47 +0000 (09:55 -0800)]
Revert "Remove TSD zfs_fsyncer_key"

This reverts commit 31f2b5abdf95d8426d8bfd66ca7f62ec70215e3c back
to the original code until the fsync(2) performance regression
can be addressed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRefresh AUTHORS
Brian Behlendorf [Wed, 19 Dec 2012 17:47:25 +0000 (09:47 -0800)]
Refresh AUTHORS

The AUTHORS file was getting stale.  Refresh its contents
using the authors listed in the git commit logs.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRemove the ChangeLog
Brian Behlendorf [Wed, 19 Dec 2012 17:22:07 +0000 (09:22 -0800)]
Remove the ChangeLog

The ChangeLog was retired long ago, the git commit logs are
authoritative.  To avoid any confusion remove the ChangeLog.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRemove TSD zfs_fsyncer_key
Brian Behlendorf [Thu, 13 Dec 2012 20:21:11 +0000 (12:21 -0800)]
Remove TSD zfs_fsyncer_key

It's my understanding that the zfs_fsyncer_key TSD was added as
a performance omtimization to reduce contention on the zl_lock
from zil_commit().  This issue manifested itself as very long
(100+ms) fsync() system call times for fsync() heavy workloads.

However, under Linux I'm not seeing the same contention that
was originally described.  Therefore, I'm removing this code
in order to ween ourselves off any dependence on TSD.  If the
original performance issue reappears on Linux we can revisit
fixing it without resorting to TSD.

This just leaves one small ZFS TSD consumer.  If it can be
cleanly removed from the code we'll be able to shed the SPL
TSD implementation entirely.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/spl#174

11 years agoSet elevator for DM devices despite vdev_wholedisk
Prakash Surya [Sat, 15 Dec 2012 00:16:35 +0000 (16:16 -0800)]
Set elevator for DM devices despite vdev_wholedisk

The current state of udev and devicer-mapper devices makes it difficult
to construct a mapping of DM partitions and their underlying DM device.
For example, with a /dev directory with the following contents:

    $ ls -d /dev/dm-*
    /dev/dm-0
    /dev/dm-1
    /dev/dm-2
    /dev/dm-3

it is not immediately apparent if these are completely separate devices,
or partitions and real devices intermixed. In contrast, SCSI devices
would appear as so:

    $ ls -d /dev/sd*
    /dev/sda
    /dev/sda1
    /dev/sdb
    /dev/sdb1

Here, one can immediately determine that there are two devices (sda and
sdb), each containing a single partition. The lack of a predictable and
consistent mapping from DM devices to DM device partitions makes it
difficult for user space to process these devices the same way it does
SCSI devices.

As a result, the ZFS utilities do not partition DM devices, and instead
set the "vdev_wholedisk" label to 0 and treat them as partitions. This
has the side effect that, even if ZFS has sole ownership of the device,
the IO scheduler will not be modified because it is treated as a
partition.

This change adds an exception for DM devices in vdev_elevator_switch,
allowing the elevator to be modified even though the "vdev_wholedisk"
property is not set.

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

11 years agoFix using zvol as slog device
Jorgen Lundman [Mon, 17 Dec 2012 01:33:57 +0000 (10:33 +0900)]
Fix using zvol as slog device

During the original ZoL port the vdev_uses_zvols() function was
disabled until it could be properly implemented.  This prevented
a zpool from use a zvol for its slog device.

This patch implements that missing functionality by adding a
zvol_is_zvol() function to zvol.c.  Given the full path to a
device it will lookup the device and verify its major number
against the registered zvol major number for the system.  If
they match we know the device is a zvol.

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

11 years agoFix get/set users/groups in quota props via numeric id
Massimo Maggi [Sun, 16 Dec 2012 13:33:51 +0000 (14:33 +0100)]
Fix get/set users/groups in quota props via numeric id

Fix setting/getting users/groups in quota properties through
numeric identifier.  This support was accidentally disabled
in the original port by applying the HAVE_IDMAP wrapper macro
too broadly.

Fix obtained by moving #ifdef HAVE_IDMAP to exclude only
the part of code that really needs IDMAP.  Now zfs (get|set)
(user|group)quota@1000 works as expected.

Signed-off-by: Massimo Maggi <massimo@mmmm.it>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1147

11 years agoDo not use KERNEL_DIR env var in Makefile.am
Richard Yao [Sun, 16 Dec 2012 05:35:16 +0000 (00:35 -0500)]
Do not use KERNEL_DIR env var in Makefile.am

A Gentoo user reported an issue where the build system would
attempt to recurse into the kernel source tree if KERNEL_DIR
is set in the environment. KERNEL_DIR is an environment variable
that is used when the kernel sources are in a non-standard
location, so it is necessary to stop relying on it to prevent
this issue.

https://bugs.gentoo.org/show_bug.cgi?id=433946

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoNormalize dkms.conf bash syntax.
Darik Horn [Sun, 16 Dec 2012 18:49:19 +0000 (12:49 -0600)]
Normalize dkms.conf bash syntax.

11 years agoSupport unstripped DKMS modules.
Darik Horn [Sat, 15 Dec 2012 23:01:34 +0000 (17:01 -0600)]
Support unstripped DKMS modules.

Add three new `/etc/default/zfs` options:

* `ZFS_DKMS_ENABLE_DEBUG`, which appends `--enable-debug` to the dkms
configuration line.

* `ZFS_DKMS_ENABLE_DEBUG_DMU_TX`, which appends `--enable-debug-dmu-tx`
to the dkms configuration line.

* `ZFS_DKMS_DISABLE_STRIP`, which keeps ko debugging symbols intact.

This kind of true-false toggle is safer than something more extensible
like a passthrough variable because typos in the configuration file
happen frequently and many package managers mask the resulting error.

The natural direction of the STRIP option is reversed to preserve
current behavior for implied defaults.

Closes: zfsonlinux/zfs#1143 for pkg-zfs.
11 years agoSimplify the /etc/default/zfs documentation.
Darik Horn [Sat, 15 Dec 2012 21:35:17 +0000 (15:35 -0600)]
Simplify the /etc/default/zfs documentation.

Most people read a maximum of two lines in this file before changing
something. Visually separate the options and put only the most basic
message in each comment.

11 years agoPPA 0.6.0.90-0ubuntu1 release.
Darik Horn [Sat, 15 Dec 2012 21:46:33 +0000 (15:46 -0600)]
PPA 0.6.0.90-0ubuntu1 release.

11 years agoRefresh debian/patches after upstream merge.
Darik Horn [Sat, 15 Dec 2012 21:44:57 +0000 (15:44 -0600)]
Refresh debian/patches after upstream merge.

11 years agoMerge branch 'upstream'
Darik Horn [Sat, 15 Dec 2012 21:43:23 +0000 (15:43 -0600)]
Merge branch 'upstream'

11 years agoAdded call to hide Plymouth when error shell is launched.
Will Rouesnel [Sat, 8 Dec 2012 12:46:35 +0000 (23:46 +1100)]
Added call to hide Plymouth when error shell is launched.

This allows users with Plymouth to see and interact with the spawned
shell under error conditions.

Amended-by: Darik Horn <dajhorn@vanadac.com>
11 years agoUpdate SAs when an inode is dirtied
Brian Behlendorf [Wed, 12 Dec 2012 00:58:44 +0000 (16:58 -0800)]
Update SAs when an inode is dirtied

Revert the portion of commit d3aa3ea which always resulted in the
SAs being update when an mmap()'ed file was closed.  That change
accidentally resulted in unexpected ctime updates which upset tools
like git.  That was always a horrible hack and I'm happy it will
never make it in to a tagged release.

The right fix is something I initially resisted doing because I
was worried about the additional overhead.  However, in hindsight
the overhead isn't as bad as I feared.

This patch implemented the sops->dirty_inode() callback which is
unsurprisingly called when an inode is dirtied.  We leverage this
callback to keep the znode SAs strictly in sync with the inode.

However, for now we're going to go slowly to avoid introducing
any new unexpected issues by only updating the atime, mtime, and
ctime.  This will cover the callpath of most concern to us.

  ->filemap_page_mkwrite->file_update_time->update_time->
      mark_inode_dirty_sync->__mark_inode_dirty->dirty_inode

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

11 years agoUpdate 69-vdev.rules .gitignore
Brian Behlendorf [Fri, 14 Dec 2012 19:45:41 +0000 (11:45 -0800)]
Update 69-vdev.rules .gitignore

Commit 2957f38 renamed 60-vdev.rules to 69-vdev.rules but failed
to update the .gitignore file to reflect this change.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoAvoid ELOOP on auto-mounted snapshots
Ned Bass [Wed, 12 Dec 2012 23:55:51 +0000 (15:55 -0800)]
Avoid ELOOP on auto-mounted snapshots

Ensure that the path member pointers are associated with the
newly-mounted snapshot when zpl_snapdir_automount() returns.  Otherwise
the follow_automount() function may be called repeatedly, leading to an
incorrect ELOOP error return. This problem was observed as a 'Too many
levels of symbolic links' error from user-space commands accessing an
unmounted snapshot in the .zfs/snapshot directory.

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

11 years agoLinux 3.7 compat, schedule_delayed_work()
Brian Behlendorf [Mon, 10 Dec 2012 18:15:12 +0000 (10:15 -0800)]
Linux 3.7 compat, schedule_delayed_work()

Linux kernel commit d8e794d accidentally broke the delayed work
APIs for non-GPL callers.   While the APIs to schedule a delayed
work item are still available to all callers, it is no longer
possible to initialize the delayed work item.

I'm cautiously optimistic we could get the delayed_work_timer_fn
exported for all callers in the upstream kernel.  But frankly
the compatibility code to use this kernel interface has always
been problematic.

Therefore, this patch abandons direct use the of the Linux
kernel interface in favor of the new delayed taskq interface.
It provides roughly the same functionality as delayed work queues
but it's a stable interface under our control.

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

11 years agoSwitch KM_SLEEP to KM_PUSHPAGE
Richard Yao [Sat, 8 Dec 2012 13:38:13 +0000 (08:38 -0500)]
Switch KM_SLEEP to KM_PUSHPAGE

When writes to zvols invoke ZIL, zfs_range_new_proxy() is called,
which allocates memory using KM_SLEEP, triggering a warning.
Switch to KM_PUSHPAGE to silence that warning.  See commit
b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1138

11 years agoAdd os-prober test for zvols.
Peter Fern [Sun, 9 Dec 2012 11:31:48 +0000 (05:31 -0600)]
Add os-prober test for zvols.

When `update-grub` is invoked, `os-prober` tries to mount each zvol
node, which is slow on systems with more than a few hundred volumes.

Add a device test for `os-prober` that returns early on zvols.

Closes: dajhorn/pkg-zfs#62
11 years agoPPA 0.6.0.89-0ubuntu1 release.
Darik Horn [Thu, 6 Dec 2012 04:14:51 +0000 (22:14 -0600)]
PPA 0.6.0.89-0ubuntu1 release.

11 years agoSuggest samba-common-bin for zfsutils.
Darik Horn [Thu, 6 Dec 2012 04:11:01 +0000 (22:11 -0600)]
Suggest samba-common-bin for zfsutils.

Add "Suggests: samba-common-bin (>= 3.0.23)" in the `debian/control`
file. Upstream implemented smbshare property support at commit
645fb9cc214c79c77378dd1e1fd2e3ef668bc848.

11 years agoRefresh debian/patches after upstream merge.
Darik Horn [Thu, 6 Dec 2012 04:01:51 +0000 (22:01 -0600)]
Refresh debian/patches after upstream merge.

11 years agoMerge branch 'upstream'
Darik Horn [Thu, 6 Dec 2012 03:54:30 +0000 (21:54 -0600)]
Merge branch 'upstream'

11 years agoRevert "Fix unlink/xattr deadlock"
Brian Behlendorf [Wed, 5 Dec 2012 21:00:49 +0000 (13:00 -0800)]
Revert "Fix unlink/xattr deadlock"

This reverts commit b00131d43ca344d4b205a03ab3eb771a060e5087 which
is no longer needed due to e89260a1c8851ce05ea04b23606ba438b271d890.

This change forces all xattr znodes to hold a reference on their
parent which ensures prune_icache() will never attempt to evict
both the parent and child concurrently.  This effectively prevents
the deadlock condition from ever occuring.

Therefore we can safely revert back to the upstream synchronous
cleanup code.  This is nice because it keeps our code base closer
to upstream and resolves the performance issues introduced by the
original deadlock fix.

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

11 years agoPreserve inode mtime/ctime in .writepage()
Brian Behlendorf [Tue, 4 Dec 2012 20:11:02 +0000 (12:11 -0800)]
Preserve inode mtime/ctime in .writepage()

When updating a file via mmap()'ed I/O preserve the mtime/ctime
which were updated when the page was made writable by the generic
callback filemap_page_mkwrite().

But more importantly than preserving the exact time add the missing
call to sa_bulk_update().  This ensures that the znode modifications
are written to disk as part of the transaction.  Without this the
inode may mistaken rollback to the previous on-disk znode state.

Additionally, for mmap()'ed znodes explicitly set the atime, mtime,
and ctime on close using the up to date values in the inode.  This
is critical because writepage() may occur after close and on close
we need to ensure the values are correct.

Original-patch-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #764

11 years agoFix 'zpool create' segfault due to bad syntax
Jorgen Lundman [Thu, 29 Nov 2012 05:56:07 +0000 (14:56 +0900)]
Fix 'zpool create' segfault due to bad syntax

Incorrect syntax should never cause a segfault.  In this case
listing multiple comma delimited options after '-o' triggered
the problem.  For example:

  zpool create -o ashift=12,listsnaps=on

This patch resolves the issue by wrapping the calls which use
hdr with a NULL test.

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

11 years agovdev_id support for device link aliases
Ned Bass [Thu, 29 Nov 2012 19:08:37 +0000 (11:08 -0800)]
vdev_id support for device link aliases

Add a vdev_id feature to map device names based on already defined
udev device links.  To increase the odds that vdev_id will run after
the rules it depends on, increase the vdev.rules rule number from 60
to 69.  With this change, vdev_id now provides functionality analogous
to zpool_id and zpool_layout, paving the way to retire those tools.

A defined alias takes precedence over a topology-derived name, but the
two naming methods can otherwise coexist. For example, one might name
drives in a JBOD with the sas_direct topology while naming an internal
L2ARC device with an alias.

For example, the following lines in vdev_id.conf will result in the
creation of links /dev/disk/by-vdev/{d1,d2}, each pointing to the same
target as the device link specified in the third field.

  #     by-vdev
  #     name     fully qualified or base name of device link
  alias d1       /dev/disk/by-id/wwn-0x5000c5002de3b9ca
  alias d2       wwn-0x5000c5002def789e

Also perform some minor vdev_id cleanup, such as removal of the unused
-s command line option.

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

11 years agoDirectory xattr znodes hold a reference on their parent
Brian Behlendorf [Fri, 30 Nov 2012 00:10:03 +0000 (16:10 -0800)]
Directory xattr znodes hold a reference on their parent

Unlike normal file or directory znodes, an xattr znode is
guaranteed to only have a single parent.  Therefore, we can
take a refernce on that parent if it is provided at create
time and cache it.  Additionally, we take care to cache it
on any subsequent zfs_zaccess() where the parent is provided
as an optimization.

This allows us to avoid needing to do a zfs_zget() when
setting up the SELinux security xattr in the create path.
This is critical because a hash lookup on the directory
will deadlock since it is locked.

The zpl_xattr_security_init() call has also been moved up
to the zpl layer to ensure TXs to create the required
xattrs are performed after the create TX.  Otherwise we
run the risk of deadlocking on the open create TX.

Ideally the security xattr should be fully constructed
before the new inode is unlocked.  However, doing so would
require far more extensive changes to ZFS.

This change may also have the benefitial side effect of
ensuring xattr directory znodes are evicted from the cache
before normal file or directory znodes due to the extra
reference.

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

11 years agoImplemented sharing datasets via SMB using libshare
Turbo Fredriksson [Sat, 4 Feb 2012 20:08:53 +0000 (21:08 +0100)]
Implemented sharing datasets via SMB using libshare

Add the initial support for the 'smbshare' option using the
existing libshare infrastructure.  Because this implementation
relies on usershares samba version 3.0.23 is required.

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

11 years agoPromote spl-dkms to Pre-Depends.
Darik Horn [Mon, 3 Dec 2012 02:07:17 +0000 (20:07 -0600)]
Promote spl-dkms to Pre-Depends.

The DKMS package with the experimental BUILD_DEPENDS directive only
resolves dependencies for automatic installations, like those invoked
through the run-parts for kernel packages.

Set "Pre-Depends: spl-dkms" in the `debian/control` file so that the
first non-automatic build by `/usr/lib/dkms/common.postinst` happens
for SPL before ZFS is added to dkms.

NB: Commit b08e6b3c15dd93d18b8d0c0e441d3da64d315d5d.

This change plus the enhanced DKMS package...

Closes: dajhorn/pkg-zfs#42
Closes: dajhorn/pkg-zfs#44
11 years agoPPA 0.6.0.88-0ubuntu1 release.
Darik Horn [Sat, 1 Dec 2012 05:29:47 +0000 (23:29 -0600)]
PPA 0.6.0.88-0ubuntu1 release.

11 years agoUpdate /etc/sudoers.d/zfs file.
Darik Horn [Sat, 1 Dec 2012 05:25:05 +0000 (23:25 -0600)]
Update /etc/sudoers.d/zfs file.

Refresh commit 1080b6eab180b07c0165957d222e6df263f5f596.

https://groups.google.com/a/zfsonlinux.org/d/msg/zfs-discuss/cJCwJsaym-U/TOF-HuqF1JEJ

11 years agoRefresh debian/patches after upstream merge.
Darik Horn [Sat, 1 Dec 2012 05:21:15 +0000 (23:21 -0600)]
Refresh debian/patches after upstream merge.

11 years agoMerge branch 'upstream'
Darik Horn [Sat, 1 Dec 2012 05:20:39 +0000 (23:20 -0600)]
Merge branch 'upstream'

11 years agoMake zpool attach -o ashift=... actually work
Cyril Plisko [Fri, 30 Nov 2012 21:13:28 +0000 (23:13 +0200)]
Make zpool attach -o ashift=... actually work

Commit df83110856950c8e7b16a7e94cdf42b8531b9cc8 missed update to
getopt() call, while delivering all the rest. This commit adds
"o" to getopt().

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

11 years agoAdd load_nvlist() error handling
Brian Behlendorf [Fri, 30 Nov 2012 19:23:38 +0000 (11:23 -0800)]
Add load_nvlist() error handling

Add the missing error handling to load_nvlist().  There's no good
reason this needs to be fatal.  All callers of load_nvlist() do
correctly handle an error condition and it is preferable that an
error be returned.  This will allow 'zpool import -FX' to safely
attempt to rollback through previous txgs looking for a good one.

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

11 years agoAllow GPT+EFI vdevs for root pools
Brian Behlendorf [Tue, 6 Nov 2012 19:33:24 +0000 (11:33 -0800)]
Allow GPT+EFI vdevs for root pools

Commit 57a4edd allows the bootfs property to be set on any pool.
However, many of the zpool commands still prevent you from using
EFI labeled devices for the root pool.  For example:

    # zpool attach rpool /dev/sda /dev/sdb
    cannot label 'sdb': EFI labeled devices are not supported on
    root pools. on root devices.

For non-Solaris builds such as Linux disable this error.

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

11 years agoDisable page allocation warnings for super block
Brian Behlendorf [Fri, 30 Nov 2012 18:31:54 +0000 (10:31 -0800)]
Disable page allocation warnings for super block

Due to the slightly increased size of the ZFS super block
caused by 30315d2 there are now allocation warnings.  The
allocation size is still small (just over 8k) and super
blocks are rarely allocated so we suppress the warning.

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

11 years agoVerify --with-linux source directory exists
Brian Behlendorf [Fri, 30 Nov 2012 04:19:25 +0000 (20:19 -0800)]
Verify --with-linux source directory exists

Previously this check was only performed when ./configure was
attempting to autodetect your kernel source directory.  But we
should also handle the case where --with-linux was provided
and is obviously wrong.  This way we catch the error before
invoking make and compiling the source with an incorrect
autoconf results.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/spl#162

11 years agovdev_id fails to handle complex device topologies
Cyril Plisko [Thu, 29 Nov 2012 13:40:26 +0000 (15:40 +0200)]
vdev_id fails to handle complex device topologies

While expanding positional parameters shell requires non-single
digits to be enclosed in braces. When the SAS topology is
non-trivial the number of positional parameters generated internally
by vdev_id script (using set -- ...) easily crosses single digit limit
and vdev_id fails to generate links.

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