1. 15 3月, 2022 2 次提交
  2. 23 1月, 2021 1 次提交
    • D
      xfs: fix an ABBA deadlock in xfs_rename · 6da1b4b1
      Darrick J. Wong 提交于
      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: Nwenli xie <wlxie7296@gmail.com>
      Fixes: 93597ae8 ("xfs: Fix deadlock between AGI and AGF when target_ip exists in xfs_rename()")
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      6da1b4b1
  3. 14 5月, 2020 1 次提交
  4. 14 11月, 2019 1 次提交
    • K
      xfs: Fix deadlock between AGI and AGF when target_ip exists in xfs_rename() · 93597ae8
      kaixuxia 提交于
      When target_ip exists in xfs_rename(), the xfs_dir_replace() call may
      need to hold the AGF lock to allocate more blocks, and then invoking
      the xfs_droplink() call to hold AGI lock to drop target_ip onto the
      unlinked list, so we get the lock order AGF->AGI. This would break the
      ordering constraint on AGI and AGF locking - inode allocation locks
      the AGI, then can allocate a new extent for new inodes, locking the
      AGF after the AGI.
      
      In this patch we check whether the replace operation need more
      blocks firstly. If so, acquire the agi lock firstly to preserve
      locking order(AGI/AGF). Actually, the locking order problem only
      occurs when we are locking the AGI/AGF of the same AG. For multiple
      AGs the AGI lock will be released after the transaction committed.
      Signed-off-by: Nkaixuxia <kaixuxia@tencent.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      [darrick: reword the comment]
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      93597ae8
  5. 11 11月, 2019 34 次提交
  6. 12 2月, 2019 1 次提交