public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Donald Douwsma <ddouwsma@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/5] xfsrestore: remove failing assert from noref_elim_recurse
Date: Mon, 23 Mar 2026 14:01:29 +1100	[thread overview]
Message-ID: <8cd00eed-58d1-4c34-8892-fff34504c2e1@redhat.com> (raw)
In-Reply-To: <20260224071712.1014075-5-ddouwsma@redhat.com>

On 24/2/26 18:17, Donald Douwsma wrote:
> We are getting reports from the field where cumulative restores are
> aborting due due to a failing assertion.
> 
>   xfsrestore: tree.c:1421: noref_elim_recurse: Assertion 'isrealpr' failed
> 
> This appears to be caused by a rename within the tree between restore
> levels, or a combination of modifications occurring during dump.
> Fixing it will likely require changes in noref_elim_recurse and
> tree_post, to ensure elements of the tree are created for these edge
> conditions. Given the state of xfsdump this is a bit risky for
> maintenance streams.

With some more digging it looks like this is triggered during subtree
restores. A cumulative restore started by excluding a specific subtree
with -s doesn't cause subsequent restores to prune the non subtree
sections from the restore.

This leads to the assert firing when in noref_elim_recurse when its
asked to handle a rename for a directory not created due to the
subtree restriction.

mkdir -p /mnt/scratch/dir1/dir2/dir3
mkdir -p /mnt/scratch/restore_me/dirA/dirB/dirC

xfsdump -L label -M media -l0 -f /tmp/l0.dump /mnt/scratch

mv /mnt/scratch/dir1/dir2 /mnt/scratch/dir10

xfsdump -L label -M media -l2 -f /tmp/l2.dump /mnt/scratch

dir=$(mktemp -d /mnt/scratch/dir_XXX)
xfsrestore -r -f /tmp/l0.dump -s restore_me $dir
xfsrestore -r -f /tmp/l2.dump $dir
## xfsrestore: tree.c:1369: noref_elim_recurse: Assertion `isrealpr' failed.

The subtree filter state was saved in the state file

[root@rhel8 ~]# hexdump -C /mnt/scratch/dir_ILX/xfsrestorehousekeepingdir/state | grep restore_me
00005010  72 65 73 74 6f 72 65 5f  6d 65 00 00 00 00 00 00  |restore_me......|
[root@rhel8 ~]# 


> While current builds have assert(3) active, remove this one allowing
> xfsrestore to continue, warning on failing renames for directory nodes
> that haven't been created. Once the full tree is built referenced
> directories will end up in the orphanage allowing for user recovery.

This didn't end up in the orphanage, which seems to suggest that the
subtree option had some affect.

[root@rhel8 xfsdump-dev]# restore/xfsrestore -r -f /tmp/l2.2.dump $dir
restore/xfsrestore: using file dump (drive_simple) strategy
restore/xfsrestore: version 3.2.0 (dump format 3.0) - type ^C for status and control
restore/xfsrestore: searching media for dump
restore/xfsrestore: examining media file 0
restore/xfsrestore: dump description: 
restore/xfsrestore: hostname: rhel8
restore/xfsrestore: mount point: /mnt/scratch
restore/xfsrestore: volume: /dev/vdc
restore/xfsrestore: session time: Mon Mar 23 13:25:57 2026
restore/xfsrestore: level: 2
restore/xfsrestore: session label: "label"
restore/xfsrestore: media label: "media"
restore/xfsrestore: file system id: cb6c9beb-45a7-42b4-b125-502ed787e4fb
restore/xfsrestore: session id: 3832f932-2b4f-4f87-841d-f071e4cb3a1c
restore/xfsrestore: media id: 58d8ce69-90a7-4164-901d-4a64a0f9ba69
restore/xfsrestore: using online session inventory
restore/xfsrestore: searching media for directory dump
restore/xfsrestore: reading directories
restore/xfsrestore: 16 directories and 21 entries processed
restore/xfsrestore: directory post-processing
restore/xfsrestore: WARNING: unable to rename dir dir1/dir2 to dir orphanage/67109056.572736669: No such file or directory
restore/xfsrestore: restore complete: 0 seconds elapsed
restore/xfsrestore: Restore Summary:
restore/xfsrestore:   stream 0 /tmp/l2.2.dump OK (success)
restore/xfsrestore: Restore Status: SUCCESS
[root@rhel8 xfsdump-dev]#

[root@rhel8 xfsdump-dev]# find $dir
/mnt/scratch/dir_P67
/mnt/scratch/dir_P67/xfsrestorehousekeepingdir
/mnt/scratch/dir_P67/xfsrestorehousekeepingdir/state
/mnt/scratch/dir_P67/xfsrestorehousekeepingdir/namreg
/mnt/scratch/dir_P67/xfsrestorehousekeepingdir/tree
/mnt/scratch/dir_P67/xfsrestorehousekeepingdir/dirextattr
/mnt/scratch/dir_P67/xfsrestorehousekeepingdir/dirattr
/mnt/scratch/dir_P67/restore_me
/mnt/scratch/dir_P67/restore_me/dirA
/mnt/scratch/dir_P67/restore_me/dirA/dirB
/mnt/scratch/dir_P67/restore_me/dirA/dirB/dirC
/mnt/scratch/dir_P67/restore_me/dirD
[root@rhel8 xfsdump-dev]# 

> 
> Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>
> ---
>  restore/tree.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/restore/tree.c b/restore/tree.c
> index bf89c6a..81666ac 100644
> --- a/restore/tree.c
> +++ b/restore/tree.c
> @@ -1404,12 +1404,13 @@ noref_elim_recurse(nh_t parh,
>  				Node_free(&cldh);
>  			}
>  
> +			/* Process renames for directories that have been created.
> +			 */
>  			if (isrenamepr) {
>  				nrh_t nrh;
>  				node_t *renamep;
>  
>  				assert(isrefpr);
> -				assert(isrealpr);
>  				ok = Node2path(cldh,
>  						path1,
>  						_("tmp dir rename src"));


  reply	other threads:[~2026-03-23  3:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24  7:17 [PATCH 0/5] xfsdump, xfsprogs distro builds and DEBUG= Donald Douwsma
2026-02-24  7:17 ` [PATCH 1/5] xfsrestore: remove unused variable strctxp Donald Douwsma
2026-02-24  7:17 ` [PATCH 2/5] annotate variables only used for assert Donald Douwsma
2026-02-24  7:17 ` [PATCH 3/5] xfsrestore: include TREE_DEBUG all builds Donald Douwsma
2026-02-24  7:17 ` [PATCH 4/5] xfsrestore: remove failing assert from noref_elim_recurse Donald Douwsma
2026-03-23  3:01   ` Donald Douwsma [this message]
2026-02-24  7:17 ` [PATCH 5/5] xfsrestore: assert suppression workaround Donald Douwsma
2026-03-13 13:12 ` [PATCH 0/5] xfsdump, xfsprogs distro builds and DEBUG= Andrey Albershteyn
2026-03-23  1:48   ` Donald Douwsma

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=8cd00eed-58d1-4c34-8892-fff34504c2e1@redhat.com \
    --to=ddouwsma@redhat.com \
    --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