diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-09-11 17:39:07 +0200 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-09-12 19:31:07 +0200 |
commit | 83771c50e42b92de6740a63e152c96c052d37736 (patch) | |
tree | a8d16d2d2249f6972872b16611a62fbe30850229 /fs/xfs/xfs_itable.c | |
parent | xfs: use i_prev_unlinked to distinguish inodes that are not on the unlinked list (diff) | |
download | linux-83771c50e42b92de6740a63e152c96c052d37736.tar.xz linux-83771c50e42b92de6740a63e152c96c052d37736.zip |
xfs: reload entire unlinked bucket lists
The previous patch to reload unrecovered unlinked inodes when adding a
newly created inode to the unlinked list is missing a key piece of
functionality. It doesn't handle the case that someone calls xfs_iget
on an inode that is not the last item in the incore list. For example,
if at mount time the ondisk iunlink bucket looks like this:
AGI -> 7 -> 22 -> 3 -> NULL
None of these three inodes are cached in memory. Now let's say that
someone tries to open inode 3 by handle. We need to walk the list to
make sure that inodes 7 and 22 get loaded cold, and that the
i_prev_unlinked of inode 3 gets set to 22.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index c2093cb56092..ccf0c4ff4490 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -80,6 +80,15 @@ xfs_bulkstat_one_int( if (error) goto out; + if (xfs_inode_unlinked_incomplete(ip)) { + error = xfs_inode_reload_unlinked_bucket(tp, ip); + if (error) { + xfs_iunlock(ip, XFS_ILOCK_SHARED); + xfs_irele(ip); + return error; + } + } + ASSERT(ip != NULL); ASSERT(ip->i_imap.im_blkno != 0); inode = VFS_I(ip); |