]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: remote attribute tail zeroing does too much
authorDave Chinner <dchinner@redhat.com>
Tue, 21 May 2013 08:02:03 +0000 (18:02 +1000)
committerBen Myers <bpm@sgi.com>
Thu, 30 May 2013 22:25:58 +0000 (17:25 -0500)
commit18a2af3088b2f7eba76fc6c5c20048c1a8ecd52c
tree75fc5d6b3c66dcf43851b3160034b5bbf20147ab
parent7b7e28cddd7908e60b7711bbf0ae92caebe6bedc
xfs: remote attribute tail zeroing does too much

When an attribute data does not fill then entire remote block, we
zero the remaining part of the buffer. This, however, needs to take
into account that the buffer has a header, and so the offset where
zeroing starts and the length of zeroing need to take this into
account. Otherwise we end up with zeros over the end of the
attribute value when CRCs are enabled.

While there, make sure we only ask to map an extent that covers the
remaining range of the attribute, rather than asking every time for
the full length of remote data. If the remote attribute blocks are
contiguous with other parts of the attribute tree, it will map those
blocks as well and we can potentially zero them incorrectly. We can
also get buffer size mistmatches when trying to read or remove the
remote attribute, and this can lead to not finding the correct
buffer when looking it up in cache.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
(cherry picked from commit 4af3644c9a53eb2f1ecf69cc53576561b64be4c6)
fs/xfs/xfs_attr_remote.c