Merge tag 'dirattr-validate-owners-6.10_2024-04-15' of https://git.kernel.org/pub...
authorChandan Babu R <chandanbabu@kernel.org>
Tue, 16 Apr 2024 06:18:46 +0000 (11:48 +0530)
committerChandan Babu R <chandanbabu@kernel.org>
Tue, 16 Apr 2024 06:18:46 +0000 (11:48 +0530)
commitfb1f7c662c5b0f994a7279f8da41d12be0b6cef2
treedaefe2fda713eb96b84dbc25533c8a7bce0e415d
parent8b309acd10c0e573abbf3a6ecb3b155be7aa0d27
parentfe6c9f8e48e0dcbfc3dba17edd88490c8579b34b
Merge tag 'dirattr-validate-owners-6.10_2024-04-15' of https://git./linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeA

xfs: set and validate dir/attr block owners

There are a couple of significant changes that need to be made to the
directory and xattr code before we can support online repairs of those
data structures.

The first change is because online repair is designed to use libxfs to
create a replacement dir/xattr structure in a temporary file, and use
atomic extent swapping to commit the corrected structure.  To avoid the
performance hit of walking every block of the new structure to rewrite
the owner number before the swap, we instead change libxfs to allow
callers of the dir and xattr code the ability to set an explicit owner
number to be written into the header fields of any new blocks that are
created.  For regular operation this will be the directory inode number.

The second change is to update the dir/xattr code to actually *check*
the owner number in each block that is read off the disk, since we don't
currently do that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
* tag 'dirattr-validate-owners-6.10_2024-04-15' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: validate explicit directory free block owners
  xfs: validate explicit directory block buffer owners
  xfs: validate explicit directory data buffer owners
  xfs: validate directory leaf buffer owners
  xfs: validate dabtree node buffer owners
  xfs: validate attr remote value buffer owners
  xfs: validate attr leaf buffer owners
  xfs: reduce indenting in xfs_attr_node_list
  xfs: use the xfs_da_args owner field to set new dir/attr block owner
  xfs: add an explicit owner field to xfs_da_args