]> granicus.if.org Git - zfs/commit
Add fix-stack-dsl_deleg_get topic branch
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 16 Jun 2010 20:49:25 +0000 (13:49 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 16 Jun 2010 20:49:25 +0000 (13:49 -0700)
commit869764f64df5b2ef2e978c38bd051b39e65cb97e
treec100e7d9ebbf1755ebcef42ecd368f732bb7ffe9
parent428870ff734fdaccc342b33fc53cf94724409a46
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.
.topdeps [new file with mode: 0644]
.topmsg [new file with mode: 0644]
module/zfs/dsl_deleg.c