On Fri, Jun 03, 2022 at 12:55:04PM +0800, Zorro Lang wrote: > On Thu, Jun 02, 2022 at 07:43:21PM -0700, Darrick J. Wong wrote: > > On Fri, Jun 03, 2022 at 11:41:12AM +1000, Dave Chinner wrote: > > > From: Allison Henderson <allison.henderson@xxxxxxxxxx> > > > > > > This patch adds tests to exercise the log attribute error > > > inject and log replay. These tests aim to cover cases where attributes > > > are added, removed, and overwritten in each format (shortform, leaf, > > > node). Error inject is used to replay these operations from the log. > > > > > > dchinner: sanitise md5sum input to just attr values. > > > dchinner: correct md5sums. > > > dchinner: ensure replace tests use different values so recovery can > > > determine the replace was replayed correctly. > > > dchinner: don't remove corpse in _cleanup - scratch devices don't > > > require cleanup, and if the test fails we want to leave > > > the broken state for post-mortem analysis. > > > dchinner: only run on v5 filesystems. > > > > > > Signed-off-by: Allison Henderson <allison.henderson@xxxxxxxxxx> > > > Signed-off-by: Catherine Hoang <catherine.hoang@xxxxxxxxxx> > > > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx> > > > --- > > > V2: > > > - redirected attr get failure messages to /dev/null rather than > > > have to filter them. The md5sum tells us that the attr didn't > > > exist. > > > > > > tests/xfs/600 | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > tests/xfs/600.out | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > > 2 files changed, 347 insertions(+) > > > > > > diff --git a/tests/xfs/600 b/tests/xfs/600 > > > new file mode 100755 > > > index 00000000..bc9415ec > > > --- /dev/null > > > +++ b/tests/xfs/600 > > > @@ -0,0 +1,179 @@ > > > +#! /bin/bash > > > +# SPDX-License-Identifier: GPL-2.0 > > > +# Copyright (c) 2022, Oracle and/or its affiliates. All Rights Reserved. > > > +# > > > +# FS QA Test 600 > > > +# > > > +# Log attribute replay test > > > +# > > > +. ./common/preamble > > > +_begin_fstest auto quick attr > > > + > > > +# get standard environment, filters and checks > > > +. ./common/filter > > > +. ./common/attr > > > +. ./common/inject > > > + > > > +_cleanup() > > > +{ > > > + rm -rf $tmp.* > > > + test -w /sys/fs/xfs/debug/larp && \ > > > + echo 0 > /sys/fs/xfs/debug/larp > > > > Probably ought to restore the old value, but otherwise the logic in here > > looks solid enough. > > I can help that when I merge it this week. > > BTW, I saw the "[PATCH 00/15] xfs: Log Attribute Replay" patchset has been > merged by mainline linux. So I suspose it's time to merge this patch. Please > tell me if it's still not the time. As I know there's not only one patchset > is related with this. I wanted it merged two weeks ago because we merged LARP into the XFS for-next tree a month ago. We need tests merged when the changes go into the for-next tree, not when the for-next tree gets merged into Linus's tree weeks later.... > And I'll really appreciate that, if any of you would like to list all related > patchset titles (from kernel and userspace) to help this case test pass :) I'm not going to attempt to find the 6 or 7 patchset and list them. They are all merged into 5.19, so use that kernel. For userspace, use the libxfs-5.19-sync branch I pushed out earlier in the week: https://lore.kernel.org/linux-xfs/20220601010636.GC227878@xxxxxxxxxxxxxxxxxxx/T/#u That contains all the 5.19 kernel changes and the userspace support for large extent counters and LARP, including all the error injection stuff that the various tests use. Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx