summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_dir2.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2021-01-15 14:15:42 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-02-22 18:57:20 -0800
commitb5e1f213d9de7a3f4f5c2e7b8a488ff6f737c83b (patch)
tree041fde47ede1353372553578dde97f75e2d6171f /fs/xfs/libxfs/xfs_dir2.h
parent63e8f471c6d5a1a84e2bab4434a950a10574fb17 (diff)
xfs: fix an ABBA deadlock in xfs_renamemerge-5.12_2021-02-22
When overlayfs is running on top of xfs and the user unlinks a file in the overlay, overlayfs will create a whiteout inode and ask xfs to "rename" the whiteout file atop the one being unlinked. If the file being unlinked loses its one nlink, we then have to put the inode on the unlinked list. This requires us to grab the AGI buffer of the whiteout inode to take it off the unlinked list (which is where whiteouts are created) and to grab the AGI buffer of the file being deleted. If the whiteout was created in a higher numbered AG than the file being deleted, we'll lock the AGIs in the wrong order and deadlock. Therefore, grab all the AGI locks we think we'll need ahead of time, and in order of increasing AG number per the locking rules. Reported-by: wenli xie <wlxie7296@gmail.com> Fixes: 93597ae8dac0 ("xfs: Fix deadlock between AGI and AGF when target_ip exists in xfs_rename()") Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2.h')
-rw-r--r--fs/xfs/libxfs/xfs_dir2.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2.h b/fs/xfs/libxfs/xfs_dir2.h
index e55378640b05..d03e6098ded9 100644
--- a/fs/xfs/libxfs/xfs_dir2.h
+++ b/fs/xfs/libxfs/xfs_dir2.h
@@ -47,8 +47,6 @@ extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp,
extern int xfs_dir_removename(struct xfs_trans *tp, struct xfs_inode *dp,
struct xfs_name *name, xfs_ino_t ino,
xfs_extlen_t tot);
-extern bool xfs_dir2_sf_replace_needblock(struct xfs_inode *dp,
- xfs_ino_t inum);
extern int xfs_dir_replace(struct xfs_trans *tp, struct xfs_inode *dp,
struct xfs_name *name, xfs_ino_t inum,
xfs_extlen_t tot);