08 May, 2020

1 commit

  • Create a generic dispatch structure to delegate recovery of different
    log item types into various code modules. This will enable us to move
    code specific to a particular log item type out of xfs_log_recover.c and
    into the log item source.

    The first operation we virtualize is the log item sorting.

    Signed-off-by: Darrick J. Wong
    Reviewed-by: Chandan Babu R
    Reviewed-by: Christoph Hellwig

    Darrick J. Wong
     

05 May, 2020

1 commit

  • I ran into a linker warning in XFS that originates from a mismatch
    between libelf, binutils and objtool when certain files in the kernel
    are built with "gcc -g":

    x86_64-linux-ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info

    After some discussion, nobody could identify why xfs sets this flag
    here. CONFIG_XFS_DEBUG used to enable lots of unrelated settings, but
    now its main purpose is to enable extra consistency checks and assertions
    that are unrelated to the debug info.

    Remove the Makefile logic to set the flag here. If anyone relies
    on the debug info, this can simply be enabled again with the global
    CONFIG_DEBUG_INFO option.

    Dave Chinner writes:

    I'm pretty sure it was needed for the original kgdb integration back
    in the early 2000s. That was when SGI used to patch their XFS dev
    tree with kgdb and debug symbols were needed by the custom kgdb
    modules that were ported across from the Irix kernel debugger.

    ISTR that the early kcrash kernel dump analysis tools (again,
    originated from the Irix "icrash" kernel dump tools) had custom XFS
    debug scripts that needed also the debug info to work correctly...

    Which is a long way of saying "we don't need it anymore" instead of
    "nobody knows why it was set"... :)

    Suggested-by: Christoph Hellwig
    Link: https://lore.kernel.org/lkml/20200409074130.GD21033@infradead.org/
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Brian Foster
    Reviewed-by: Allison Collins
    Reviewed-by: Dave Chinner
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Darrick J. Wong

    Arnd Bergmann
     

18 Mar, 2020

1 commit

  • Create an in-core fake root for AG-rooted btree types so that callers
    can generate a whole new btree using the upcoming btree bulk load
    function without making the new tree accessible from the rest of the
    filesystem. It is up to the individual btree type to provide a function
    to create a staged cursor (presumably with the appropriate callouts to
    update the fakeroot) and then commit the staged root back into the
    filesystem.

    Signed-off-by: Darrick J. Wong
    Reviewed-by: Brian Foster

    Darrick J. Wong
     

11 Nov, 2019

1 commit


15 Jul, 2019

1 commit

  • Userspace now has an identical xfs_trans_inode.c which it has already
    moved to libxfs/ so do the same move for kernelspace.

    Signed-off-by: Eric Sandeen
    Reviewed-by: Brian Foster
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Darrick J. Wong

    Eric Sandeen
     

03 Jul, 2019

2 commits


29 Jun, 2019

5 commits


18 May, 2019

1 commit

  • Currently, the Kbuild core manipulates header search paths in a crazy
    way [1].

    To fix this mess, I want all Makefiles to add explicit $(srctree)/ to
    the search paths in the srctree. Some Makefiles are already written in
    that way, but not all. The goal of this work is to make the notation
    consistent, and finally get rid of the gross hacks.

    Having whitespaces after -I does not matter since commit 48f6e3cf5bc6
    ("kbuild: do not drop -I without parameter").

    [1]: https://patchwork.kernel.org/patch/9632347/

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

30 Apr, 2019

1 commit

  • Teach online scrub how to check the filesystem summary counters. We use
    the incore delalloc block counter along with the incore AG headers to
    compute expected values for fdblocks, icount, and ifree, and then check
    that the percpu counter is within a certain threshold of the expected
    value. This is done to avoid having to freeze or otherwise lock the
    filesystem, which means that we're only checking that the counters are
    fairly close, not that they're exactly correct.

    Signed-off-by: Darrick J. Wong
    Reviewed-by: Dave Chinner
    Reviewed-by: Brian Foster

    Darrick J. Wong
     

17 Apr, 2019

1 commit


15 Apr, 2019

1 commit

  • Add the necessary in-core metadata fields to keep track of which parts
    of the filesystem have been observed and which parts were observed to be
    unhealthy, and print a warning at unmount time if we have unfixed
    problems.

    Signed-off-by: Darrick J. Wong
    Reviewed-by: Brian Foster

    Darrick J. Wong
     

30 Jul, 2018

1 commit


09 Jun, 2018

1 commit

  • New verification functions like xfs_verify_fsbno() and
    xfs_verify_agino() are spread across multiple files and different
    header files. They really don't fit cleanly into the places they've
    been put, and have wider scope than the current header includes.

    Move the type verifiers to a new file in libxfs (xfs-types.c) and
    the prototypes to xfs_types.h where they will be visible to all the
    code that uses the types.

    Signed-Off-By: Dave Chinner
    Reviewed-by: Brian Foster
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Darrick J. Wong

    Dave Chinner
     

