Commit Graph

1855 Commits

Author SHA1 Message Date
Brian Behlendorf b1a6216b64 Merge commit 'refs/top-bases/linux-topology' into linux-topology 2010-06-29 11:02:10 -07:00
Brian Behlendorf bf3c33b6c0 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-29 11:00:56 -07:00
Brian Behlendorf bc9ce64c43 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-29 11:00:38 -07:00
Brian Behlendorf b8229898ab Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-29 10:59:58 -07:00
Brian Behlendorf deed228127 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-29 10:59:55 -07:00
Brian Behlendorf 0a2b049259 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-29 10:59:54 -07:00
Brian Behlendorf ffeafc898e Merge branch 'fix-branch' into refs/top-bases/zfs-branch
Conflicts:

	cmd/ztest/ztest.c
2010-06-29 10:55:38 -07:00
Brian Behlendorf d2585f5921 Merge branch 'fix-stack-vn_open' into refs/top-bases/fix-branch 2010-06-29 10:15:05 -07:00
Brian Behlendorf edbb93c11d Reduce stack usage by vn_open()
We should not put a 4k maxpathlen buffer on the stack, instead
locate it to the heap.  Even in user space we run ztest with 8K
2010-06-29 10:14:37 -07:00
Brian Behlendorf aa90238713 Merge branch 'fix-pthreads' into refs/top-bases/fix-branch 2010-06-29 10:12:03 -07:00
Brian Behlendorf 9af7aa53eb Set stack frame limit
For all module/library functions ensure so stack frame exceeds 1024
bytes.  Ideally this should be set lower to say 512 bytes but there
are still numerous functions which exceed even this limit.  For now
this is set to 1024 to ensure we catch the worst offenders.

Additionally, set the limit for ztest to 1024 bytes since the idea
here is to catch stack issues in user space before we find them by
overrunning a kernel stack.  This should also be reduced to 512
bytes as soon as all the trouble makes are fixed.

Finally, add -fstack-check to gcc build options when --enable-debug
is specified at configure time.  This ensures that each page on the
stack will be touched and we will generate a segfault on stack
overflow.

Over time we can gradually fix the following functions:

536 zfs:dsl_deadlist_regenerate
536 zfs:dsl_load_sets
536 zfs:zil_parse
544 zfs:zfs_ioc_recv
552 zfs:dsl_deadlist_insert_bpobj
552 zfs:vdev_dtl_sync
584 zfs:copy_create_perms
608 zfs:ddt_class_contains
608 zfs:ddt_prefetch
608 zfs:__dprintf
616 zfs:ddt_lookup
648 zfs:dsl_scan_ddt
696 zfs:dsl_deadlist_merge
736 zfs:ddt_zap_walk
744 zfs:dsl_prop_get_all_impl
872 zfs:dnode_evict_dbufs
2010-06-29 10:08:48 -07:00
Brian Behlendorf 6fe1e37a5e Additional pthread related fixes for ztest
There are 3 fixes in thie commit.  First, update ztest_run() to store
the thread id and not the address of the kthread_t.  This will be freed
on thread exit and is not safe to use.  This is pretty close to how
things were done in the original ztest code before I got there.

Second, for extra paranoia update thread_exit() to return a special
TS_MAGIC value via pthread_exit().  This value is then verified in
pthread_join() to ensure the thread exited cleanly.  This can be
done cleanly because the kthread doesn't provide a return code
mechanism we need to worry about.

Third, replace the ztest deadman thread with a signal handler.  We
cannot use the previous approach because the correct behavior for
pthreads is to wait for all threads to exit before terminating the
process.  Since the deadman thread won't call exit by design we
end up hanging in kernel_exit().  To avoid this we just setup a
SIGALRM signal handle and register a deadman alarm.  IMHO this
is simpler and cleaner anyway.
2010-06-29 10:06:09 -07:00
Brian Behlendorf 759df09df2 Merge branch 'linux-kernel-mem' into refs/top-bases/linux-zfs-branch 2010-06-28 11:31:03 -07:00
Brian Behlendorf f9a7332118 Update kmem_asprintf() and kmem_vasprintf() implementation
On a Linux system simply use the native aprintf and vasprintf
functions respectively.  Also update the call points to correctly
use va_copy() or va_start() as appropriate.
2010-06-28 10:52:22 -07:00
Brian Behlendorf 5f0e728052 Merge commit 'refs/top-bases/linux-topology' into linux-topology 2010-06-28 10:38:29 -07:00
Brian Behlendorf d3c37d45e6 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-06-28 10:37:21 -07:00
Brian Behlendorf 2a2492e105 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-28 10:37:19 -07:00
Brian Behlendorf 37e52074e8 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-28 10:37:03 -07:00
Brian Behlendorf 6107ded5d5 Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-06-28 10:36:47 -07:00
Brian Behlendorf 712dbf737f Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-28 10:36:24 -07:00
Brian Behlendorf cecd65c15b Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-28 10:36:21 -07:00
Brian Behlendorf 744af7fa00 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-28 10:36:20 -07:00
Brian Behlendorf 191d5e833a Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-06-28 10:36:19 -07:00
Brian Behlendorf ee53c67258 Merge branch 'fix-pthreads' into refs/top-bases/fix-branch 2010-06-28 10:36:17 -07:00
Brian Behlendorf 94f23a6856 Ensure NULL is not returned incorrectly after the first call.
I'm surprised this was not caught long ago, but previous the
code actually never did call the function twice so it was
missed.  Anyway, this fixes it.
2010-06-28 10:27:18 -07:00
Brian Behlendorf a2e73b7516 Allow joinable threads
There was previous discussion of a race with joinable threads but to
be honest I can neither exactly remember the race, or recrease the
issue.  I believe it may have had to do with pthread_create() returning
without having set kt->tid since this was done in the created thread.
If that was the race then I've 'fixed' it by ensuring the thread id
is set in the thread AND as the first pthread_create() argument.  Why
this wasn't done originally I'm not sure, with luck Ricardo remembers.

