Commit Graph

25 Commits

Author SHA1 Message Date
Bill O'Donnell 642f6fa085 xfs: pass the defer ops instead of type to xfs_defer_start_recovery
JIRA: https://issues.redhat.com/browse/RHEL-65728

commit dc22af64368291a86fb6b7eb2adab21c815836b7
Author: Christoph Hellwig <hch@lst.de>
Date:   Thu Dec 14 06:16:32 2023 +0100

    xfs: pass the defer ops instead of type to xfs_defer_start_recovery

    xfs_defer_start_recovery is only called from xlog_recover_intent_item,
    and the callers of that all have the actual xfs_defer_ops_type operation
    vector at hand.  Pass that directly instead of looking it up from the
    defer_op_types table.

    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2024-11-20 11:25:59 -06:00
Bill O'Donnell 2990c8ef58 xfs: move ->iop_recover to xfs_defer_op_type
JIRA: https://issues.redhat.com/browse/RHEL-65728

commit db7ccc0bac2add5a41b66578e376b49328fc99d0
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Wed Nov 22 13:39:25 2023 -0800

    xfs: move ->iop_recover to xfs_defer_op_type

    Finish off the series by moving the intent item recovery function
    pointer to the xfs_defer_op_type struct, since this is really a deferred
    work function now.

    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2024-11-20 11:25:49 -06:00
Bill O'Donnell f2a94e0149 xfs: use xfs_defer_finish_one to finish recovered work items
JIRA: https://issues.redhat.com/browse/RHEL-65728

commit e5f1a5146ec35f3ed5d7f5ac7807a10c0062b6b8
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Wed Nov 22 11:25:45 2023 -0800

    xfs: use xfs_defer_finish_one to finish recovered work items

    Get rid of the open-coded calls to xfs_defer_finish_one.  This also
    means that the recovery transaction takes care of cleaning up the dfp,
    and we have solved (I hope) all the ownership issues in recovery.

    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2024-11-20 11:25:48 -06:00
Bill O'Donnell 75128f30ea xfs: transfer recovered intent item ownership in ->iop_recover
JIRA: https://issues.redhat.com/browse/RHEL-65728

commit deb4cd8ba87f17b12c72b3827820d9c703e9fd95
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Wed Nov 22 10:47:10 2023 -0800

    xfs: transfer recovered intent item ownership in ->iop_recover

    Now that we pass the xfs_defer_pending object into the intent item
    recovery functions, we know exactly when ownership of the sole refcount
    passes from the recovery context to the intent done item.  At that
    point, we need to null out dfp_intent so that the recovery mechanism
    won't release it.  This should fix the UAF problem reported by Long Li.

    Note that we still want to recreate the full deferred work state.  That
    will be addressed in the next patches.

    Fixes: 2e76f188fd ("xfs: cancel intents immediately if process_intents fails")
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2024-11-20 11:25:47 -06:00
Bill O'Donnell ec6910b028 xfs: use xfs_defer_pending objects to recover intent items
JIRA: https://issues.redhat.com/browse/RHEL-65728

commit 03f7767c9f6120ac933378fdec3bfd78bf07bc11
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Wed Nov 22 10:23:23 2023 -0800

    xfs: use xfs_defer_pending objects to recover intent items

    One thing I never quite got around to doing is porting the log intent
    item recovery code to reconstruct the deferred pending work state.  As a
    result, each intent item open codes xfs_defer_finish_one in its recovery
    method, because that's what the EFI code did before xfs_defer.c even
    existed.

    This is a gross thing to have left unfixed -- if an EFI cannot proceed
    due to busy extents, we end up creating separate new EFIs for each
    unfinished work item, which is a change in behavior from what runtime
    would have done.

    Worse yet, Long Li pointed out that there's a UAF in the recovery code.
    The ->commit_pass2 function adds the intent item to the AIL and drops
    the refcount.  The one remaining refcount is now owned by the recovery
    mechanism (aka the log intent items in the AIL) with the intent of
    giving the refcount to the intent done item in the ->iop_recover
    function.

    However, if something fails later in recovery, xlog_recover_finish will
    walk the recovered intent items in the AIL and release them.  If the CIL
    hasn't been pushed before that point (which is possible since we don't
    force the log until later) then the intent done release will try to free
    its associated intent, which has already been freed.

    This patch starts to address this mess by having the ->commit_pass2
    functions recreate the xfs_defer_pending state.  The next few patches
    will fix the recovery functions.

    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2024-11-20 11:25:47 -06:00
Bill O'Donnell 4fd4eae40f xfs: reserve less log space when recovering log intent items
JIRA: https://issues.redhat.com/browse/RHEL-57114