07 Jun, 2018

1 commit

  • Remove the verbose license text from XFS files and replace them
    with SPDX tags. This does not change the license of any of the code,
    merely refers to the common, up-to-date license files in LICENSES/

    This change was mostly scripted. fs/xfs/Makefile and
    fs/xfs/libxfs/xfs_fs.h were modified by hand, the rest were detected
    and modified by the following command:

    for f in `git grep -l "GNU General" fs/xfs/` ; do
    echo $f
    cat $f | awk -f hdr.awk > $f.new
    mv -f $f.new $f
    done

    And the hdr.awk script that did the modification (including
    detecting the difference between GPL-2.0 and GPL-2.0+ licenses)
    is as follows:

    $ cat hdr.awk
    BEGIN {
    hdr = 1.0
    tag = "GPL-2.0"
    str = ""
    }

    /^ \* This program is free software/ {
    hdr = 2.0;
    next
    }

    /any later version./ {
    tag = "GPL-2.0+"
    next
    }

    /^ \*\// {
    if (hdr > 0.0) {
    print "// SPDX-License-Identifier: " tag
    print str
    print $0
    str=""
    hdr = 0.0
    next
    }
    print $0
    next
    }

    /^ \* / {
    if (hdr > 1.0)
    next
    if (hdr > 0.0) {
    if (str != "")
    str = str "\n"
    str = str $0
    next
    }
    print $0
    next
    }

    /^ \*/ {
    if (hdr > 0.0)
    next
    print $0
    next
    }

    // {
    if (hdr > 0.0) {
    if (str != "")
    str = str "\n"
    str = str $0
    next
    }
    print $0
    }

    END { }
    $

    Signed-off-by: Dave Chinner
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Darrick J. Wong

    Dave Chinner
     

30 May, 2018

1 commit

  • If one of the backup superblocks is found to differ seriously from
    superblock 0, write out a fresh copy from the in-core sb.

    Signed-off-by: Darrick J. Wong
    Reviewed-by: Allison Henderson
    Reviewed-by: Dave Chinner

    Darrick J. Wong
     

16 May, 2018

2 commits

  • So it can be shared with userspace (e.g. mkfs) easily.

    Signed-Off-By: Dave Chinner
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Darrick J. Wong

    Dave Chinner
     
  • Plumb in the pieces necessary to make the "scrub" subfunction of
    the scrub ioctl actually work. This means that we make the IFLAG_REPAIR
    flag to the scrub ioctl actually do something, and we add an errortag
    knob so that xfstests can force the kernel to rebuild a metadata
    structure even if there's nothing wrong with it.

    Signed-off-by: Darrick J. Wong
    Reviewed-by: Dave Chinner

    Darrick J. Wong
     

07 Nov, 2017

1 commit

  • Replace the current linear list and the indirection array for the in-core
    extent list with a b+tree to avoid the need for larger memory allocations
    for the indirection array when lots of extents are present. The current
    extent list implementations leads to heavy pressure on the memory
    allocator when modifying files with a high extent count, and can lead
    to high latencies because of that.

    The replacement is a b+tree with a few quirks. The leaf nodes directly
    store the extent record in two u64 values. The encoding is a little bit
    different from the existing in-core extent records so that the start
    offset and length which are required for lookups can be retreived with
    simple mask operations. The inner nodes store a 64-bit key containing
    the start offset in the first half of the node, and the pointers to the
    next lower level in the second half. In either case we walk the node
    from the beginninig to the end and do a linear search, as that is more
    efficient for the low number of cache lines touched during a search
    (2 for the inner nodes, 4 for the leaf nodes) than a binary search.
    We store termination markers (zero length for the leaf nodes, an
    otherwise impossible high bit for the inner nodes) to terminate the key
    list / records instead of storing a count to use the available cache
    lines as efficiently as possible.

    One quirk of the algorithm is that while we normally split a node half and
    half like usual btree implementations we just spill over entries added at
    the very end of the list to a new node on its own. This means we get a
    100% fill grade for the common cases of bulk insertion when reading an
    inode into memory, and when only sequentially appending to a file. The
    downside is a slightly higher chance of splits on the first random
    insertions.

    Both insert and removal manually recurse into the lower levels, but
    the bulk deletion of the whole tree is still implemented as a recursive
    function call, although one limited by the overall depth and with very
    little stack usage in every iteration.

    For the first few extents we dynamically grow the list from a single
    extent to the next powers of two until we have a first full leaf block
    and that building the actual tree.

    The code started out based on the generic lib/btree.c code from Joern
    Engel based on earlier work from Peter Zijlstra, but has since been
    rewritten beyond recognition.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Darrick J. Wong

    Christoph Hellwig
     

27 Oct, 2017

17 commits