1. 07 7月, 2020 4 次提交
    • D
      xfs: fix reflink quota reservation accounting error · 83895227
      Darrick J. Wong 提交于
      Quota reservations are supposed to account for the blocks that might be
      allocated due to a bmap btree split.  Reflink doesn't do this, so fix
      this to make the quota accounting more accurate before we start
      rearranging things.
      
      Fixes: 862bb360 ("xfs: reflink extents from one file to another")
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      83895227
    • D
      xfs: don't eat an EIO/ENOSPC writeback error when scrubbing data fork · eb0efe50
      Darrick J. Wong 提交于
      The data fork scrubber calls filemap_write_and_wait to flush dirty pages
      and delalloc reservations out to disk prior to checking the data fork's
      extent mappings.  Unfortunately, this means that scrub can consume the
      EIO/ENOSPC errors that would otherwise have stayed around in the address
      space until (we hope) the writer application calls fsync to persist data
      and collect errors.  The end result is that programs that wrote to a
      file might never see the error code and proceed as if nothing were
      wrong.
      
      xfs_scrub is not in a position to notify file writers about the
      writeback failure, and it's only here to check metadata, not file
      contents.  Therefore, if writeback fails, we should stuff the error code
      back into the address space so that an fsync by the writer application
      can pick that up.
      
      Fixes: 99d9d8d0 ("xfs: scrub inode block mappings")
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      eb0efe50
    • B
      xfs: preserve rmapbt swapext block reservation from freed blocks · f74681ba
      Brian Foster 提交于
      The rmapbt extent swap algorithm remaps individual extents between
      the source inode and the target to trigger reverse mapping metadata
      updates. If either inode straddles a format or other bmap allocation
      boundary, the individual unmap and map cycles can trigger repeated
      bmap block allocations and frees as the extent count bounces back
      and forth across the boundary. While net block usage is bound across
      the swap operation, this behavior can prematurely exhaust the
      transaction block reservation because it continuously drains as the
      transaction rolls. Each allocation accounts against the reservation
      and each free returns to global free space on transaction roll.
      
      The previous workaround to this problem attempted to detect this
      boundary condition and provide surplus block reservation to
      acommodate it. This is insufficient because more remaps can occur
      than implied by the extent counts; if start offset boundaries are
      not aligned between the two inodes, for example.
      
      To address this problem more generically and dynamically, add a
      transaction accounting mode that returns freed blocks to the
      transaction reservation instead of the superblock counters on
      transaction roll and use it when the rmapbt based algorithm is
      active. This allows the chain of remap transactions to preserve the
      block reservation based own its own frees and prevent premature
      exhaustion regardless of the remap pattern. Note that this is only
      safe for superblocks with lazy sb accounting, but the latter is
      required for v5 supers and the rmap feature depends on v5.
      
      Fixes: b3fed434 ("xfs: account format bouncing into rmapbt swapext tx reservation")
      Root-caused-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      f74681ba
    • K
      xfs: Couple of typo fixes in comments · 06734e3c
      Keyur Patel 提交于
      ./xfs/libxfs/xfs_inode_buf.c:56: unnecssary ==> unnecessary
      ./xfs/libxfs/xfs_inode_buf.c:59: behavour ==> behaviour
      ./xfs/libxfs/xfs_inode_buf.c:206: unitialized ==> uninitialized
      Signed-off-by: NKeyur Patel <iamkeyur96@gmail.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      06734e3c
  2. 23 6月, 2020 1 次提交
    • D
      xfs: fix use-after-free on CIL context on shutdown · c7f87f39
      Dave Chinner 提交于
      xlog_wait() on the CIL context can reference a freed context if the
      waiter doesn't get scheduled before the CIL context is freed. This
      can happen when a task is on the hard throttle and the CIL push
      aborts due to a shutdown. This was detected by generic/019:
      
      thread 1			thread 2
      
      __xfs_trans_commit
       xfs_log_commit_cil
        <CIL size over hard throttle limit>
        xlog_wait
         schedule
      				xlog_cil_push_work
      				wake_up_all
      				<shutdown aborts commit>
      				xlog_cil_committed
      				kmem_free
      
         remove_wait_queue
          spin_lock_irqsave --> UAF
      
      Fix it by moving the wait queue to the CIL rather than keeping it in
      in the CIL context that gets freed on push completion. Because the
      wait queue is now independent of the CIL context and we might have
      multiple contexts in flight at once, only wake the waiters on the
      push throttle when the context we are pushing is over the hard
      throttle size threshold.
      
      Fixes: 0e7ab7ef ("xfs: Throttle commits on delayed background CIL push")
      Reported-by: NYu Kuai <yukuai3@huawei.com>
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      c7f87f39
  3. 10 6月, 2020 1 次提交
  4. 09 6月, 2020 1 次提交
  5. 04 6月, 2020 1 次提交
  6. 03 6月, 2020 3 次提交
  7. 30 5月, 2020 6 次提交
  8. 27 5月, 2020 23 次提交