xfs: fully initialise temp leaf in xfs_attr3_leaf_compact
authorDave Chinner <dchinner@redhat.com>
Tue, 21 May 2013 08:02:06 +0000 (18:02 +1000)
committerBen Myers <bpm@sgi.com>
Thu, 23 May 2013 22:53:08 +0000 (17:53 -0500)
commitd4c712bcf26a25c2b67c90e44e0b74c7993b5334
tree770c9cf547a271f25cbddae93ab2946dcd0f9ca1
parent8517de2a81da830f5d90da66b4799f4040c76dc9
xfs: fully initialise temp leaf in xfs_attr3_leaf_compact

xfs_attr3_leaf_compact() uses a temporary buffer for compacting the
the entries in a leaf. It copies the the original buffer into the
temporary buffer, then zeros the original buffer completely. It then
copies the entries back into the original buffer.  However, the
original buffer has not been correctly initialised, and so the
movement of the entries goes horribly wrong.

Make sure the zeroed destination buffer is fully initialised, and
once we've set up the destination incore header appropriately, write
is back to the buffer before starting to move entries around.

While debugging this, the _d/_s prefixes weren't sufficient to
remind me what buffer was what, so rename then all _src/_dst.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_attr_leaf.c