1. 29 1月, 2018 4 次提交
    • D
      xfs: don't screw up direct writes when freesp is fragmented · 6d8a45ce
      Darrick J. Wong 提交于
      xfs_bmap_btalloc is given a range of file offset blocks that must be
      allocated to some data/attr/cow fork.  If the fork has an extent size
      hint associated with it, the request will be enlarged on both ends to
      try to satisfy the alignment hint.  If free space is fragmentated,
      sometimes we can allocate some blocks but not enough to fulfill any of
      the requested range.  Since bmapi_allocate always trims the new extent
      mapping to match the originally requested range, this results in
      bmapi_write returning zero and no mapping.
      
      The consequences of this vary -- buffered writes will simply re-call
      bmapi_write until it can satisfy at least one block from the original
      request.  Direct IO overwrites notice nmaps == 0 and return -ENOSPC
      through the dio mechanism out to userspace with the weird result that
      writes fail even when we have enough space because the ENOSPC return
      overrides any partial write status.  For direct CoW writes the situation
      was disastrous because nobody notices us returning an invalid zero-length
      wrong-offset mapping to iomap and the write goes off into space.
      
      Therefore, if free space is so fragmented that we managed to allocate
      some space but not enough to map into even a single block of the
      original allocation request range, we should break the alignment hint in
      order to guarantee at least some forward progress for the direct write.
      If we return a short allocation to iomap_apply it'll call back about the
      remaining blocks.
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      6d8a45ce
    • D
      xfs: treat CoW fork operations as delalloc for quota accounting · 4b4c1326
      Darrick J. Wong 提交于
      Since the CoW fork only exists in memory, it is incorrect to update the
      on-disk quota block counts when we modify the CoW fork.  Unlike the data
      fork, even real extents in the CoW fork are only delalloc-style
      reservations (on-disk they're owned by the refcountbt) so they must not
      be tracked in the on disk quota info.  Ensure the i_delayed_blks
      accounting reflects this too.
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      4b4c1326
    • D
      xfs: refactor accounting updates out of xfs_bmap_btalloc · 751f3767
      Darrick J. Wong 提交于
      Move all the inode and quota accounting updates out of xfs_bmap_btalloc
      in preparation for fixing some quota accounting problems with copy on
      write.
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      751f3767
    • S
      xfs: bmap code cleanup · 6ca30729
      Shan Hai 提交于
      Remove the extent size hint and realtime inode relevant code from
      the xfs_bmapi_reserve_delalloc since it is not called on the inode
      with extent size hint set or on a realtime inode.
      Signed-off-by: NShan Hai <shan.hai@oracle.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      6ca30729
  2. 18 1月, 2018 1 次提交
    • D
      xfs: recheck reflink / dirty page status before freeing CoW reservations · be78ff0e
      Darrick J. Wong 提交于
      Eryu Guan reported seeing occasional hangs when running generic/269 with
      a new fsstress that supports clonerange/deduperange.  The cause of this
      hang is an infinite loop when we convert the CoW fork extents from
      unwritten to real just prior to writing the pages out; the infinite
      loop happens because there's nothing in the CoW fork to convert, and so
      it spins forever.
      
      The fundamental issue here is that when we go to perform these CoW fork
      conversions, we're supposed to have an extent waiting for us, but the
      low space CoW reaper has snuck in and blown them away!  There are four
      conditions that can dissuade the reaper from touching our file -- no
      reflink iflag; dirty page cache; writeback in progress; or directio in
      progress.  We check the four conditions prior to taking the locks, but
      we neglect to recheck them once we have the locks, which is how we end
      up whacking the writeback that's in progress.
      
      Therefore, refactor the four checks into a helper function and call it
      once again once we have the locks to make sure we really want to reap
      the inode.  While we're at it, add an ASSERT for this weird condition so
      that we'll fail noisily if we ever screw this up again.
      Reported-by: NEryu Guan <eguan@redhat.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Tested-by: NEryu Guan <eguan@redhat.com>
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      be78ff0e
  3. 09 1月, 2018 1 次提交
  4. 15 12月, 2017 1 次提交
  5. 29 11月, 2017 1 次提交
  6. 07 11月, 2017 16 次提交
  7. 02 11月, 2017 1 次提交
  8. 27 10月, 2017 15 次提交