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
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
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
11 Nov, 2019
1 commit
-
Signed-off-by: Christoph Hellwig
Reviewed-by: Darrick J. Wong
Signed-off-by: Darrick J. Wong
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
03 Jul, 2019
2 commits
-
Create a parallel iwalk implementation and switch quotacheck to use it.
Signed-off-by: Darrick J. Wong
Reviewed-by: Brian Foster -
Create a new iterator function to simplify walking inodes in an XFS
filesystem. This new iterator will replace the existing open-coded
walking that goes on in various places.Signed-off-by: Darrick J. Wong
Reviewed-by: Brian Foster
29 Jun, 2019
5 commits
-
Keep all bmap item related code together.
Signed-off-by: Christoph Hellwig
Reviewed-by: Brian Foster
Reviewed-by: Darrick J. Wong
Signed-off-by: Darrick J. Wong -
Keep all rmap item related code together in one file.
Signed-off-by: Christoph Hellwig
Reviewed-by: Brian Foster
Reviewed-by: Darrick J. Wong
Signed-off-by: Darrick J. Wong -
Keep all the refcount item related code together in one file.
Signed-off-by: Christoph Hellwig
Reviewed-by: Brian Foster
Reviewed-by: Darrick J. Wong
Signed-off-by: Darrick J. Wong -
Keep all the extree item related code together in one file.
Signed-off-by: Christoph Hellwig
Reviewed-by: Brian Foster
Reviewed-by: Darrick J. Wong
Signed-off-by: Darrick J. Wong -
The xfs_buf structure is basically used as a glorified container for
a memory allocation in the log recovery code. Replace it with a
call to kmem_alloc_large and a simple abstraction to read into or
write from it synchronously using chained bios.Signed-off-by: Christoph Hellwig
Reviewed-by: Darrick J. Wong
Signed-off-by: Darrick J. Wong
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
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
17 Apr, 2019
1 commit
-
Now that we have the ability to track sick metadata in-core, make scrub
and repair update those health assessments after doing work.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner
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
30 Jul, 2018
1 commit
-
Move the xrep_extent_list code into a separate file. Logically, this
data structure is really just a clumsy bitmap, and in the next patch
we'll make this more obvious. No functional changes.Signed-off-by: Darrick J. Wong
Reviewed-by: Brian Foster
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
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
doneAnd 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
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
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 -
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
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
27 Oct, 2017
17 commits
-
Perform some quick sanity testing of the disk quota information.
Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Perform simple tests of the realtime bitmap and summary.
Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Scrub parent pointers, sort of. For directories, we can ride the
'..' entry up to the parent to confirm that there's at most one
dentry that points back to this directory.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Create the infrastructure to scrub symbolic link data.
Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Scrub the hash tree, keys, and values in an extended attribute structure.
Refactor the attribute code to use the transaction if the caller supplied
one to avoid buffer deadocks.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Scrub the hash tree and all the entries in a directory.
Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Provide a way to check the shape and scrub the hashes and records
in a directory or extended attribute btree. These are helper functions
for the directory & attribute scrubbers in subsequent patches.Signed-off-by: Darrick J. Wong
[fengguang: remove unneeded variable to store return value]
Signed-off-by: Fengguang Wu
Reviewed-by: Dave Chinner -
Scrub an individual inode's block mappings to make sure they make sense.
Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Scrub the fields within an inode.
Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Plumb in the pieces necessary to check the refcount btree. If rmap is
available, check the reference count by performing an interval query
against the rmapbt.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Check the reverse mapping records to make sure that the contents
make sense.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Check the records of the inode btrees to make sure that the values
make sense given the inode records themselves.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Check the extent records free space btrees to ensure that the values
look sane.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Ensure that the geometry presented in the backup superblocks matches
the primary superblock so that repair can recover the filesystem if
that primary gets corrupted.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Create helper functions and tracepoints to deal with errors while
scrubbing a metadata btree.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Create a probe scrubber with id 0. This will be used by xfs_scrub to
probe the kernel's abilities to scrub (and repair) the metadata. We do
this by validating the ioctl inputs from userspace, preparing the
filesystem for a scrub (or a repair) operation, and immediately
returning to userspace. Userspace can use the returned errno and
structure state to decide (in broad terms) if scrub/repair are
supported by the running kernel.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner -
Create an ioctl that can be used to scrub internal filesystem metadata.
The new ioctl takes the metadata type, an (optional) AG number, an
(optional) inode number and generation, and a flags argument. This will
be used by the upcoming XFS online scrub tool.Signed-off-by: Darrick J. Wong
Reviewed-by: Dave Chinner