Commit Graph

4036 Commits

Author SHA1 Message Date
Brian Behlendorf 6412189f1b Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-06-28 11:30:53 -07:00
Brian Behlendorf 843af873bf Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-28 11:30:36 -07:00
Brian Behlendorf 17a1689bd4 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2010-06-28 11:30:35 -07:00
Brian Behlendorf 9a29d55b2f Merge commit 'refs/top-bases/gcc-branch' into gcc-branch 2010-06-28 11:30:34 -07:00
Brian Behlendorf c2793dd0c7 Merge branch 'gcc-missing-braces' into refs/top-bases/gcc-branch 2010-06-28 11:30:34 -07:00
Brian Behlendorf f32ec2346b Linux bcopy() requires word aligned memory, use memcpy()
Much to my surprise bcopy() under Linux appears to copy the data in
word sized chunks.  It does the right thing but if you buffer is not
a multiple of the word size you will be reading past the end of your
buffer.  Or at least that is what valgrind is reporting.  We should
be using mempcy() anyway on Linux so replace bcopy() with memcpy()
to resolve the issue.

==305== Thread 211:
==305== Invalid read of size 8
==305==    at 0x3BCD28357D: _wordcopy_fwd_dest_aligned (in /lib64/libc-2.11.1.so)
==305==    by 0x3BCD282B05: bcopy (in /lib64/libc-2.11.1.so)
==305==    by 0x58D7FEF: dmu_write (dmu.c:730)
==305==    by 0x591C942: spa_history_write (spa_history.c:165)
==305==    by 0x591D255: spa_history_log_sync (spa_history.c:277)
==305==    by 0x591D545: log_internal (spa_history.c:450)
==305==    by 0x591D5EC: spa_history_log_internal (spa_history.c:475)
==305==    by 0x5902319: dsl_prop_set_sync (dsl_prop.c:707)
==305==    by 0x5906A7D: dsl_sync_task_group_sync (dsl_synctask.c:199)
==305==    by 0x58FF4EC: dsl_pool_sync (dsl_pool.c:376)
==305==    by 0x591744C: spa_sync (spa.c:5365)
==305==    by 0x5922C85: txg_sync_thread (txg.c:414)
2010-06-28 11:26:20 -07:00
Brian Behlendorf 5b02d6c084 Zero struct for zdb dump_block_stats
Accidentally dropped the zeroing of this structure in the
gcc-missing-braces topic branch which was causing a fall positive
space leak in ztest.  Ensure the structure is zero'ed before use.
2010-06-28 10:48:24 -07:00
Brian Behlendorf a6411d4033 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-06-28 10:36:38 -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 e8eea67f41 Merge commit 'refs/top-bases/fix-branch' into fix-branch 2010-06-28 10:36:18 -07:00
Brian Behlendorf 8ec85f8aee Merge branch 'fix-stack-dmu_objset_snapshot' into refs/top-bases/fix-branch 2010-06-28 10:36:17 -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 1a967e146f Merge branch 'fix-taskq' into refs/top-bases/fix-branch 2010-06-28 10:36:16 -07:00
Brian Behlendorf df8d7829a8 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2010-06-28 10:36:13 -07:00
Brian Behlendorf af239500df Merge commit 'refs/top-bases/gcc-branch' into gcc-branch 2010-06-28 10:36:12 -07:00
Brian Behlendorf ef3ec1c9ed Merge branch 'gcc-uninit' into refs/top-bases/gcc-branch 2010-06-28 10:36:11 -07:00
Brian Behlendorf 52bb0d8e75 Ensure zio_bad_cksum_t is initialized
This may not strictly be needed but it does keep gcc happy.  We
should keep our eye on this though if the extra bcopy significantly
impacts performance.  It may.
2010-06-28 10:30:38 -07:00
Brian Behlendorf d6ea5e8cef Additional ZVOL cleanup in zvol_set_volsize()
The following cleanup was missed in the first pass when the ZVOL
implementation was updated.  An extra instance of a zvol_state_t
was removed from the stack and the error handling was simplified.
2010-06-28 10:21:24 -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 6914386b85 Never sleep under taskq_dispatch()
There are cases where under Linux it is not safe to sleep in
taskq_dispatch().  Rather than adding Linux specific code to
detect these cases I opted to keep it simple and just never
allow a sleep here.  The impact of this should be minimal.
2010-06-28 10:11:12 -07:00
Brian Behlendorf 0c11631b02 Fix for fix-stack-dmu_objset_snapshot should be 'sn' not '&sn'
I missed a instanse of removing the & operator when reducing the
stack usage in this function.  This unfortunately doesn't cause
a compile warning but it is does cause ztest failures.  Anyway,
update the topic branch to correct this mistake.
2010-06-28 10:06:29 -07:00
Brian Behlendorf 4aba89bb16 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-06-16 14:43:35 -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 a0c72bab76 Merge commit 'refs/top-bases/fix-branch' into fix-branch 2010-06-16 14:39:41 -07:00
Brian Behlendorf 6504afae4a Merge branch 'fix-stack-dmu_objset_snapshot' into refs/top-bases/fix-branch 2010-06-16 14:39:41 -07:00
Brian Behlendorf bf02bcb6ee New TopGit dependency: fix-stack-dmu_objset_snapshot 2010-06-16 14:39:39 -07:00
Brian Behlendorf e163b08ba3 Add fix-stack-dmu_objset_snapshot topic branch
Reduce stack usage by 276 bytes by moving the snaparg struct from the
stack to the heap.  We have limited stack space we must not waste.
2010-06-16 14:39:06 -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 94a22f54e5 Merge commit 'refs/top-bases/fix-branch' into fix-branch 2010-06-16 14:35:14 -07:00
Brian Behlendorf 23d291df44 New TopGit dependency: fix-stack-noinline 2010-06-16 14:35:11 -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 d297febad2 Remove fix-stack dependency from fix-branch 2010-06-16 14:30:40 -07:00
Brian Behlendorf 850510ee8f Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-06-16 14:27:48 -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 1388d58932 Merge commit 'refs/top-bases/fix-branch' into 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 2084051282 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-06-16 13:53:24 -07:00
Brian Behlendorf aacc00b961 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-16 13:53:08 -07:00
Brian Behlendorf 6a19e49908 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-06-16 13:53:07 -07:00
Brian Behlendorf 4c62777dcc Merge commit 'refs/top-bases/fix-branch' into fix-branch 2010-06-16 13:49:56 -07:00
Brian Behlendorf 256505afb0 Merge branch 'fix-stack-dsl_deleg_get' into refs/top-bases/fix-branch 2010-06-16 13:49:55 -07:00
Brian Behlendorf 2709f5731b New TopGit dependency: fix-stack-dsl_deleg_get 2010-06-16 13:49:53 -07:00
Brian Behlendorf 869764f64d Add fix-stack-dsl_deleg_get topic branch
Reduce stack usage in dsl_deleg_get, gcc flagged it as consuming a
whopping 1040 bytes or potentially 1/4 of a 4K stack.  This patch
moves all the large structures and buffer off the stack and on to
the heap.  This includes 2 zap_cursor_t structs each 52 bytes in
size, 2 zap_attribute_t structs each 280 bytes in size, and 1
256 byte char array.  The total saves on the stack is 880 bytes
after you account for the 5 new pointers added.

Also the source buffer length has been increased from MAXNAMELEN
to MAXNAMELEN+strlen(MOS_DIR_NAME)+1 as described by the comment in
dsl_dir_name().  A buffer overrun may have been possible with the
slightly smaller buffer.
2010-06-16 13:49:25 -07:00
Brian Behlendorf 08415a34fb Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2010-06-16 12:44:53 -07:00
Brian Behlendorf 4738ecfcdc Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-16 12:44:09 -07:00
Brian Behlendorf 1ccdbb250b Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-06-16 12:44:08 -07:00