Commit Graph

1844 Commits

Author SHA1 Message Date
Brian Behlendorf 2deb475123 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-07-23 11:42:26 -07:00
Brian Behlendorf 6e615d3108 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-07-23 11:42:24 -07:00
Brian Behlendorf 758275af4f Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-07-23 11:42:23 -07:00
Brian Behlendorf 2eee7b0ee5 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-07-23 11:42:22 -07:00
Brian Behlendorf 4471454be8 Merge branch 'fix-stack-ztest' into refs/top-bases/fix-branch 2010-07-23 11:42:21 -07:00
Ned Bass be92edb218 Add extra guard space if needed
Some buggy NPTL threading implementations include the guard area within
the stack size allocations.  In this case we need to allocate an extra
page to account for the guard area since we only have two pages of usable
stack on Linux.  Added an autoconf test that detects such implementations
by running a test program designed to segfault if the bug is present.
Set a flag NPTL_GUARD_WITHIN_STACK that is tested to decide if extra
stack space must be allocated for the guard area.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-07-23 11:38:00 -07:00
Brian Behlendorf fd8be4cd39 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-07-23 10:44:55 -07:00
Brian Behlendorf fe76ce50f8 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-07-23 10:44:53 -07:00
Brian Behlendorf 404931364c Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch 2010-07-23 10:44:38 -07:00
Brian Behlendorf f00f30038a Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-07-23 10:44:36 -07:00
Brian Behlendorf 9f24ae6b22 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-07-23 10:43:58 -07:00
Brian Behlendorf d931c577c1 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-07-23 10:43:55 -07:00
Brian Behlendorf 1f3fa4df05 Add -stack-check option to libspl
See commit f16dec7e67fe86f3c3556a67865ee715a2964d70 for full
details of this change.  But in summary -fstack-check is being
restricted in usage only to locations which must already have
small stack frames.
2010-07-23 10:38:44 -07:00
Brian Behlendorf 7fa6f8b93a Restrict usage of -fstack-check option
The stack check implementation in older versions of gcc has
a fairly low default limit on STACK_CHECK_MAX_FRAME_SIZE of
roughly 4096.  This results in numerous warning when it is
used with code which was designed to run in user space and
thus may be relatively stack heavy.  The avoid these warnings,
which are fatal with -Werror, this patch targets the use of
-fstack-check to libraries which are compiled in both user
space and kernel space.  The only utility which uses this
flag is ztest which is designed to simulate running in the
kernel and must meet the -fstack-check requirements.  All
other user space utilities do not use -fstack-check.

  warning: frame size too large for reliable stack checking
  warning: try reducing the number of local variables
2010-07-23 10:38:07 -07:00
Brian Behlendorf c0932825ea Reduce stack move path local to heap
To use the -fstack-check gcc option each stack frame must be
keep reasonably small.  In this case the path local is moved
from the stack to the heap to keep us under the limit.

  warning: frame size too large for reliable stack checking
  warning: try reducing the number of local variables
2010-07-23 10:36:49 -07:00
Brian Behlendorf f58859a371 Merge branch 'linux-topology' into refs/top-bases/linux-zfs-branch 2010-07-22 17:03:13 -07:00
Brian Behlendorf ea5e8e5247 Remove stray include <label.h>
This was accidentally added, wrongly, to the wrong topic
branch.  In fact it actually simply needs to be outright
removed... so I am.
2010-07-22 16:58:53 -07:00
Brian Behlendorf bda31592bf Merge branch 'linux-have-mlslabel' into refs/top-bases/linux-zfs-branch 2010-07-22 16:57:57 -07:00
Brian Behlendorf 66b2805477 Disable mlslabel support in Linux
The ZFS update to onnv_141 brought with it support for a
security label attribute called mlslabel.  This feature
depends on zones to work correctly and thus I am disabling
it under Linux.  Equivilant functionality could be added
at some point in the future.
2010-07-22 16:55:50 -07:00
Brian Behlendorf 36762cb6f6 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-07-22 16:43:21 -07:00
Brian Behlendorf f39d7d2ca2 Remove libspl support for mlslabels
The ZFS update to onnv_141 brought with it support for a
security label attribute called mlslabel.  This feature
depends on zones to work correctly and while I originally
added minimal support for this in libspl that was a mistake.

Supporting this under Linux is not required and this is
just additional troublesome code to support.  Long term
something like this could be supported under Linux but it
will need to be clearly thought through them an implemented.
2010-07-22 16:37:29 -07:00
Brian Behlendorf b5ffd516ba Merge commit 'refs/top-bases/linux-topology' into linux-topology 2010-07-21 10:10:27 -07:00
Brian Behlendorf 6067ed4272 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-07-21 10:09:20 -07:00
Brian Behlendorf 064837c20a Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-07-21 10:09:04 -07:00
Brian Behlendorf 230b75fe2d Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-07-21 10:08:28 -07:00
Brian Behlendorf 8a8a5ae7af Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-07-21 10:08:25 -07:00
Brian Behlendorf acd6237623 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-07-21 10:08:25 -07:00
Brian Behlendorf f39882ec1f Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-07-21 10:08:24 -07:00
Brian Behlendorf a2cf158872 Merge branch 'fix-stack-ztest' into refs/top-bases/fix-branch 2010-07-21 10:08:22 -07:00
Ned Bass 75d868af70 Fixed typo that set thread STACK_SIZE to 24k instead of 8k
__linux__ was mispelled as _linux_ so #ifdef was always
selecting the Solaris STACK_SIZE value.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-07-21 10:04:21 -07:00
Brian Behlendorf 6d72cb7326 Fix pthread stack size on 32-bit platforms
For some reason which remains mysterious to me the shared library
which calls pthread_create() must be linked with -pthread.  If this
is not done on 32-bit system the default ulimit stack size is used.
Surprisingly, on a 64-bit system the stack limit specified by the
pthread_attr is honored even when -pthread is not passed when linking
the shared library.
2010-07-21 09:59:39 -07:00
Brian Behlendorf 7c8de13de8 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-07-01 10:43:10 -07:00
Brian Behlendorf bb4baf0912 Add missing headers to 'make dist' target for RPM build
The following files were being left out the tarball which
is used by the 'make rpm' target.  This results in a build
failure when building packages which use the tarball.

        lib/libspl/include/sys/tsol/*.h
        lib/libspl/include/util/*.h
2010-07-01 10:37:27 -07:00
Brian Behlendorf 7f1ede8798 Merge commit 'refs/top-bases/linux-topology' into linux-topology 2010-06-29 17:00:06 -07:00
Brian Behlendorf c5afb06a83 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-06-29 16:58:47 -07:00
Brian Behlendorf 2645596d71 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-29 16:58:28 -07:00
Brian Behlendorf 9c4837d5da Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-29 16:57:45 -07:00
Brian Behlendorf 468392fcc7 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2010-06-29 16:57:42 -07:00
Brian Behlendorf 6f1eda0629 Add configure check for -Wframe-larger-than=<size>
It turns out the gcc option -Wframe-larger-than=<size> which I recently
added to the build system is not supported in older versions of gcc.
Since this is just a flag to ensure I keep stack usage under control
I've added a configure check to detect if gcc supports it.  If it's
available we use it in the proper places, if it's not we don't.
2010-06-29 16:53:02 -07:00
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