Hi all, 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. If you're going to start using this mess, you probably ought to just pull from my git trees, which are linked below. This is an extraordinary way to destroy everything. Enjoy! Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=attr-scrub-fixes