1. 03 May, 2024 4 commits
  2. 02 May, 2024 5 commits
  3. 30 Apr, 2024 8 commits
  4. 29 Apr, 2024 4 commits
  5. 26 Apr, 2024 5 commits
  6. 24 Apr, 2024 10 commits
    • Jiapeng Chong's avatar
      xfs: Remove unused function xrep_dir_self_parent · 08e012a6
      Jiapeng Chong authored
      The function are defined in the dir_repair.c file, but not called
      elsewhere, so delete the unused function.
      
      fs/xfs/scrub/dir_repair.c:186:1: warning: unused function 'xrep_dir_self_parent'.
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8867Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Reviewed-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      08e012a6
    • Chandan Babu R's avatar
      Merge tag 'repair-fixes-6.10_2024-04-23' of... · 4b0bf86c
      Chandan Babu R authored
      Merge tag 'repair-fixes-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: minor fixes to online repair
      
      Here are some miscellaneous bug fixes for the online repair code.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'repair-fixes-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: invalidate dentries for a file before moving it to the orphanage
        xfs: exchange-range for repairs is no longer dynamic
        xfs: fix iunlock calls in xrep_adoption_trans_alloc
        xfs: drop the scrub file's iolock when transaction allocation fails
      4b0bf86c
    • Chandan Babu R's avatar
      Merge tag 'reduce-scrub-iget-overhead-6.10_2024-04-23' of... · b878dbbe
      Chandan Babu R authored
      Merge tag 'reduce-scrub-iget-overhead-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: reduce iget overhead in scrub
      
      This patchset looks to reduce iget overhead in two ways: First, a
      previous patch conditionally set DONTCACHE on inodes during xchk_irele
      on the grounds that we knew better at irele time if an inode should be
      dropped.  Unfortunately, over time that patch morphed into a call to
      d_mark_dontcache, which resulted in inodes being dropped even if they
      were referenced by the dcache.  This actually caused *more* recycle
      overhead than if we'd simply called xfs_iget to set DONTCACHE only on
      misses.
      
      The second patch reduces the cost of untrusted iget for a vectored scrub
      call by having the scrubv code maintain a separate refcount to the inode
      so that the cache will always hit.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'reduce-scrub-iget-overhead-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: only iget the file once when doing vectored scrub-by-handle
        xfs: use dontcache for grabbing inodes during scrub
      b878dbbe
    • Chandan Babu R's avatar
      Merge tag 'vectorized-scrub-6.10_2024-04-23' of... · 496baa2c
      Chandan Babu R authored
      Merge tag 'vectorized-scrub-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: vectorize scrub kernel calls
      
      Create a vectorized version of the metadata scrub and repair ioctl, and
      adapt xfs_scrub to use that.  This mitigates the impact of system call
      overhead on xfs_scrub runtime.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'vectorized-scrub-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: introduce vectored scrub mode
        xfs: move xfs_ioc_scrub_metadata to scrub.c
        xfs: reduce the rate of cond_resched calls inside scrub
      496baa2c
    • Chandan Babu R's avatar
      Merge tag 'scrub-directory-tree-6.10_2024-04-23' of... · f7cea946
      Chandan Babu R authored
      Merge tag 'scrub-directory-tree-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: detect and correct directory tree problems
      
      Historically, checking the tree-ness of the directory tree structure has
      not been complete.  Cycles of subdirectories break the tree properties,
      as do subdirectories with multiple parents.  It's easy enough for DFS to
      detect problems as long as one of the participants is reachable from the
      root, but this technique cannot find unconnected cycles.
      
      Directory parent pointers change that, because we can discover all of
      these problems from a simple walk from a subdirectory towards the root.
      For each child we start with, if the walk terminates without reaching
      the root, we know the path is disconnected and ought to be attached to
      the lost and found.  If we find ourselves, we know this is a cycle and
      can delete an incoming edge.  If we find multiple paths to the root, we
      know to delete an incoming edge.
      
      Even better, once we've finished walking paths, we've identified the
      good ones and know which other path(s) to remove.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'scrub-directory-tree-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: fix corruptions in the directory tree
        xfs: report directory tree corruption in the health information
        xfs: invalidate dirloop scrub path data when concurrent updates happen
        xfs: teach online scrub to find directory tree structure problems
      f7cea946
    • Chandan Babu R's avatar
      Merge tag 'repair-pptrs-6.10_2024-04-23' of... · 1da824b0
      Chandan Babu R authored
      Merge tag 'repair-pptrs-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: online repair for parent pointers
      
      This series implements online repair for directory parent pointer
      metadata.  The checking half is fairly straightforward -- for each
      outgoing directory link (forward or backwards), grab the inode at the
      other end, and confirm that there's a corresponding link.  If we can't
      grab an inode or lock it, we'll save that link for a slower loop that
      cycles all the locks, confirms the continued existence of the link, and
      rechecks the link if it's actually still there.
      
      Repairs are a bit more involved -- for directories, we walk the entire
      filesystem to rebuild the dirents from parent pointer information.
      Parent pointer repairs do the same walk but rebuild the pptrs from the
      dirent information, but with the added twist that it duplicates all the
      xattrs so that it can use the atomic extent swapping code to commit the
      repairs atomically.
      
      This introduces an added twist to the xattr repair code -- we use dirent
      hooks to detect a colliding update to the pptr data while we're not
      holding the ILOCKs; if one is detected, we restart the xattr salvaging
      process but this time hold all the ILOCKs until the end of the scan.
      
      For offline repair, the phase6 directory connectivity scan generates an
      index of all the expected parent pointers in the filesystem.  Then it
      walks each file and compares the parent pointers attached to that file
      against the index generated, and resyncs the results as necessary.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'repair-pptrs-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: inode repair should ensure there's an attr fork to store parent pointers
        xfs: repair link count of nondirectories after rebuilding parent pointers
        xfs: adapt the orphanage code to handle parent pointers
        xfs: actually rebuild the parent pointer xattrs
        xfs: add a per-leaf block callback to xchk_xattr_walk
        xfs: split xfs_bmap_add_attrfork into two pieces
        xfs: remove pointless unlocked assertion
        xfs: implement live updates for parent pointer repairs
        xfs: repair directory parent pointers by scanning for dirents
        xfs: replay unlocked parent pointer updates that accrue during xattr repair
        xfs: implement live updates for directory repairs
        xfs: repair directories by scanning directory parent pointers
        xfs: add raw parent pointer apis to support repair
        xfs: salvage parent pointers when rebuilding xattr structures
        xfs: make the reserved block permission flag explicit in xfs_attr_set
        xfs: remove some boilerplate from xfs_attr_set
      1da824b0
    • Chandan Babu R's avatar
      Merge tag 'scrub-pptrs-6.10_2024-04-23' of... · 0d2dd382
      Chandan Babu R authored
      Merge tag 'scrub-pptrs-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: scrubbing for parent pointers
      
      Teach online fsck to use parent pointers to assist in checking
      directories, parent pointers, extended attributes, and link counts.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'scrub-pptrs-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: check parent pointer xattrs when scrubbing
        xfs: walk directory parent pointers to determine backref count
        xfs: deferred scrub of parent pointers
        xfs: scrub parent pointers
        xfs: deferred scrub of dirents
        xfs: check dirents have parent pointers
        xfs: revert commit 44af6c7e
      0d2dd382
    • Chandan Babu R's avatar
      Merge tag 'pptrs-6.10_2024-04-23' of... · 47d83c19
      Chandan Babu R authored
      Merge tag 'pptrs-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: Parent Pointers
      
      This is the latest parent pointer attributes for xfs.  The goal of this
      patch set is to add a parent pointer attribute to each inode.  The
      attribute name containing the parent inode, generation, and directory
      offset, while the  attribute value contains the file name.  This feature
      will enable future optimizations for online scrub, shrink, nfs handles,
      verity, or any other feature that could make use of quickly deriving an
      inodes path from the mount point.
      
      Directory parent pointers are stored as namespaced extended attributes
      of a file.  Because parent pointers are an indivisible tuple of
      (dirent_name, parent_ino, parent_gen) we cannot use the usual attr name
      lookup functions to find a parent pointer.  This is solvable by
      introducing a new lookup mode that checks both the name and the value of
      the xattr.
      
      Therefore, introduce this new name-value lookup mode that's gated on the
      XFS_ATTR_PARENT namespace.  This requires the introduction of new
      opcodes for the extended attribute update log intent items, which
      actually means that parent pointers (itself an INCOMPAT feature) does
      not depend on the LOGGED_XATTRS log incompat feature bit.
      
      To reduce collisions on the dirent names of parent pointers, introduce a
      new attr hash mode that is the dir2 namehash of the dirent name xor'd
      with the parent inode number.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'pptrs-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: enable parent pointers
        xfs: drop compatibility minimum log size computations for reflink
        xfs: fix unit conversion error in xfs_log_calc_max_attrsetm_res
        xfs: add a incompat feature bit for parent pointers
        xfs: don't remove the attr fork when parent pointers are enabled
        xfs: add parent pointer ioctls
        xfs: split out handle management helpers a bit
        xfs: move handle ioctl code to xfs_handle.c
        xfs: pass the attr value to put_listent when possible
        xfs: don't return XFS_ATTR_PARENT attributes via listxattr
        xfs: Add parent pointers to xfs_cross_rename
        xfs: Add parent pointers to rename
        xfs: remove parent pointers in unlink
        xfs: add parent attributes to symlink
        xfs: add parent attributes to link
        xfs: parent pointer attribute creation
        xfs: create a hashname function for parent pointers
        xfs: extend transaction reservations for parent attributes
        xfs: add parent pointer validator functions
        xfs: Expose init_xattrs in xfs_create_tmpfile
        xfs: record inode generation in xattr update log intent items
        xfs: create attr log item opcodes and formats for parent pointers
        xfs: refactor xfs_is_using_logged_xattrs checks in attr item recovery
        xfs: allow xattr matching on name and value for parent pointers
        xfs: define parent pointer ondisk extended attribute format
        xfs: add parent pointer support to attribute code
        xfs: create a separate hashname function for extended attributes
        xfs: move xfs_attr_defer_add to xfs_attr_item.c
        xfs: check the flags earlier in xfs_attr_match
        xfs: rearrange xfs_attr_match parameters
      47d83c19
    • Chandan Babu R's avatar
      Merge tag 'improve-attr-validation-6.10_2024-04-23' of... · d7d02f75
      Chandan Babu R authored
      Merge tag 'improve-attr-validation-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: improve extended attribute validation
      
      Prior to introducing parent pointer extended attributes, let's spend
      some time cleaning up the attr code and strengthening the validation
      that it performs on attrs coming in from the disk.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'improve-attr-validation-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: enforce one namespace per attribute
        xfs: refactor name/value iovec validation in xlog_recover_attri_commit_pass2
        xfs: refactor name/length checks in xfs_attri_validate
        xfs: use local variables for name and value length in _attri_commit_pass2
        xfs: always set args->value in xfs_attri_item_recover
        xfs: validate recovered name buffers when recovering xattr items
        xfs: use helpers to extract xattr op from opflags
        xfs: restructure xfs_attr_complete_op a bit
        xfs: check shortform attr entry flags specifically
        xfs: fix missing check for invalid attr flags
        xfs: check opcode and iovec count match in xlog_recover_attri_commit_pass2
        xfs: use an XFS_OPSTATE_ flag for detecting if logged xattrs are available
        xfs: require XFS_SB_FEAT_INCOMPAT_LOG_XATTRS for attr log intent item recovery
        xfs: attr fork iext must be loaded before calling xfs_attr_is_leaf
      d7d02f75
    • Chandan Babu R's avatar
      Merge tag 'shrink-dirattr-args-6.10_2024-04-23' of... · 1321890a
      Chandan Babu R authored
      Merge tag 'shrink-dirattr-args-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
      
      xfs: shrink struct xfs_da_args
      
      Let's clean out some unused flags and fields from struct xfs_da_args.
      Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
      
      * tag 'shrink-dirattr-args-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
        xfs: rearrange xfs_da_args a bit to use less space
        xfs: make attr removal an explicit operation
        xfs: remove xfs_da_args.attr_flags
        xfs: remove XFS_DA_OP_NOTIME
        xfs: remove XFS_DA_OP_REMOVE
      1321890a
  7. 23 Apr, 2024 4 commits