summaryrefslogtreecommitdiff
tag namerepair-dirs_2022-10-14 (d25bdddfa91bd42f1074dacd7f5167d19b4bd931)
tag date2022-10-14 14:19:01 -0700
tagged byDarrick J. Wong <djwong@kernel.org>
tagged objectcommit fda03069f8...
xfs: online repair of directories
This series employs atomic extent swapping to enable safe reconstruction of directory data. For now, XFS does not support reverse directory links (aka parent pointers), so we can only salvage the dirents of a directory and construct a new structure. Directory repair therefore consists of five main parts: First, we walk the existing directory to salvage as many entries as we can, by adding them as new directory entries to the repair temp dir. Second, we validate the parent pointer found in the directory. If one was not found, we scan the entire filesystem looking for a potential parent. Third, we use atomic extent swaps to exchange the entire data fork between the two directories. Fourth, we reap the old directory blocks as carefully as we can. To wrap up the directory repair code, we need to add to the regular filesystem the ability to free all the data fork blocks in a directory. This does not change anything with normal directories, since they must still unlink and shrink one entry at a time. However, this will facilitate freeing of partially-inactivated temporary directories during log recovery. The second half of this patchset implements repairs for the dotdot entries of directories. For now there is only rudimentary support for this, because there are no directory parent pointers, so the best we can do is scanning the filesystem and the VFS dcache for answers. Signed-off-by: Darrick J. Wong <djwong@kernel.org> -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEUzaAxoMeQq6m2jMV+H93GTRKtOsFAmNJ0kUACgkQ+H93GTRK tOtlNQ/9ENeD5aJvfyk5QrqLQgwuSCPwwE3GnmfItQVt4CPfXPlrX2xspPcaLce4 z3lWJEAx3o1vvGmSXIxZxd8UVDP5UPH/ctVEK32ZApSrl8oZ/G1tVfyUSiB45AwK dMc3ST+ihgUdwOV2CaIDFbp+zSZHrE7DG+/aocFyqJ6LRHYMNWUMbcHqWpuA8RlX yApSIU6cWRvTRn6IbUuYXiIYFNP2Hpyg/4KDyrB6tZPvk3dGbBTvA6BFjDQ579sH qoy866zqEqoDLzvTgrwt6FvzS4XDMu1zqgAvsnBN97+J4pYo2mZiwsVCFMbqjlKj ZztVvHNIOoy0nj2/y1h+0T+b5yhTW+7hYVWHUpgjylgu6bGRt5a8dn+b5K4l9qYJ +uUlbLjVU7g40IlkGWp7KxGP/5ZPcUyle8VEzof2VokXW1sH6Vz/g2SXe2l4xXZ6 mpQYG4V1l1bJpnYcZ06qjW6MUv8IeAJ8NoE7BZp/Sj4oXfmW0KVlS2ykL1/FTiaJ u1vA99qAcxkMlBvRXmDFyJ7A5uZhes1VPAm59zOZdaJC3/RsND3ZaLf/DavXbl8E CJt05PqOncbOgl7zZC0TXiUIr53UK231g7coaC9tUdSragZnLrf8laiek+WVkjMu mzg/xXVm2fdxZ/YsejZbC5MFdR3+Gh826XvQZyW/n4vi5q1TJv4= =DmVn -----END PGP SIGNATURE-----