All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH] xfs/444: test log replay after XFS_IOC_SWAPEXT
Date: Fri, 23 Feb 2018 15:21:15 -0800	[thread overview]
Message-ID: <20180223232115.GJ5221@magnolia> (raw)
In-Reply-To: <4b4550ca-4c2a-2e5f-d49e-2b084d3c90f6@sandeen.net>

On Fri, Feb 23, 2018 at 04:58:30PM -0600, Eric Sandeen wrote:
> 
> 
> On 2/23/18 3:54 PM, Darrick J. Wong wrote:
> > On Fri, Feb 23, 2018 at 12:33:41PM -0600, Eric Sandeen wrote:
> >> This is a mashup of xfs/042 and some of the log replay tests;
> >> it checks whether the log can be replayed if we crash immediately
> >> after an xfs_fsr / XFS_IOC_SWAPEXT.
> >>
> >> Hint: it can't.  It fails because the temporary donor inode has
> >> been deleted and has invalid mode 0 when we try to replay its
> >> swapext operation.  Kernel patches to fix it will follow soon.
> > 
> > Hmm, does this filesystem have rmap enabled or not?
> 
> Not when I tested it.  I can try with it.
> 
> > Different swapext strategy in play depending on the answer to that
> > question.
> 
> Hm, ok.
> 
> 
> > Maybe I should wait for patches to show up. :P
> 
> Something like this, with a better comment, and also skipping
> XFS_ILOG_[DA]OWNER on replay if mode == 0 to catch it on an
> upgrade if needed.
> 
> diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
> index 26f2413..72a0223 100644
> --- a/fs/xfs/xfs_inode_item.c
> +++ b/fs/xfs/xfs_inode_item.c
> @@ -436,6 +436,12 @@ xfs_inode_item_format(
>  			~(XFS_ILOG_ADATA | XFS_ILOG_ABROOT | XFS_ILOG_AEXT);
>  	}
>  
> +	/* If this inode has been deleted do not try to recover swapext */
> +	if (VFS_I(ip)->i_mode == 0) {
> +		ilf->ilf_fields &= ~(XFS_ILOG_DOWNER | XFS_ILOG_AOWNER);
> +		iip->ili_fields &= ~(XFS_ILOG_DOWNER | XFS_ILOG_AOWNER);

Definitely the !rmap case then, since rmap swapext uses defer_ops
to move the extents instead of [AD]OWNER.

--D

> +	}
> +
>  	/* update the format with the exact fields we actually logged */
>  	ilf->ilf_fields |= (iip->ili_fields & ~XFS_ILOG_TIMESTAMP);
>  }

  reply	other threads:[~2018-02-23 23:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 18:33 [PATCH] xfs/444: test log replay after XFS_IOC_SWAPEXT Eric Sandeen
2018-02-23 21:54 ` Darrick J. Wong
2018-02-23 22:58   ` Eric Sandeen
2018-02-23 23:21     ` Darrick J. Wong [this message]
2018-02-26 13:02 ` Brian Foster
2018-03-23 18:47   ` Eric Sandeen
2018-03-23 19:00     ` Eric Sandeen
2018-03-23 19:09     ` Brian Foster
2018-03-23 22:47   ` Eric Sandeen
2018-03-26 12:32     ` Brian Foster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180223232115.GJ5221@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.