commit 3c919b0910906cc69d76dea214776f0eac73358b
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Mon Sep 11 08:39:05 2023 -0700

    xfs: reserve less log space when recovering log intent items

    Wengang Wang reports that a customer's system was running a number of
    truncate operations on a filesystem with a very small log.  Contention
    on the reserve heads lead to other threads stalling on smaller updates
    (e.g.  mtime updates) long enough to result in the node being rebooted
    on account of the lack of responsivenes.  The node failed to recover
    because log recovery of an EFI became stuck waiting for a grant of
    reserve space.  From Wengang's report:

    "For the file deletion, log bytes are reserved basing on
    xfs_mount->tr_itruncate which is:

        tr_logres = 175488,
        tr_logcount = 2,
        tr_logflags = XFS_TRANS_PERM_LOG_RES,

    "You see it's a permanent log reservation with two log operations (two
    transactions in rolling mode).  After calculation (xlog_calc_unit_res()
    adds space for various log headers), the final log space needed per
    transaction changes from  175488 to 180208 bytes.  So the total log
    space needed is 360416 bytes (180208 * 2).  [That quantity] of log space
    (360416 bytes) needs to be reserved for both run time inode removing
    (xfs_inactive_truncate()) and EFI recover (xfs_efi_item_recover())."

    In other words, runtime pre-reserves 360K of space in anticipation of
    running a chain of two transactions in which each transaction gets a
    180K reservation.

    Now that we've allocated the transaction, we delete the bmap mapping,
    log an EFI to free the space, and roll the transaction as part of
    finishing the deferops chain.  Rolling creates a new xfs_trans which
    shares its ticket with the old transaction.  Next, xfs_trans_roll calls
    __xfs_trans_commit with regrant == true, which calls xlog_cil_commit
    with the same regrant parameter.

    xlog_cil_commit calls xfs_log_ticket_regrant, which decrements t_cnt and
    subtracts t_curr_res from the reservation and write heads.

    If the filesystem is fresh and the first transaction only used (say)
    20K, then t_curr_res will be 160K, and we give that much reservation
    back to the reservation head.  Or if the file is really fragmented and
    the first transaction actually uses 170K, then t_curr_res will be 10K,
    and that's what we give back to the reservation.

    Having done that, we're now headed into the second transaction with an
    EFI and 180K of reservation.  Other threads apparently consumed all the
    reservation for smaller transactions, such as timestamp updates.

    Now let's say the first transaction gets written to disk and we crash
    without ever completing the second transaction.  Now we remount the fs,
    log recovery finds the unfinished EFI, and calls xfs_efi_recover to
    finish the EFI.  However, xfs_efi_recover starts a new tr_itruncate
    tranasction, which asks for 360K log reservation.  This is a lot more
    than the 180K that we had reserved at the time of the crash.  If the
    first EFI to be recovered is also pinning the tail of the log, we will
    be unable to free any space in the log, and recovery livelocks.

    Wengang confirmed this:

    "Now we have the second transaction which has 180208 log bytes reserved
    too. The second transaction is supposed to process intents including
    extent freeing.  With my hacking patch, I blocked the extent freeing 5
    hours. So in that 5 hours, 180208 (NOT 360416) log bytes are reserved.

    "With my test case, other transactions (update timestamps) then happen.
    As my hacking patch pins the journal tail, those timestamp-updating
    transactions finally use up (almost) all the left available log space
    (in memory in on disk).  And finally the on disk (and in memory)
    available log space goes down near to 180208 bytes.  Those 180208 bytes
    are reserved by [the] second (extent-free) transaction [in the chain]."

    Wengang and I noticed that EFI recovery starts a transaction, completes
    one step of the chain, and commits the transaction without completing
    any other steps of the chain.  Those subsequent steps are completed by
    xlog_finish_defer_ops, which allocates yet another transaction to
    finish the rest of the chain.  That transaction gets the same tr_logres
    as the head transaction, but with tr_logcount = 1 to force regranting
    with every roll to avoid livelocks.

    In other words, we already figured this out in commit 929b92f640
    ("xfs: xfs_defer_capture should absorb remaining transaction
    reservation"), but should have applied that logic to each intent item's
    recovery function.  For Wengang's case, the xfs_trans_alloc call in the
    EFI recovery function should only be asking for a single transaction's
    worth of log reservation -- 180K, not 360K.

    Quoting Wengang again:

    "With log recovery, during EFI recovery, we use tr_itruncate again to
    reserve two transactions that needs 360416 log bytes.  Reserving 360416
    bytes fails [stalls] because we now only have about 180208 available.

    "Actually during the EFI recover, we only need one transaction to free
    the extents just like the 2nd transaction at RUNTIME.  So it only needs
    to reserve 180208 rather than 360416 bytes.  We have (a bit) more than
    180208 available log bytes on disk, so [if we decrease the reservation
    to 180K] the reservation goes and the recovery [finishes].  That is to
    say: we can fix the log recover part to fix the issue. We can introduce
    a new xfs_trans_res xfs_mount->tr_ext_free

    {
      tr_logres = 175488,
      tr_logcount = 0,
      tr_logflags = 0,
    }

    "and use tr_ext_free instead of tr_itruncate in EFI recover."

    However, I don't think it quite makes sense to create an entirely new
    transaction reservation type to handle single-stepping during log
    recovery.  Instead, we should copy the transaction reservation
    information in the xfs_mount, change tr_logcount to 1, and pass that
    into xfs_trans_alloc.  We know this won't risk changing the min log size
    computation since we always ask for a fraction of the reservation for
    all known transaction types.

    This looks like it's been lurking in the codebase since commit
    3d3c8b5222, which changed the xfs_trans_reserve call in
    xlog_recover_process_efi to use the tr_logcount in tr_itruncate.
    That changed the EFI recovery transaction from making a
    non-XFS_TRANS_PERM_LOG_RES request for one transaction's worth of log
    space to a XFS_TRANS_PERM_LOG_RES request for two transactions worth.

    Fixes: 3d3c8b5222 ("xfs: refactor xfs_trans_reserve() interface")
    Complements: 929b92f640 ("xfs: xfs_defer_capture should absorb remaining transaction reservation")
    Suggested-by: Wengang Wang <wen.gang.wang@oracle.com>
    Cc: Srikanth C S <srikanth.c.s@oracle.com>
    [djwong: apply the same transformation to all log intent recovery]
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2024-10-15 10:46:32 -05:00
Bill O'Donnell e208e0be52 xfs: convert buf_cancel_table allocation to kmalloc_array
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2167832

commit 910bbdf2f4d7df46781bc9b723048f5ebed3d0d7
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Fri May 27 10:27:19 2022 +1000

    xfs: convert buf_cancel_table allocation to kmalloc_array

    While we're messing around with how recovery allocates and frees the
    buffer cancellation table, convert the allocation to use kmalloc_array
    instead of the old kmem_alloc APIs, and make it handle a null return,
    even though that's not likely.

    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Dave Chinner <david@fromorbit.com>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2023-05-18 11:11:31 -05:00
Bill O'Donnell a245138396 xfs: refactor buffer cancellation table allocation
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2167832

commit 2723234923b3294dbcf6019c288c87465e927ed4
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Fri May 27 10:26:17 2022 +1000

    xfs: refactor buffer cancellation table allocation

    Move the code that allocates and frees the buffer cancellation tables
    used by log recovery into the file that actually uses the tables.  This
    is a precursor to some cleanups and a memory leak fix.

    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Dave Chinner <david@fromorbit.com>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2023-05-18 11:11:30 -05:00
Bill O'Donnell db4b5bf1ae xfs: Set up infrastructure for log attribute replay
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2167832

commit fd920008784ead369e79c2be2f8d9cc736e306ca
Author: Allison Henderson <allison.henderson@oracle.com>
Date:   Wed May 4 12:41:02 2022 +1000

    xfs: Set up infrastructure for log attribute replay

    Currently attributes are modified directly across one or more
    transactions. But they are not logged or replayed in the event of an
    error. The goal of log attr replay is to enable logging and replaying
    of attribute operations using the existing delayed operations
    infrastructure.  This will later enable the attributes to become part of
    larger multi part operations that also must first be recorded to the
    log.  This is mostly of interest in the scheme of parent pointers which
    would need to maintain an attribute containing parent inode information
    any time an inode is moved, created, or removed.  Parent pointers would
    then be of interest to any feature that would need to quickly derive an
    inode path from the mount point. Online scrub, nfs lookups and fs grow
    or shrink operations are all features that could take advantage of this.

    This patch adds two new log item types for setting or removing
    attributes as deferred operations.  The xfs_attri_log_item will log an
    intent to set or remove an attribute.  The corresponding
    xfs_attrd_log_item holds a reference to the xfs_attri_log_item and is
    freed once the transaction is done.  Both log items use a generic
    xfs_attr_log_format structure that contains the attribute name, value,
    flags, inode, and an op_flag that indicates if the operations is a set
    or remove.

    [dchinner: added extra little bits needed for intent whiteouts]

    Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
    Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Dave Chinner <david@fromorbit.com>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
2023-05-18 11:11:16 -05:00
Brian Foster 63abcca3f1 xfs: refactor xfs_iget calls from log intent recovery
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2083143
Upstream Status: linux.git

commit 4bc619833f738f4fa8d931a71610795ebf5cec0e
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Sun Aug 8 08:27:13 2021 -0700

    xfs: refactor xfs_iget calls from log intent recovery

    Hoist the code from xfs_bui_item_recover that igets an inode and marks
    it as being part of log intent recovery.  The next patch will want a
    common function.

    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
    Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>

Signed-off-by: Brian Foster <bfoster@redhat.com>
2022-08-25 08:11:25 -04:00
Christoph Hellwig 22c10589a1 xfs: remove xlog_recover_iodone
The log recovery I/O completion handler does not substancially differ from
the normal one except for the fact that it:

 a) never retries failed writes
 b) can have log items that aren't on the AIL
 c) never has inode/dquot log items attached and thus don't need to
    handle them