Additionally, explicitly set a PAGESIZE guard frame at the end of the
stack to aid in detecting stack overflow.  And add some conditional
logic to set STACK_SIZE correctly for Solaris.
2010-06-28 10:15:29 -07:00
Brian Behlendorf 5f9e681ed5 Merge commit 'refs/top-bases/linux-topology' into linux-topology 2010-06-16 14:45:25 -07:00
Brian Behlendorf c153a79adc Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-16 14:44:13 -07:00
Brian Behlendorf 3f67a34204 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-16 14:43:58 -07:00
Brian Behlendorf 76ad38b271 Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-06-16 14:43:43 -07:00
Brian Behlendorf 8645a8e901 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-16 14:43:21 -07:00
Brian Behlendorf ca3849d1ce Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-16 14:43:18 -07:00
Brian Behlendorf 2f457b7bd0 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-16 14:43:17 -07:00
Brian Behlendorf 8de2671680 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-06-16 14:43:17 -07:00
Brian Behlendorf a2ba5b83f8 Merge branch 'fix-stack-noinline' into refs/top-bases/fix-branch 2010-06-16 14:35:14 -07:00
Brian Behlendorf bbdb8184ec Add fix-stack-noinline topic branch
Certain function must never be automatically inlined by gcc because
they are stack heavy or called recursively.  This patch flags all
such functions I have found as 'noinline' to prevent gcc from making
the optimization.
2010-06-16 14:34:41 -07:00
Brian Behlendorf 0e0554e504 Merge commit 'refs/top-bases/linux-topology' into linux-topology 2010-06-16 14:29:39 -07:00
Brian Behlendorf a9feaa2129 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-16 14:28:27 -07:00
Brian Behlendorf fceb0dc7aa Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-16 14:28:11 -07:00
Brian Behlendorf 17edc470ca Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-06-16 14:27:56 -07:00
Brian Behlendorf 76f112175f Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-16 14:27:35 -07:00
Brian Behlendorf a86fc5c4a2 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-16 14:27:32 -07:00
Brian Behlendorf 48ca6d3590 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-16 14:27:31 -07:00
Brian Behlendorf 7f979b27f4 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-06-16 14:27:30 -07:00
Brian Behlendorf 30c03a0914 Merge branch 'fix-stack' into refs/top-bases/fix-branch 2010-06-16 14:27:29 -07:00
Brian Behlendorf 2115c30515 Revert fix-stack topic branch
This patch will be broken in to several independent stack reductions
and reapplied as new topic branches.
2010-06-16 14:23:31 -07:00
Brian Behlendorf 2cda60c980 Merge branch 'linux-topology' into refs/top-bases/linux-zfs-branch 2010-06-16 09:57:10 -07:00
Brian Behlendorf 8c7748d8e0 Add linux-topology topic branch
Solaris recently introduced the idea of drive topology because
where a drive is located does matter.  I have already handled
this with udev/blkid integration under Linux so I'm hopeful
this case can simply be removed but for now I've just stubbed
out what is needed in libspl and commented out the rest here.
2010-06-16 09:55:34 -07:00
Brian Behlendorf 6fa858c778 Merge branch 'linux-sha2' into refs/top-bases/linux-zfs-branch 2010-06-16 09:49:06 -07:00
Brian Behlendorf 14d073e298 Add linux-sha2 topic branch for portability
The upstream ZFS code has correctly moved to a faster native sha2
implementation.  Unfortunately, under Linux that's going to be a little
problematic so we revert the code to the more portable version contained
in earlier ZFS releases.  Using the native sha2 implementation in Linux
is possible but the API is slightly different in kernel version user
space depending on which libraries are used.  Ideally, we need a fast
implementation of SHA256 which builds as part of ZFS this shouldn't be
that hard to do but it will take some effort.
2010-06-16 09:47:25 -07:00
Brian Behlendorf 828bf9cae2 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-14 16:28:45 -07:00
Brian Behlendorf 5331e9f1f8 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-14 16:28:28 -07:00
Brian Behlendorf 67e6c9469a Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-06-14 16:28:12 -07:00
Brian Behlendorf 1aeae83705 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-14 16:27:50 -07:00
Brian Behlendorf f178dd0726 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-14 16:27:47 -07:00
Brian Behlendorf 08060ef853 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-14 16:25:02 -07:00
Brian Behlendorf eb894076a4 Merge branch 'fix-branch' into refs/top-bases/zfs-branch
Conflicts:

	cmd/ztest/ztest.c
2010-06-14 16:24:45 -07:00
Brian Behlendorf 2969945552 Merge branch 'fix-pthreads' into refs/top-bases/fix-branch 2010-06-14 16:22:00 -07:00
Brian Behlendorf f9f342c5f2 Add fix-pthreads topic branch
This is a portability change which removes the dependence of the Solaris
thread library.  All locations where Solaris thread API was used before
have been replaced with equivilant Solaris kernel style thread calls.
In user space the kernel style threading API is implemented in term of
the portable pthreads library.  This includes all threads, mutexs,
condition variables, reader/writer locks, and taskqs.
2010-06-14 16:20:44 -07:00
Brian Behlendorf 6348afcb98 Merge branch 'linux-events' into refs/top-bases/linux-zfs-branch 2010-06-14 16:10:57 -07:00
Brian Behlendorf 9193fdea7e Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch 2010-06-14 16:10:54 -07:00
Brian Behlendorf 1b55fad32f Updates to linux-user-disk
The major change is removing the thread pool when importing devices.
This may be reintroduced at some point if needed, but it is added
complexity which has already been handled by blkid on modern Linux
systems.  We only need to fallback to probing everything is /dev/
if you config file is toast and even then it only takes a few seconds.
2010-06-14 15:59:11 -07:00
Brian Behlendorf 3a0400ad88 Update linux-events
Minor updates to linux-events to handle some upstream changes.  Luckily,
this was done flexibly enough the first time it wasn't much of a problem.
2010-06-14 15:57:09 -07:00
Brian Behlendorf f9e717f642 Merge commit 'refs/top-bases/linux-events' into linux-events 2010-06-14 15:53:31 -07:00
Brian Behlendorf 0eff59a95e Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-06-14 15:52:53 -07:00
Brian Behlendorf b60b922211 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-14 15:52:51 -07:00
Brian Behlendorf 0c0ea412b3 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-14 15:52:34 -07:00
Brian Behlendorf edb4ee024f Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-06-14 15:52:19 -07:00
Brian Behlendorf fb35fe3bc1 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-14 15:51:56 -07:00
Brian Behlendorf e5175423ea Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-14 15:51:54 -07:00
Brian Behlendorf 06b5dc883f Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-14 15:51:52 -07:00
Brian Behlendorf 953aa00176 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2010-06-14 15:51:51 -07:00
Brian Behlendorf 5fa2cb516b Merge branch 'gcc-missing-braces' into refs/top-bases/gcc-branch 2010-06-14 15:51:50 -07:00
Brian Behlendorf 91cc4e35bb Updates to linux-libspl
Added print_timestamp() compatibility function, this will be needed
long term but it's a simply enough addition.

Added Solaris style label functions.  This was done simply to aid in
the initial update to onnv_141.  I'm hopeful that after more careful
inspection all of this can be removed and we can integrate with a
more Linux friendly Solution without breaking any compatibility.

Added several missing headers which are required by the updated
version of ZFS.  As usual I just add empty headers if needed because
it's easier than tracking the change against the core ZFS code.

Added SEC, MILLISEC, MICROSEC defines if unavailable.

Added missing xuio structure and typedefs.  I'm hopeful these can
be removed as well once we crack the zero-copy nut under Linux.
2010-06-14 15:47:54 -07:00
Brian Behlendorf c430e23552 Update zfs-branch with build system updates
Required Makefile modifications for updated ZFS code.
2010-06-14 15:46:11 -07:00
Brian Behlendorf 696ec7fb61 Update gcc-missing-braces based on structure changes
Almost exclusively this patch handled the addition of another char
array to the zfs_cmd_t structure.  Unfortunately c90 doesn't allow
zero filling the entire struct with the '= { 0 };' shorthand.
2010-06-14 15:44:06 -07:00
Brian Behlendorf c52a71873a Merge commit 'refs/top-bases/linux-events' into linux-events 2010-06-14 15:38:51 -07:00
Brian Behlendorf a43ad49f64 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-14 15:38:09 -07:00
Brian Behlendorf d860bca64c Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-14 15:37:52 -07:00
Brian Behlendorf ec5ef84e8a Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-06-14 15:37:35 -07:00
Brian Behlendorf e796e2a03e Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-14 15:37:10 -07:00
Brian Behlendorf efdca3b5bc Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-14 15:37:07 -07:00
Brian Behlendorf 7eadc495c6 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-14 15:37:05 -07:00
Brian Behlendorf b5ba75f385 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2010-06-14 15:37:03 -07:00
Brian Behlendorf c8d75a1c9d Merge branch 'gcc-no-parenthesis' into refs/top-bases/gcc-branch 2010-06-14 15:37:00 -07:00
Brian Behlendorf 1893aa76ec Update gcc-no-parenthesis
Fix new locations of missing parenthesis according to gcc.
2010-06-14 15:16:41 -07:00
Brian Behlendorf 6b17084f5f Merge commit 'refs/top-bases/linux-events' into linux-events 2010-06-14 14:44:31 -07:00
Brian Behlendorf d701c42ed6 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-14 14:43:54 -07:00
Brian Behlendorf 47e0108ff6 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-14 14:43:39 -07:00
Brian Behlendorf e35eb21d6a Merge commit 'refs/top-bases/linux-kernel-mem' into linux-kernel-mem 2010-06-14 14:43:24 -07:00
Brian Behlendorf 4152507366 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-14 14:43:02 -07:00
Brian Behlendorf f1b9fa56b3 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-14 14:43:00 -07:00
Brian Behlendorf bdf5763c0a Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-14 14:42:58 -07:00
Brian Behlendorf 9f9a451561 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2010-06-14 14:42:57 -07:00
Brian Behlendorf fc490c18b6 Merge branch 'gcc-cast' into refs/top-bases/gcc-branch 2010-06-14 14:42:56 -07:00
Brian Behlendorf dd8f6da3da Update gcc-cast
Fix new instances of missing casts or assumed types.
2010-06-14 14:40:10 -07:00
Brian Behlendorf 61f5fa262e Merge branch 'linux-unused' into refs/top-bases/linux-zfs-branch
Conflicts:
	lib/libzpool/include/sys/zfs_context.h
2010-05-28 22:21:07 -07:00
Brian Behlendorf b41143632b Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch
Conflicts:
	cmd/zpool/zpool_main.c
	cmd/zpool/zpool_vdev.c
	cmd/ztest/ztest.c
	lib/libzfs/libzfs_dataset.c
	lib/libzfs/libzfs_import.c
	lib/libzfs/libzfs_mount.c
	lib/libzfs/libzfs_pool.c
	lib/libzfs/libzfs_sendrecv.c
	lib/libzpool/include/sys/zfs_context.h
	module/zcommon/include/sys/fs/zfs.h
	module/zcommon/zfs_comutil.c
	module/zfs/arc.c
	module/zfs/dmu.c
	module/zfs/dmu_objset.c
	module/zfs/dmu_send.c
	module/zfs/dmu_tx.c
	module/zfs/dsl_dataset.c
	module/zfs/dsl_dir.c
	module/zfs/dsl_scrub.c
	module/zfs/fm.c
	module/zfs/include/sys/dmu.h
	module/zfs/include/sys/fm/fs/zfs.h
	module/zfs/include/sys/fm/protocol.h
	module/zfs/include/sys/spa.h
	module/zfs/include/sys/zfs_context.h
	module/zfs/include/sys/zfs_ioctl.h
	module/zfs/include/sys/zvol.h
	module/zfs/spa.c
	module/zfs/spa_boot.c
	module/zfs/spa_history.c
	module/zfs/spa_misc.c
	module/zfs/txg.c
	module/zfs/vdev.c
	module/zfs/zfs_fm.c
	module/zfs/zfs_ioctl.c
	module/zfs/zfs_replay.c
	module/zfs/zfs_znode.c
	module/zfs/zil.c
	module/zfs/zio.c
2010-05-28 22:14:39 -07:00
Brian Behlendorf 8c67d72771 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk
Conflicts:
	cmd/zpool/zpool_main.c
	cmd/zpool/zpool_vdev.c
	lib/libzfs/libzfs_dataset.c
	lib/libzfs/libzfs_import.c
	lib/libzfs/libzfs_mount.c
	lib/libzfs/libzfs_pool.c
2010-05-28 21:41:17 -07:00
Brian Behlendorf e776fc7fa7 Merge commit 'refs/top-bases/linux-unused' into linux-unused
Conflicts:
	lib/libzpool/include/sys/zfs_context.h
2010-05-28 21:33:46 -07:00