1. 14 May, 2012 1 commit
    • Dave Chinner's avatar
      xfs: don't assert on delalloc regions beyond EOF · 58e20770
      Dave Chinner authored
      When we are doing speculative delayed allocation beyond EOF,
      conversion of the region allocated beyond EOF is dependent on the
      largest free space extent available. If the largest free extent is
      smaller than the delalloc range, then after allocation we leave
      a delalloc extent that starts beyond EOF. This extent cannot *ever*
      be converted by flushing data, and so will remain there until either
      the EOF moves into the extent or it is truncated away.
      Hence if xfs_getbmap() runs on such an inode and is asked to return
      extents beyond EOF, it will assert fail on this extent even though
      there is nothing xfs_getbmap() can do to convert it to a real
      extent. Hence we should simply report these delalloc extents rather
      than assert that there should be none.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
  2. 22 Mar, 2012 1 commit
    • Kamal Dasu's avatar
      xfs: fix deadlock in xfs_rtfree_extent · 5575acc7
      Kamal Dasu authored
      To fix the deadlock caused by repeatedly calling xfs_rtfree_extent
       - removed xfs_ilock() and xfs_trans_ijoin() from xfs_rtfree_extent(),
         instead added asserts that the inode is locked and has an inode_item
         attached to it.
       - in xfs_bunmapi() when dealing with an inode with the rt flag
         call xfs_ilock() and xfs_trans_ijoin() so that the
         reference count is bumped on the inode and attached it to the
         transaction before calling into xfs_bmap_del_extent, similar to
         what we do in xfs_bmap_rtalloc.
      Signed-off-by: default avatarKamal Dasu <kdasu.kdev@gmail.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
  3. 15 Mar, 2012 1 commit
  4. 17 Jan, 2012 2 commits
    • Christoph Hellwig's avatar
      xfs: remove the i_size field in struct xfs_inode · ce7ae151
      Christoph Hellwig authored
      There is no fundamental need to keep an in-memory inode size copy in the XFS
      inode.  We already have the on-disk value in the dinode, and the separate
      in-memory copy that we need for regular files only in the XFS inode.
      Remove the xfs_inode i_size field and change the XFS_ISIZE macro to use the
      VFS inode i_size field for regular files.  Switch code that was directly
      accessing the i_size field in the xfs_inode to XFS_ISIZE, or in cases where
      we are limited to regular files direct access of the VFS inode i_size field.
      This also allows dropping some fairly complicated code in the write path
      which dealt with keeping the xfs_inode i_size uptodate with the VFS i_size
      that is getting updated inside ->write_end.
      Note that we do not bother resetting the VFS i_size when truncating a file
      that gets freed to zero as there is no point in doing so because the VFS inode
      is no longer in use at this point.  Just relax the assert in xfs_ifree to
      only check the on-disk size instead.
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    • Christoph Hellwig's avatar
      xfs: remove the if_ext_max field in struct xfs_ifork · 8096b1eb
      Christoph Hellwig authored
      We spent a lot of effort to maintain this field, but it always equals to the
      fork size divided by the constant size of an extent.  The prime use of it is
      to assert that the two stay in sync.  Just divide the fork size by the extent
      size in the few places that we actually use it and remove the overhead
      of maintaining it.  Also introduce a few helpers to consolidate the places
      where we actually care about the value.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
  5. 02 Dec, 2011 1 commit
    • Dave Chinner's avatar
      xfs: fix allocation length overflow in xfs_bmapi_write() · a99ebf43
      Dave Chinner authored
      When testing the new xfstests --large-fs option that does very large
      file preallocations, this assert was tripped deep in
      XFS: Assertion failed: args->minlen <= args->maxlen, file: fs/xfs/xfs_alloc.c, line: 2239
      The allocation was trying to allocate a zero length extent because
      the lower 32 bits of the allocation length was zero. The remaining
      length of the allocation to be done was an exact multiple of 2^32 -
      the first case I saw was at 496TB remaining to be allocated.
      This turns out to be an overflow when converting the allocation
      length (a 64 bit quantity) into the extent length to allocate (a 32
      bit quantity), and it requires the length to be allocated an exact
      multiple of 2^32 blocks to trip the assert.
      Fix it by limiting the extent lenth to allocate to MAXEXTLEN.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
  6. 11 Oct, 2011 27 commits
  7. 26 Jul, 2011 1 commit
  8. 25 Jul, 2011 1 commit
  9. 13 Jul, 2011 1 commit
    • Christoph Hellwig's avatar
      xfs: reshuffle dir2 headers · 57926640
      Christoph Hellwig authored
      Replace the current mess of dir2 headers with just three that have a clear
       - xfs_dir2_format.h for all format definitions, including the inline helpers
         to access our variable size structures
       - xfs_dir2_priv.h for all prototypes that are internal to the dir2 code
         and not needed by anything outside of the directory code.  For this
         purpose xfs_da_btree.c, and phase6.c in xfs_repair are considered part
         of the directory code.
       - xfs_dir2.h for the public interface to the directory code
      In addition to the reshuffle I have also update the comments to not only
      match the new file structure, but also to describe the directory format
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
  10. 08 Jul, 2011 2 commits
  11. 25 May, 2011 2 commits