Commit Graph

2839 Commits

Author SHA1 Message Date
Brian Behlendorf acf6f07ace Merge branch 'linux-kernel-disk' into refs/top-bases/linux-zfs-branch 2010-08-09 16:51:26 -07:00
Brian Behlendorf dd11e3f7f0 Limit sysfs name to KOBJ_NAME_LEN
See commit dfc166d174 for details.
2010-08-09 16:45:38 -07:00
Brian Behlendorf 5ce3b77ef8 Remove /zvol/ path component for zvol devices
As part of commit f162433deb the /zvol/
path component was added for zvol devices.  This ensured all zvol
devices would be created by udev in /dev/zvol/<pool>/<dataset>, as
opposed to the previous /dev/<pool>/<dataset> path.  Logically, it
was nice to organize them in a directory much like Solaris does.

However, while initial testing showed this to work fine with modern
kernels it does not appear to be supported under RHEL5.  The extra
path component triggers a NULL deref in create_dir().  Anyway, to
avoid having different zvol path names based on your kernel version
its more consistent simply to revert to the original naming convention.
If you really want the zvol component you can always add custom
udev rules to do exactly this.

We can revisiting this change again once we are willing to drop
support for RHEL5 and similar older distros.
2010-08-09 16:42:42 -07:00
Brian Behlendorf 3d78dbe4b6 Merge branch 'linux-kernel-mem' into refs/top-bases/linux-zfs-branch 2010-08-06 14:02:10 -07:00
Brian Behlendorf c10118d23e Reapply changes to correct TopGit merge
See commit 992e89df07
2010-08-06 13:56:23 -07:00
Brian Behlendorf 979273cab1 Merge branch 'linux-kernel-mem' into refs/top-bases/linux-zfs-branch
Conflicts:

	module/zfs/zfs_ioctl.c
2010-08-06 13:37:03 -07:00
Brian Behlendorf 992e89df07 Revert changes to correct TopGit merge
I've noticed the TopGit linux-zfs-branch has some linux-kernel-mem
changes which were incorrectly merged.  To fix the issue I'm
reverting the changes in the linux-kernel-mem topic branch, then
remerging the revert, and finally reapplying and merging the
change correctly.
2010-08-06 13:27:32 -07:00
Brian Behlendorf 743e2cde8f Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-08-06 10:53:08 -07:00
Brian Behlendorf 7e693479b0 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-08-06 10:52:58 -07:00
Brian Behlendorf f7017594c4 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-08-06 10:52:39 -07:00
Brian Behlendorf 9e3e35dc3f Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-06 10:52:35 -07:00
Brian Behlendorf 8f8d2b66aa Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-06 10:52:34 -07:00
Brian Behlendorf 2e982255da Merge branch 'fix-zfs_ioc_objset_stats' into refs/top-bases/fix-branch 2010-08-06 10:47:02 -07:00
Brian Behlendorf 89f0abf9b5 Add missing zfs_ioc_objset_stats() error handling
Interestingly this looks like an upstream bug as well.  If for some
reason we are unable to get a zvols statistics, because perhaps the
zpool is hopelessly corrupt, we would trigger the VERIFY.  This
commit adds the proper error handling just to propagate the error
back to user space.  Now the user space tools still must handle this
properly but in the worst case the tool will crash or perhaps have
some missing output.  That's far far better than crashing the host.

Closes #45
2010-08-06 10:46:39 -07:00
Brian Behlendorf 5222cdac37 Merge branch 'linux-kernel-disk' into refs/top-bases/linux-zfs-branch 2010-08-04 16:10:44 -07:00
Brian Behlendorf f3aa3b93df Fix zvol partition creation during module load
Partitions for a zvol device were not appearing in /dev/zvol/<pool>/
at module load time for a couple of reasons.

1) The Linux block layer expects a block device to have a non-zero
   capacity during add_disk().  If the capacity is zero it does not
   attempt to open the device which means we never trigger a partition
   scan.  The device capacity was just being set during the first open.

2) Because we expect to be adding a block device to the zvol_state_list
   during zvol_create_minor() the zvol_state_lock() is held.  This
   can result in a deadlock in add_disk() when it attempts to open
   the block device via zvol_open() which also takes this same lock.
   To avoid this issue special handling has been added to zvol_open()
   and zvol_release() to allow the mutex owner to enter these functions
   without retaking the lock.

3) In __zvol_create_minor() the call to dmu_objset_disown() must occur
   before the call to add_disk().  As mentioned above add_disk() results
   in a call to zvol_open() which will attempt to call dmu_objset_own()
   again on the objset.  If the objset is already open it will fail
   resulting in a failed open.  This in turn means the kernel will be
   unable to read the partition information from the device.
2010-08-04 16:05:25 -07:00
Brian Behlendorf 9cb6a0067d Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-08-03 16:02:49 -07:00
Brian Behlendorf f216be8859 Merge branch 'linux-kernel-disk' into refs/top-bases/linux-zfs-branch 2010-08-03 16:02:43 -07:00
Brian Behlendorf a54f5dddf1 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-08-03 16:02:41 -07:00
Brian Behlendorf 888942a40f Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-08-03 16:02:23 -07:00
Brian Behlendorf 63a645c3c8 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-03 16:02:21 -07:00
Brian Behlendorf 1b9fd31ada Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-03 16:02:20 -07:00
Brian Behlendorf 3eff30685e Set zv->zv_objset for zil_replay() case
For the case where we have a zil to replay we need to ensure that
zv->zv_objset contains the current objset.  Since the caller has
a hold on the object set it is safe to pass to zil_replay as part
of the zv.  Call path zvol_create_minor()->zil_replay()->
zil_parse()->zil_replay_log_record()->zvol_replay_write().
2010-08-03 15:57:05 -07:00
Brian Behlendorf 2cb5528450 Merge branch 'fix-bpobj_close' into refs/top-bases/fix-branch 2010-08-03 15:56:53 -07:00
Brian Behlendorf 3253b39fa6 Set bpo->bpo_object = 0 on close to allow retry
During spa_load the spl->spa_deferred_bpobj maybe be opened and closed
multiple times.  It's critical that when the object is closed the
bpo->bpo_object is set to zero to indicate the object is closed.
If it's not during spl_load_retry the spl->spa_deferred_bpobj can
be closes twice resulting in a NULL deref.

This appears to have been fixed upstream the same way.
2010-08-03 15:56:29 -07:00
Brian Behlendorf ec00e089d3 Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-08-02 15:29:55 -07:00
Brian Behlendorf 640888ec74 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-08-02 15:29:46 -07:00
Brian Behlendorf c6e0144f79 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-08-02 15:29:31 -07:00
Brian Behlendorf 8481c9b7bb Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-02 15:29:28 -07:00
Brian Behlendorf 7e9bdac1a8 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-02 15:29:27 -07:00
Brian Behlendorf 8bf0a4e79c Merge branch 'fix-stack-inline' into refs/top-bases/fix-branch 2010-08-02 15:29:25 -07:00
Brian Behlendorf 45c00bf359 Fix spa_load_impl() prototype
Both the forward declaration of spa_load_impl() and the actual
function declaration must match.
2010-08-02 15:24:33 -07:00
Brian Behlendorf 52c23142d4 Revert "Inline zio_execute() to reduce stack use"
This reverts commit 411dd65af1.

gcc version 4.1.2 does not like having differing prototypes
for zio_execute, one version in the .c with inline and one
version in the .h without.  Thus I'm reverting this change
and we'll see how critical this particular stack reduction is.
2010-08-02 15:22:11 -07:00
Brian Behlendorf 9eb75e62cf Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-08-02 14:17:45 -07:00
Brian Behlendorf bd4701a061 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-08-02 14:17:36 -07:00
Brian Behlendorf 472cba82e2 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-08-02 14:17:21 -07:00
Brian Behlendorf 1afa38755a Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-02 14:17:17 -07:00
Brian Behlendorf 3de149b962 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-08-02 14:17:16 -07:00
Brian Behlendorf 529d515858 Merge branch 'fix-stack-dbuf_hold_impl' into refs/top-bases/fix-branch 2010-08-02 14:12:55 -07:00
Ned Bass 4d3fc57112 Reduce stack usage for recursive dbuf_hold_impl()
This commit preserves the recursive function dbuf_hold_impl() but moves
the local variables and function arguments to the heap to minimize
the stack frame size.  Enough space is initially allocated on the
stack for 20 levels of recursion.  This technique was based on commit
34229a2f2a which reduced stack usage of
traverse_visitbp().

dbuf_hold_impl() is mutually recursive with dbuf_findbp(),
but the latter function is also called from other functions.
Therefore dbuf_findbp() must contain logic to determine how to call
dbuf_hold_impl().  To this end, dbuf_hold_impl() now takes a
struct dbuf_hold_impl_data pointer as an argument.  If that argument
is NULL it calls dbuf_hold_impl() as before, otherwise it calls
__debuf_hold_impl() with a single dbuf_hold_impl_data pointer argument.
As the name implies, dbuf_hold_impl_data stores the arguments and local
variables for dbuf_hold_impl().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 14:12:31 -07:00
Brian Behlendorf 2a9adcbffb Merge branch 'fix-stack-dsl_scan_visitbp' into refs/top-bases/fix-branch 2010-08-02 14:09:39 -07:00
Ned Bass 410d8c4e15 Reduce dsl_scan_visitbp stack usage by moving blkptr_t to heap
Github issue 22 reported a stack overrun when the zfs module was
loaded, possibly related to the presence of existing zpools created
under zfs-fuse.  The stack trace showed 9 levels of recursion between
dsl_scan_visitbp() and dsl_scan_recurse(). To reduce stack overhead in
that code path, this commit moves the 128 byte blkptr_t data strucutre
in dsl_scan_visitbp() to the heap.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 14:09:15 -07:00
Brian Behlendorf 425b8742a5 Merge branch 'fix-stack-zio_done' into refs/top-bases/fix-branch 2010-08-02 14:06:32 -07:00
Ned Bass d5658668e0 Reduce stack usage of zio_done
Eliminated local variables pointing to members of the zio struct.
Just refer to the struct members directly.  This saved about 32 bytes per
call, but this function can be called recurisvely up to 19 levels deep,
so we potentially save up to 608 bytes.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 14:05:49 -07:00
Brian Behlendorf f3d8ee7357 Merge branch 'fix-stack-vdev_cache_read' into refs/top-bases/fix-branch 2010-08-02 13:57:39 -07:00
Brian Behlendorf 48669030fe Reduce stack in vdev_cache_read
Moving the vdev_cache_entry_t struct ve_search from the stack to
the heap saves ~100 bytes.
2010-08-02 13:57:15 -07:00
Brian Behlendorf 68cfa060f7 Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-08-02 13:53:23 -07:00
Brian Behlendorf b4c4755bb0 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-08-02 13:53:15 -07:00
Brian Behlendorf ec04ed0fbb Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-08-02 13:53:00 -07:00
Brian Behlendorf fd164fdb40 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-08-02 13:52:57 -07:00