* [PATCH] xfs: test xfsdump subtree restores [not found] <20260326025443.1569874-1-ddouwsma@redhat.com> @ 2026-03-26 3:00 ` Donald Douwsma 2026-05-05 17:12 ` Andrey Albershteyn 2026-05-07 16:59 ` Zorro Lang 0 siblings, 2 replies; 4+ messages in thread From: Donald Douwsma @ 2026-03-26 3:00 UTC (permalink / raw) To: fstests, linux-xfs; +Cc: Donald Douwsma Regression test for cumulative restores where a directory has been renamed outside of the subtree being restored triggering the assert: xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed Signed-off-by: Donald Douwsma <ddouwsma@redhat.com> --- tests/xfs/995 | 51 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/995.out | 2 ++ 2 files changed, 53 insertions(+) create mode 100755 tests/xfs/995 create mode 100644 tests/xfs/995.out diff --git a/tests/xfs/995 b/tests/xfs/995 new file mode 100755 index 00000000..54172572 --- /dev/null +++ b/tests/xfs/995 @@ -0,0 +1,51 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2026 Red Hat. All Rights Reserved. +# +# FS QA Test 995 +# +# Regression test for cumulative restores where a directory has been +# renamed outside of the subtree being restored resulting in +# +# xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed +# +. ./common/preamble +_begin_fstest auto dump + +_fixed_by_git_commit xfsdump XXXXXXX \ + "xfsrestore: only process subtrees that are selected" + +# Override the default cleanup function. +_cleanup() +{ + _cleanup_dump + cd / + rm -r -f $tmp.* +} + +# Import common functions. +. ./common/dump + +# Modify as appropriate. +_require_scratch +_scratch_mkfs_xfs >>$seqres.full +_scratch_mount + +mkdir -p $SCRATCH_MNT/a/b/c/d/e/f/g +mkdir -p $SCRATCH_MNT/restore_me/B/C/D/E/F/G + +_do "$XFSDUMP_PROG -L "lab_l0" -M "test" -l0 -f $tmp.dump.l0 $SCRATCH_MNT" + +mv $SCRATCH_MNT/a/b/c $SCRATCH_MNT/1 + +_do "$XFSDUMP_PROG -L "lab_l2" -M "test" -l2 -f $tmp.dump.l2 $SCRATCH_MNT" + +dir=$(mktemp -d $SCRATCH_MNT/restore_XXX) +_do "$XFSRESTORE_PROG -f $tmp.dump.l0 -r -s restore_me $dir" +_do "$XFSRESTORE_PROG -f $tmp.dump.l2 -r $dir" + +test $? -ne 0 && exit + +echo Silence is golden +# success, all done +_exit 0 diff --git a/tests/xfs/995.out b/tests/xfs/995.out new file mode 100644 index 00000000..776fa6f2 --- /dev/null +++ b/tests/xfs/995.out @@ -0,0 +1,2 @@ +QA output created by 995 +Silence is golden -- 2.47.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: test xfsdump subtree restores 2026-03-26 3:00 ` [PATCH] xfs: test xfsdump subtree restores Donald Douwsma @ 2026-05-05 17:12 ` Andrey Albershteyn 2026-05-07 16:59 ` Zorro Lang 1 sibling, 0 replies; 4+ messages in thread From: Andrey Albershteyn @ 2026-05-05 17:12 UTC (permalink / raw) To: Donald Douwsma; +Cc: fstests, linux-xfs On 2026-03-26 14:00:12, Donald Douwsma wrote: > Regression test for cumulative restores where a directory has been > renamed outside of the subtree being restored triggering the assert: > > xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed > > Signed-off-by: Donald Douwsma <ddouwsma@redhat.com> Looks good to me Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org> -- - Andrey ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: test xfsdump subtree restores 2026-03-26 3:00 ` [PATCH] xfs: test xfsdump subtree restores Donald Douwsma 2026-05-05 17:12 ` Andrey Albershteyn @ 2026-05-07 16:59 ` Zorro Lang 2026-05-21 3:53 ` Donald Douwsma 1 sibling, 1 reply; 4+ messages in thread From: Zorro Lang @ 2026-05-07 16:59 UTC (permalink / raw) To: Donald Douwsma; +Cc: fstests, linux-xfs On Thu, Mar 26, 2026 at 02:00:12PM +1100, Donald Douwsma wrote: > Regression test for cumulative restores where a directory has been > renamed outside of the subtree being restored triggering the assert: > > xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed > > Signed-off-by: Donald Douwsma <ddouwsma@redhat.com> > --- > tests/xfs/995 | 51 +++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/995.out | 2 ++ > 2 files changed, 53 insertions(+) > create mode 100755 tests/xfs/995 > create mode 100644 tests/xfs/995.out > > diff --git a/tests/xfs/995 b/tests/xfs/995 > new file mode 100755 > index 00000000..54172572 > --- /dev/null > +++ b/tests/xfs/995 > @@ -0,0 +1,51 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2026 Red Hat. All Rights Reserved. > +# > +# FS QA Test 995 > +# > +# Regression test for cumulative restores where a directory has been > +# renamed outside of the subtree being restored resulting in > +# > +# xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed > +# > +. ./common/preamble > +_begin_fstest auto dump > + > +_fixed_by_git_commit xfsdump XXXXXXX \ > + "xfsrestore: only process subtrees that are selected" > + > +# Override the default cleanup function. > +_cleanup() > +{ > + _cleanup_dump > + cd / > + rm -r -f $tmp.* > +} > + > +# Import common functions. > +. ./common/dump > + > +# Modify as appropriate. > +_require_scratch > +_scratch_mkfs_xfs >>$seqres.full > +_scratch_mount > + > +mkdir -p $SCRATCH_MNT/a/b/c/d/e/f/g > +mkdir -p $SCRATCH_MNT/restore_me/B/C/D/E/F/G > + > +_do "$XFSDUMP_PROG -L "lab_l0" -M "test" -l0 -f $tmp.dump.l0 $SCRATCH_MNT" > + > +mv $SCRATCH_MNT/a/b/c $SCRATCH_MNT/1 > + > +_do "$XFSDUMP_PROG -L "lab_l2" -M "test" -l2 -f $tmp.dump.l2 $SCRATCH_MNT" > + > +dir=$(mktemp -d $SCRATCH_MNT/restore_XXX) > +_do "$XFSRESTORE_PROG -f $tmp.dump.l0 -r -s restore_me $dir" > +_do "$XFSRESTORE_PROG -f $tmp.dump.l2 -r $dir" Hi Donald, I almost forgot we had this _do helper :) I think your test target is the 2nd xfsrestore command line (about incremental changes), a comment might be good. I saw used four _do calls here. I just checked the logic of the _do helper, I suspect your current usage might prevent the test from catching command failures, allowing it to 'successfully' continue... A simple fix would be adding a "note" as a first argument to each _do helper call, e.g: _do "Full dump" "$XFSDUMP_PROG ..." Once all four calls are updated this way, we can remove the "test $? -ne 0 && exit" lines too, and rely on golden image matching to detect any failures. What do you think? Thanks, Zorro > + > +test $? -ne 0 && exit > + > +echo Silence is golden > +# success, all done > +_exit 0 > diff --git a/tests/xfs/995.out b/tests/xfs/995.out > new file mode 100644 > index 00000000..776fa6f2 > --- /dev/null > +++ b/tests/xfs/995.out > @@ -0,0 +1,2 @@ > +QA output created by 995 > +Silence is golden > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: test xfsdump subtree restores 2026-05-07 16:59 ` Zorro Lang @ 2026-05-21 3:53 ` Donald Douwsma 0 siblings, 0 replies; 4+ messages in thread From: Donald Douwsma @ 2026-05-21 3:53 UTC (permalink / raw) To: fstests, linux-xfs G'day Zorro, On 8/5/26 02:59, Zorro Lang wrote: > On Thu, Mar 26, 2026 at 02:00:12PM +1100, Donald Douwsma wrote: >> Regression test for cumulative restores where a directory has been >> renamed outside of the subtree being restored triggering the assert: >> >> xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed >> >> Signed-off-by: Donald Douwsma <ddouwsma@redhat.com> >> --- >> tests/xfs/995 | 51 +++++++++++++++++++++++++++++++++++++++++++++++ >> tests/xfs/995.out | 2 ++ >> 2 files changed, 53 insertions(+) >> create mode 100755 tests/xfs/995 >> create mode 100644 tests/xfs/995.out >> >> diff --git a/tests/xfs/995 b/tests/xfs/995 >> new file mode 100755 >> index 00000000..54172572 >> --- /dev/null >> +++ b/tests/xfs/995 >> @@ -0,0 +1,51 @@ >> +#! /bin/bash >> +# SPDX-License-Identifier: GPL-2.0 >> +# Copyright (c) 2026 Red Hat. All Rights Reserved. >> +# >> +# FS QA Test 995 >> +# >> +# Regression test for cumulative restores where a directory has been >> +# renamed outside of the subtree being restored resulting in >> +# >> +# xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed >> +# >> +. ./common/preamble >> +_begin_fstest auto dump >> + >> +_fixed_by_git_commit xfsdump XXXXXXX \ >> + "xfsrestore: only process subtrees that are selected" >> + >> +# Override the default cleanup function. >> +_cleanup() >> +{ >> + _cleanup_dump >> + cd / >> + rm -r -f $tmp.* >> +} >> + >> +# Import common functions. >> +. ./common/dump >> + >> +# Modify as appropriate. >> +_require_scratch >> +_scratch_mkfs_xfs >>$seqres.full >> +_scratch_mount >> + >> +mkdir -p $SCRATCH_MNT/a/b/c/d/e/f/g >> +mkdir -p $SCRATCH_MNT/restore_me/B/C/D/E/F/G >> + >> +_do "$XFSDUMP_PROG -L "lab_l0" -M "test" -l0 -f $tmp.dump.l0 $SCRATCH_MNT" >> + >> +mv $SCRATCH_MNT/a/b/c $SCRATCH_MNT/1 >> + >> +_do "$XFSDUMP_PROG -L "lab_l2" -M "test" -l2 -f $tmp.dump.l2 $SCRATCH_MNT" >> + >> +dir=$(mktemp -d $SCRATCH_MNT/restore_XXX) >> +_do "$XFSRESTORE_PROG -f $tmp.dump.l0 -r -s restore_me $dir" >> +_do "$XFSRESTORE_PROG -f $tmp.dump.l2 -r $dir" > > Hi Donald, > > I almost forgot we had this _do helper :) > > I think your test target is the 2nd xfsrestore command line (about incremental > changes), a comment might be good. Ack > I saw used four _do calls here. I just checked the logic of the _do helper, I > suspect your current usage might prevent the test from catching command failures, > allowing it to 'successfully' continue... *sigh* thanks for pointing this out, I switched to using _do for the ease of redirecting to seqres.full. I found having the full output available was useful when investigating (coupled with adding -v tree=debug). I couldn't figure out why my failing test started succeeding even though it aborted, which is why i added the test. The second two are a duplicate, earlier I had a bunch more cases, including restoring without -s, and restoring the l2 dump on its own, must have fumbled a cut-n-pasta, I'll revise to cover these edge cases. > A simple fix would be adding a "note" as a first argument to each _do helper call, > e.g: > _do "Full dump" "$XFSDUMP_PROG ..." > Once all four calls are updated this way, we can remove the "test $? -ne 0 && exit" > lines too, and rely on golden image matching to detect any failures. What do you > think? Once i fix _do the coredump control may start working again, in which case we'd see a failure with "[dumped core]". Don > >> + >> +test $? -ne 0 && exit >> + >> +echo Silence is golden >> +# success, all done >> +_exit 0 >> diff --git a/tests/xfs/995.out b/tests/xfs/995.out >> new file mode 100644 >> index 00000000..776fa6f2 >> --- /dev/null >> +++ b/tests/xfs/995.out >> @@ -0,0 +1,2 @@ >> +QA output created by 995 >> +Silence is golden >> -- >> 2.47.3 >> >> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-21 3:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260326025443.1569874-1-ddouwsma@redhat.com>
2026-03-26 3:00 ` [PATCH] xfs: test xfsdump subtree restores Donald Douwsma
2026-05-05 17:12 ` Andrey Albershteyn
2026-05-07 16:59 ` Zorro Lang
2026-05-21 3:53 ` Donald Douwsma
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox