From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: eguan@redhat.com, linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 3/4] xfs: test rmapbt updates are correct with insert/collapse range
Date: Wed, 30 Aug 2017 15:58:25 -0700 [thread overview]
Message-ID: <20170830225825.GD4754@magnolia> (raw)
In-Reply-To: <20170830075321.GC4711@infradead.org>
On Wed, Aug 30, 2017 at 12:53:21AM -0700, Christoph Hellwig wrote:
> On Tue, Aug 29, 2017 at 09:41:02PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Make sure that we update the rmapbt correctly when we collapse-range a
> > file and the extents on both sides of the hole can be merged. We can
> > construct this pretty trivially with insert-range and write, so test
> > that too.
>
> Does this break on the current tree? From code inspection I suspect
> the current code is doing the wrong thing there.
AFAICR the existing rmap code in bmse_shift_one /does/ work, though only
due to the subtlety that xfs_rmap_{,un}map_extent is smart enough to
automatically merge and unmerge rmap extents for you.
Hence if you have the following:
AAAAABBBAAAAAAAA
Where both A's could be merged after BBB goes away:
AAAAAAAAAAAAA---
The deferred rmap code will merge the two A regions into a single rmap
extent record automatically.
Hmm, so I guess that means that in the patch "xfs: use xfs_iext_*_extent
helpers in xfs_bmap_shift_extents" you can replace the three xfs_rmap
calls in xfs_bmse_merge with:
/* update reverse mapping */
error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, got);
if (error)
return error;
memcpy(&new, got, sizeof(new));
new.br_startoff = left->br_startoff + left->br_blockcount;
return xfs_rmap_map_extent(mp, dfops, ip, whichfork, &new);
...which saves us a deferred op. Ok, will propose that in the actual
thread.
> > +./src/punch-alternating -o $((16 * blksz / file_blksz)) \
>
> Shouldn't we always use $here/src/progname ?
Ok, I didn't realize that. There are a lot of programs that still use ./src....
--D
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-08-30 22:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-30 4:40 [PATCH 1/4] xfs/{319,323}: don't checksum files after log recovery Darrick J. Wong
2017-08-30 4:40 ` [PATCH 2/4] xfs/013: exit cleaner thread if fsstress dies Darrick J. Wong
2017-08-30 7:51 ` Christoph Hellwig
2017-08-30 4:41 ` [PATCH 3/4] xfs: test rmapbt updates are correct with insert/collapse range Darrick J. Wong
2017-08-30 7:53 ` Christoph Hellwig
2017-08-30 22:58 ` Darrick J. Wong [this message]
2017-08-31 10:28 ` Eryu Guan
2017-08-31 14:47 ` [PATCH v2 " Darrick J. Wong
2017-08-30 4:41 ` [PATCH 4/4] generic: try various unicode normalization games Darrick J. Wong
2017-08-30 22:52 ` [PATCH v2 " Darrick J. Wong
2017-08-30 22:31 ` [PATCH 5/4] generic/173: don't dump core when mwrite fails Darrick J. Wong
2017-08-30 22:31 ` [PATCH 6/4] common/rc: fix xfs_io scrub command existence test Darrick J. Wong
2017-08-30 22:32 ` [PATCH 7/4] xfs/122: fix the size of fsop_ag_resblks structure Darrick J. Wong
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=20170830225825.GD4754@magnolia \
--to=darrick.wong@oracle.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox