summaryrefslogtreecommitdiff
tag nameattr-scrub-fixes_2019-06-26 (0eba3786b6505d7158bce3d004a343bc4e864673)
tag date2019-06-26 13:03:43 -0700
tagged byDarrick J. Wong <darrick.wong@oracle.com>
tagged objectcommit cfda09de94...
xfs: scrub-related fixes
I discovered by sampling xfs_scrub stack trace swith a flame graph that the attr scrub code has a sizeable oversight -- the xattr scrub code always allocates a zeroed 65K temporary buffer before locking the inode, even if it then turns out that the inode does not have extended attributes. In addition to the pointless memory allocation, the scrub code itself is careful to initialize whatever part of the memory buffer it's going to use before reading the contents, which means that the memory clearing is not only painful (it's 5%% of the sample traces!) but totally pointless. The first patch does more whack-a-mole cleanup of places where corrupt ondisk directory metadata causes ASSERTs instead of -EFSCORRUPTED returns. The rest of the series first cleans up the open-coded pointer calculations where the buffer is concerned, and then restructures the code so to allocate the smallest size buffer needed and only just before it's actually needed. The final patch disables buffer zeroing for better performance.