diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-04-22 09:47:46 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-04-23 07:46:58 -0700 |
commit | fb102fe7fe02e70f8a49cc7f74bc0769cdab2912 (patch) | |
tree | 0e47e492d4525dc31e018c8fdfc8578f8105c099 /fs/xfs/scrub/attr.c | |
parent | 7dba4a5fe1c5cdf0859830380c52f29295cbf345 (diff) | |
download | linux-stable-fb102fe7fe02e70f8a49cc7f74bc0769cdab2912.tar.gz linux-stable-fb102fe7fe02e70f8a49cc7f74bc0769cdab2912.tar.bz2 linux-stable-fb102fe7fe02e70f8a49cc7f74bc0769cdab2912.zip |
xfs: create a hashname function for parent pointers
Although directory entry and parent pointer recordsets look very similar
(name -> ino), there's one major difference between them: a file can be
hardlinked from multiple parent directories with the same filename.
This is common in shared container environments where a base directory
tree might be hardlink-copied multiple times. IOWs the same 'ls'
program might be hardlinked to multiple /srv/*/bin/ls paths.
We don't want parent pointer operations to bog down on hash collisions
between the same dirent name, so create a special hash function that
mixes in the parent directory inode number.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub/attr.c')
-rw-r--r-- | fs/xfs/scrub/attr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c index 22d7ef4df169..c07d050b39b2 100644 --- a/fs/xfs/scrub/attr.c +++ b/fs/xfs/scrub/attr.c @@ -536,6 +536,10 @@ xchk_xattr_rec( xchk_da_set_corrupt(ds, level); goto out; } + if (ent->flags & XFS_ATTR_PARENT) { + xchk_da_set_corrupt(ds, level); + goto out; + } calc_hash = xfs_attr_hashval(mp, ent->flags, rentry->name, rentry->namelen, NULL, be32_to_cpu(rentry->valuelen)); |