xfs: inactivate directory data blocks
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:50 +0000 (14:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:58:55 +0000 (14:58 -0700)
commit8d81082a8c9541bdf6164c4639dc1936209fe1c4
treec613a309488dad3536850e126ce41e6aa3972ebd
parent669dfe883c8e20231495f80a28ec7cc0b8fdddc4
xfs: inactivate directory data blocks

Teach inode inactivation to delete all the incore buffers backing a
directory.  In normal runtime this should never happen because the VFS
forbids rmdir on a non-empty directory.

In the next patch, online directory repair stands up a new directory,
exchanges it with the broken directory, and then drops the private
temporary directory.  If we cancel the repair just prior to exchanging
the directory contents, the new directory will need to be torn down.
Note: If we commit the repair, reaping will take care of all the ondisk
space allocations and incore buffers for the old corrupt directory.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_inode.c