1. 10 Nov, 2008 2 commits
    • Lachlan McIlroy's avatar
      [XFS] Wait for all I/O on truncate to zero file size · 2cf7f0da
      Lachlan McIlroy authored
      It's possible to have outstanding xfs_ioend_t's queued when the file size
      is zero. This can happen in the direct I/O path when a direct I/O write
      fails due to ENOSPC. In this case the xfs_ioend_t will still be queued (ie
      xfs_end_io_direct() does not know that the I/O failed so can't force the
      xfs_ioend_t to be flushed synchronously).
      
      When we truncate a file on unlink we don't know to wait for these
      xfs_ioend_ts and we can have a use-after-free situation if the inode is
      reclaimed before the xfs_ioend_t is finally processed.
      
      As was suggested by Dave Chinner lets wait for all I/Os to complete when
      truncating the file size to zero.
      
      SGI-PV: 981668
      
      SGI-Modid: xfs-linux-melb:xfs-kern:32216a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      2cf7f0da
    • Lachlan McIlroy's avatar
      [XFS] Fix use-after-free with log and quotas · 9ccbece5
      Lachlan McIlroy authored
      Destroying the quota stuff on unmount can access the log - ie
      XFS_QM_DONE() ends up in xfs_dqunlock() which calls
      xfs_trans_unlocked_item() and then xfs_log_move_tail(). By this time the
      log has already been destroyed. Just move the cleanup of the quota code
      earlier in xfs_unmountfs() before the call to xfs_log_unmount(). Moving
      XFS_QM_DONE() up near XFS_QM_DQPURGEALL() seems like a good spot.
      
      SGI-PV: 987086
      
      SGI-Modid: xfs-linux-melb:xfs-kern:32148a
      Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarPeter Leckie <pleckie@sgi.com>
      9ccbece5
  2. 04 Nov, 2008 15 commits
  3. 03 Nov, 2008 23 commits