Permalink
Commits on Sep 30, 2017
  1. mkfs: create the realtime rmap inode

    djwong committed Sep 27, 2017
    Create a realtime rmapbt inode if we format the fs with realtime
    and rmap.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  2. xfs_repair: rebuild the realtime rmap btree

    djwong committed Sep 27, 2017
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  3. xfs_repair: find and mark the rtrmapbt inode

    djwong committed Sep 27, 2017
    Make sure that we find the realtime rmapbt inode and mark it
    appropriately, just in case we find a rogue inode claiming to
    be an rtrmap, or just plain garbage in the superblock field.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  4. xfs_repair: check existing realtime rmapbt entries against observed r…

    djwong committed Sep 27, 2017
    …maps
    
    Once we've finished collecting reverse mapping observations from the
    metadata scan, check those observations against the realtime rmap btree
    (particularly if we're in -n mode) to detect rtrmapbt problems.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  5. xfs_repair: collect relatime reverse-mapping data for refcount/rmap t…

    djwong committed Sep 27, 2017
    …ree rebuilding
    
    Collect reverse-mapping data for realtime files so that we can later
    check and rebuild the reference count tree and the reverse mapping
    tree.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  6. xfs_repair: extend ag_rmap[] for realtime mapping collection

    djwong committed Sep 27, 2017
    Extend the ag_rmap[] infrastructure to have an extra group to store
    realtime extent reverse mappings.  Since we're pretending that the
    realtime device is AG "-1", we can just play some pointer arithmetic
    to make this work out.  In the next patch we'll actually use this
    data for something.  Extend the ag_locks[] array in a similar manner.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  7. xfs_repair: use realtime rmap btree data to check block types

    djwong committed Sep 27, 2017
    Use the realtime rmap btree to pre-populate the block type information
    so that when repair iterates the primary metadata, we can confirm the
    block type.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  8. xfs_repair: pass private data pointer to scan_lbtree

    djwong committed Sep 27, 2017
    Pass a private data pointer through scan_lbtree.  We'll use this
    later when scanning the rtrmapbt to keep track of scan state.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  9. xfs_repair: factor rrmapino into superblock size calculations

    djwong committed Sep 27, 2017
    Now that we've extended the superblock with a field for the rtrmapbt
    inode, we must adjust the superblock size calculation to include it.
    This way, repair won't complain about the non-zero contents of
    rrmapino.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  10. xfs_scrub: scrub the realtime rmap btree

    djwong committed Sep 27, 2017
    Teach scrub to ask the kernel to scrub the rtrmapbt.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  11. xfs_io: scrub the realtime rmap

    djwong committed Sep 27, 2017
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  12. xfs_db: make fsmap query the realtime reverse mapping tree

    djwong committed Sep 27, 2017
    Extend the 'fsmap' debugger command to support querying the realtime
    rmap btree via a new -r argument.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  13. xfs_db: copy the realtime rmap btree

    djwong committed Sep 27, 2017
    Copy the realtime rmapbt when we're metadumping the filesystem.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  14. xfs_db: support rudimentary checks of the rtrmap btree

    djwong committed Sep 27, 2017
    Perform some fairly superficial checks of the rtrmap btree.  We'll
    do more sophisticated checks in xfs_repair, but provide enough of
    a spot-check here that we can do simple things.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  15. xfs_db: support the realtime rmapbt

    djwong committed Sep 27, 2017
    Wire up various parts of xfs_db for realtime rmap support.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  16. xfs_db: display the realtime rmap btree contents

    djwong committed Sep 27, 2017
    Implement all the code we need to dump rtrmapbt contents, starting
    from the root inode.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  17. xfs: scrub the realtime rmapbt

    djwong committed Sep 27, 2017
    Check the realtime reverse mapping btree against the rtbitmap, and
    modify the rtbitmap scrub to check against the rtrmapbt.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  18. xfs: wire up rmap map and unmap to the realtime rmapbt

    djwong committed Sep 27, 2017
    Connect the map and unmap reverse-mapping operations to the realtime
    rmapbt via the deferred operation callbacks.  This enables us to
    perform rmap operations against the correct btree.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  19. xfs: don't assume a left rmap when allocating a new rmap

    djwong committed Sep 27, 2017
    The original rmap code assumed that there would always be at least
    one rmap in the rmapbt (the AG sb/agf/agi) and so errored out if
    it didn't find one.  This assumption isn't true for rtrmapbt, so
    remove the check and just deal with the situation.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  20. xfs: wire up a new inode fork type for the realtime rmap

    djwong committed Sep 27, 2017
    Plumb in the pieces we need to embed the root of the realtime rmap
    btree in an inode's data fork, complete with new fork type and
    on-disk interpretation functions.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  21. xfs: add realtime reverse map inode to superblock

    djwong committed Sep 27, 2017
    Add a field to the superblock to record the rt rmap inode and load
    it at mount time.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  22. xfs: add a realtime flag to the rmap update log redo items

    djwong committed Sep 27, 2017
    Extend the rmap update (RUI) log items with a new realtime flag that
    indicates that the updates apply against the realtime rmapbt.  We'll
    wire up the actual rmap code later.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  23. xfs: prepare rmap functions to deal with rtrmapbt

    djwong committed Sep 27, 2017
    Prepare the high-level rmap functions to deal with the new realtime
    rmapbt and its slightly different conventions.  Provide the ability
    to talk to either rmapbt or rtrmapbt formats from the same high
    level code.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  24. xfs: add realtime rmap btree operations

    djwong committed Sep 27, 2017
    Implement the generic btree operations needed to manipulate rtrmap
    btree blocks. This is different from the regular rmapbt in that we
    allocate space from the filesystem at large, and are neither
    constrained to the free space nor any particular AG.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  25. xfs: realtime rmap btree transaction reservations

    djwong committed Sep 27, 2017
    Make sure that there's enough log reservation to handle mapping
    and unmapping realtime extents.  We have to reserve enough space
    to handle a split in the rtrmapbt to add the record and a second
    split in the regular rmapbt to record the rtrmapbt split.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  26. xfs: define the on-disk realtime rmap btree format

    djwong committed Sep 27, 2017
    Start filling out the rtrmap btree implementation. Start with the
    on-disk btree format; add everything needed to read, write and
    manipulate rmap btree blocks. This prepares the way for connecting the
    btree operations implementation.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  27. xfs: introduce realtime rmap btree definitions

    djwong committed Sep 27, 2017
    Add new realtime rmap btree definitions. The realtime rmap btree will
    be rooted from a hidden inode, but has its own shape and therefore
    needs to have most of its own separate types.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  28. xfs: widen xfs_refcount_irec fields to handle realtime rmapbt

    djwong committed Sep 27, 2017
    Change the startblock and blockcount fields of xfs_refcount_irec to
    be 64 bits wide.  This enables us to use the same high level rmap
    code for either tree.  We'll also collect all the resulting breakage
    fixes here.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  29. xfs: support storing records in the inode core root

    djwong committed Sep 27, 2017
    Make it so that we can actually store btree records in the inode
    core (i.e. enable bb_level == 0) so that the rtrmapbt can do this.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  30. xfs: make iroot_realloc a btree function

    djwong committed Sep 27, 2017
    For btrees that are rooted in the inode core, we have to have a
    function to resize the root.  This is fairly specific to each
    btree type, so make xfs_iroot_realloc a per-btree function.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  31. xfs: create a new buf_ops pointer to verify structure metadata

    djwong committed Sep 27, 2017
    Expose all metadata structure buffer verifier functions via buf_ops.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  32. xfs: fail out of xfs_attr3_leaf_lookup_int if it looks corrupt

    djwong committed Sep 27, 2017
    If the xattr leaf block looks corrupt, return -EFSCORRUPTED to userspace
    instead of ASSERTing on debug kernels or running off the end of the
    buffer on regular kernels.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  33. xfs: provide a centralized method for verifying inline fork data

    djwong committed Sep 27, 2017
    Replace the current haphazard dir2 shortform verifier callsites with a
    centralized verifier function that can be called either with the default
    verifier functions or with a custom set.  This helps us strengthen
    integrity checking while providing us with flexibility for repair tools.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  34. xfs: refactor short form directory structure verifier function

    djwong committed Sep 27, 2017
    Change the short form directory structure verifier function to return
    the instruction pointer of a failing check or NULL if everything's ok.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  35. xfs: create structure verifier function for short form symlinks

    djwong committed Sep 27, 2017
    Create a function to check the structure of short form symlink targets.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>