1. 04 Jul, 2024 7 commits
    • Dave Chinner's avatar
      xfs: move and rename xfs_trans_committed_bulk · 613e2fdb
      Dave Chinner authored
      Ever since the CIL and delayed logging was introduced,
      xfs_trans_committed_bulk() has been a purely CIL checkpoint
      completion function and not a transaction commit completion
      function. Now that we are adding log specific updates to this
      function, it really does not have anything to do with the
      transaction subsystem - it is really log and log item level
      functionality.
      
      This should be part of the CIL code as it is the callback
      that moves log items from the CIL checkpoint to the AIL. Move it
      and rename it to xlog_cil_ail_insert().
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      613e2fdb
    • Christoph Hellwig's avatar
      xfs: fix the contact address for the sysfs ABI documentation · 9ff4490e
      Christoph Hellwig authored
      oss.sgi.com is long dead, refer to the current linux-xfs list instead.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      9ff4490e
    • Zizhi Wo's avatar
      xfs: Avoid races with cnt_btree lastrec updates · 94a0333b
      Zizhi Wo authored
      A concurrent file creation and little writing could unexpectedly return
      -ENOSPC error since there is a race window that the allocator could get
      the wrong agf->agf_longest.
      
      Write file process steps:
      1) Find the entry that best meets the conditions, then calculate the start
         address and length of the remaining part of the entry after allocation.
      2) Delete this entry and update the -current- agf->agf_longest.
      3) Insert the remaining unused parts of this entry based on the
         calculations in 1), and update the agf->agf_longest again if necessary.
      
      Create file process steps:
      1) Check whether there are free inodes in the inode chunk.
      2) If there is no free inode, check whether there has space for creating
         inode chunks, perform the no-lock judgment first.
      3) If the judgment succeeds, the judgment is performed again with agf lock
         held. Otherwire, an error is returned directly.
      
      If the write process is in step 2) but not go to 3) yet, the create file
      process goes to 2) at this time, it may be mistaken for no space,
      resulting in the file system still has space but the file creation fails.
      
      We have sent two different commits to the community in order to fix this
      problem[1][2]. Unfortunately, both solutions have flaws. In [2], I
      discussed with Dave and Darrick, realized that a better solution to this
      problem requires the "last cnt record tracking" to be ripped out of the
      generic btree code. And surprisingly, Dave directly provided his fix code.
      This patch includes appropriate modifications based on his tmp-code to
      address this issue.
      
      The entire fix can be roughly divided into two parts:
      1) Delete the code related to lastrec-update in the generic btree code.
      2) Place the process of updating longest freespace with cntbt separately
         to the end of the cntbt modifications. Move the cursor to the rightmost
         firstly, and update the longest free extent based on the record.
      
      Note that we can not update the longest with xfs_alloc_get_rec() after
      find the longest record, as xfs_verify_agbno() may not pass because
      pag->block_count is updated on the outside. Therefore, use
      xfs_btree_get_rec() as a replacement.
      
      [1] https://lore.kernel.org/all/20240419061848.1032366-2-yebin10@huawei.com
      [2] https://lore.kernel.org/all/20240604071121.3981686-1-wozizhi@huawei.com
      
      Reported by: Ye Bin <yebin10@huawei.com>
      Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      94a0333b
    • Chandan Babu R's avatar
      Merge tag 'refcount-intent-cleanups-6.11_2024-07-02' of... · 4cdbfe45
      Chandan Babu R authored
      Merge tag 'refcount-intent-cleanups-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.11-mergeB
      
      xfs: refcount log intent cleanups
      
      This series cleans up the refcount intent code before we start adding
      support for realtime devices.  Similar to previous intent cleanup
      patchsets, we start transforming the tracepoints so that the data
      extraction are done inside the tracepoint code, and then we start
      passing the intent itself to the _finish_one function.  This reduces the
      boxing and unboxing of parameters.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'refcount-intent-cleanups-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: move xfs_refcount_update_defer_add to xfs_refcount_item.c
        xfs: simplify usage of the rcur local variable in xfs_refcount_finish_one
        xfs: don't bother calling xfs_refcount_finish_one_cleanup in xfs_refcount_finish_one
        xfs: reuse xfs_refcount_update_cancel_item
        xfs: add a ci_entry helper
        xfs: remove xfs_trans_set_refcount_flags
        xfs: clean up refcount log intent item tracepoint callsites
        xfs: pass btree cursors to refcount btree tracepoints
        xfs: create specialized classes for refcount tracepoints
        xfs: give refcount btree cursor error tracepoints their own class
      4cdbfe45
    • Chandan Babu R's avatar
      Merge tag 'rmap-intent-cleanups-6.11_2024-07-02' of... · 584aa150
      Chandan Babu R authored
      Merge tag 'rmap-intent-cleanups-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.11-mergeB
      
      xfs: rmap log intent cleanups
      
      This series cleans up the rmap intent code before we start adding
      support for realtime devices.  Similar to previous intent cleanup
      patchsets, we start transforming the tracepoints so that the data
      extraction are done inside the tracepoint code, and then we start
      passing the intent itself to the _finish_one function.  This reduces the
      boxing and unboxing of parameters.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'rmap-intent-cleanups-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: move xfs_rmap_update_defer_add to xfs_rmap_item.c
        xfs: simplify usage of the rcur local variable in xfs_rmap_finish_one
        xfs: don't bother calling xfs_rmap_finish_one_cleanup in xfs_rmap_finish_one
        xfs: reuse xfs_rmap_update_cancel_item
        xfs: add a ri_entry helper
        xfs: remove xfs_trans_set_rmap_flags
        xfs: clean up rmap log intent item tracepoint callsites
        xfs: pass btree cursors to rmap btree tracepoints
        xfs: give rmap btree cursor error tracepoints their own class
      584aa150
    • Chandan Babu R's avatar
      Merge tag 'extfree-intent-cleanups-6.11_2024-07-02' of... · 06e4e940
      Chandan Babu R authored
      Merge tag 'extfree-intent-cleanups-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.11-mergeB
      
      xfs: extent free log intent cleanups
      
      This series cleans up some warts in the extent freeing log intent code.
      We start by acknowledging that this mechanism does not have anything to
      do with the bmap code by moving it to xfs_alloc.c and giving the
      function a more descriptive name.  Then we clean up the tracepoints and
      the _finish_one call paths to pass the intent structure around.  This
      reduces the overhead when the tracepoints are disabled and will make
      things much cleaner when we start adding realtime support in the next
      patch.  I also incorporated a bunch of cleanups from Christoph Hellwig.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'extfree-intent-cleanups-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: move xfs_extent_free_defer_add to xfs_extfree_item.c
        xfs: remove xfs_defer_agfl_block
        xfs: remove duplicate asserts in xfs_defer_extent_free
        xfs: factor out a xfs_efd_add_extent helper
        xfs: reuse xfs_extent_free_cancel_item
        xfs: add a xefi_entry helper
        xfs: pass the fsbno to xfs_perag_intent_get
        xfs: convert "skip_discard" to a proper flags bitset
        xfs: clean up extent free log intent item tracepoint callsites
      06e4e940
    • Chandan Babu R's avatar
      Merge tag 'inode-refactor-6.11_2024-07-02' of... · 2f6ebd4c
      Chandan Babu R authored
      Merge tag 'inode-refactor-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.11-mergeB
      
      xfs: hoist inode operations to libxfs
      
      This series hoists inode creation, renaming, and deletion operations to
      libxfs in anticipation of the metadata inode directory feature, which
      maintains a directory tree of metadata inodes.  This will be necessary
      for further enhancements to the realtime feature, subvolume support.
      
      There aren't supposed to be any functional changes in this intense
      refactoring -- we just split the functions into pieces that are generic
      and pieces that are specific to libxfs clients.  As a bonus, we can
      remove various open-coded pieces of mkfs.xfs and xfs_repair when this
      series gets to xfsprogs.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'inode-refactor-6.11_2024-07-02' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: don't use the incore struct xfs_sb for offsets into struct xfs_dsb
        xfs: get rid of trivial rename helpers
        xfs: move dirent update hooks to xfs_dir2.c
        xfs: create libxfs helper to rename two directory entries
        xfs: create libxfs helper to exchange two directory entries
        xfs: create libxfs helper to remove an existing inode/name from a directory
        xfs: hoist inode free function to libxfs
        xfs: create libxfs helper to link an existing inode into a directory
        xfs: create libxfs helper to link a new inode into a directory
        xfs: separate the icreate logic around INIT_XATTRS
        xfs: hoist xfs_{bump,drop}link to libxfs
        xfs: hoist xfs_iunlink to libxfs
        xfs: wrap inode creation dqalloc calls
        xfs: push xfs_icreate_args creation out of xfs_create*
        xfs: hoist new inode initialization functions to libxfs
        xfs: split new inode creation into two pieces
        xfs: use xfs_trans_ichgtime to set times when allocating inode
        xfs: implement atime updates in xfs_trans_ichgtime
        xfs: pack icreate initialization parameters into a separate structure
        xfs: hoist project id get/set functions to libxfs
        xfs: hoist inode flag conversion functions to libxfs
        xfs: hoist extent size helpers to libxfs
        xfs: move inode copy-on-write predicates to xfs_inode.[ch]
        xfs: use consistent uid/gid when grabbing dquots for inodes
        xfs: verify buffer, inode, and dquot items every tx commit
      2f6ebd4c
  2. 02 Jul, 2024 33 commits