Add conditionals for (a) and (b) to the ioend code, while (c) doesn't
need special handling anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2020-09-15 20:52:39 -07:00
Darrick J. Wong 17d29bf271 xfs: move log recovery buffer cancellation code to xfs_buf_item_recover.c
Move the helpers that handle incore buffer cancellation records to
xfs_buf_item_recover.c since they're not directly related to the main
log recovery machinery.  No functional changes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-05-08 08:50:01 -07:00
Darrick J. Wong 154c733a33 xfs: refactor releasing finished intents during log recovery
Replace the open-coded AIL item walking with a proper helper when we're
trying to release an intent item that has been finished.  We add a new
->iop_match method to decide if an intent item matches a supplied ID.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-05-08 08:50:00 -07:00
Darrick J. Wong 1094d3f123 xfs: refactor log recovery buffer item dispatch for pass2 commit functions
Move the log buffer item pass2 commit code into the per-item source code
files and use the dispatch function to call it.  We do these one at a
time because there's a lot of code to move.  No functional changes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-05-08 08:49:58 -07:00
Darrick J. Wong 3304a4fabd xfs: refactor log recovery item dispatch for pass1 commit functions
Move the pass1 commit code into the per-item source code files and use
the dispatch function to call them.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-05-08 08:49:58 -07:00
Darrick J. Wong 8ea5682d07 xfs: refactor log recovery item dispatch for pass2 readhead functions
Move the pass2 readhead code into the per-item source code files and use
the dispatch function to call them.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-05-08 08:49:58 -07:00
Darrick J. Wong 86ffa471d9 xfs: refactor log recovery item sorting into a generic dispatch structure
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 <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-05-08 08:49:58 -07:00
Darrick J. Wong 35f4521fd3 xfs: convert xfs_log_recover_item_t to struct xfs_log_recover_item
Remove the old typedefs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-05-08 08:49:58 -07:00
Eric Sandeen 35dab307c8 xfs: remove unused typedef definitions
Remove some typdefs for type_t's that are no longer referred to
by their typedef'd types.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2019-11-13 18:22:40 -08:00
Dave Chinner 0b61f8a407 xfs: convert to SPDX license tags
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 <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2018-06-06 14:17:53 -07:00
Darrick J. Wong c8ce540db5 xfs: remove double-underscore integer types
This is a purely mechanical patch that removes the private
__{u,}int{8,16,32,64}_t typedefs in favor of using the system
{u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
the transformation and fix the resulting whitespace and indentation
errors:

s/typedef\t__uint8_t/typedef __uint8_t\t/g
s/typedef\t__uint/typedef __uint/g
s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
s/__uint8_t\t/__uint8_t\t\t/g
s/__uint/uint/g
s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
s/__int/int/g
/^typedef.*int[0-9]*_t;$/d

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2017-06-19 14:11:33 -07:00
Eric Sandeen 64f61ab604 xfs: remove unused struct declarations
After scratching my head looking for "xfs_busy_extent" I realized
it's not used; it's xfs_extent_busy, and the declaration for the
other name is bogus.  Remove that and a few others as well.

(struct xfs_log_callback is used, but the 2nd declaration is
unnecessary).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2017-01-30 16:32:25 -08:00
Darrick J. Wong 755c7bf5dd libxfs: convert ushort to unsigned short
Since xfsprogs dropped ushort in favor of unsigned short, do that
here too.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-11-08 11:55:48 +11:00
Brian Foster 6528250b71 xfs: support a crc verification only log record pass
Log recovery torn write detection uses CRC verification over a range of
the active log to identify torn writes. Since the generic log recovery
pass code implements a superset of the functionality required for CRC
verification, it can be easily modified to support a CRC verification
only pass.

Create a new CRC pass type and update the log record processing helper
to skip everything beyond CRC verification when in this mode. This pass
will be invoked in subsequent patches to implement torn write detection.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-01-04 15:55:10 +11:00
Dave Chinner 84be0ffc90 libxfs: move header files
Move all the header files that are shared with userspace into
libxfs. This is done as one big chunk simpy to get it done quickly.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-06-25 14:57:36 +10:00