Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] xfsrestore: only process subtrees that are selected
@ 2026-03-26  2:54 Donald Douwsma
  2026-03-26  3:00 ` [PATCH] xfs: test xfsdump subtree restores Donald Douwsma
  2026-05-05 17:12 ` [PATCH] xfsrestore: only process subtrees that are selected Andrey Albershteyn
  0 siblings, 2 replies; 5+ messages in thread
From: Donald Douwsma @ 2026-03-26  2:54 UTC (permalink / raw)
  To: linux-xfs; +Cc: Donald Douwsma

We are getting reports from the field where xfsrestore is aborting due
to the failed assertion:

  # xfsrestore -r -f /tmp/l0.dump -s somedir /mnt/scratch
  ...
  # xfsrestore -r -f /tmp/l2.dump /mnt/scratch
  ...
  xfsrestore: 8 directories and 7 entries processed
  xfsrestore: directory post-processing
  xfsrestore: tree.c:1369: noref_elim_recurse: Assertion `isrealpr' failed.

This occurs for cumulative restores where the initial restore has used
the subtree option to limit the trees being restored. If a subsequent
restore encounters a rename for a node outside of the selected trees it
aborts when It cannot find the directory to rename.

Make sure we skip processing for directories outside the selected trees
when eliminating unreferenced nodes in tree post processing.

Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>
---
 restore/tree.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/restore/tree.c b/restore/tree.c
index 4e7cf7b..91c5e9d 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -1321,6 +1321,7 @@ noref_elim_recurse(nh_t parh,
 		gen_t gen;
 		bool_t inorphanagepr;
 		bool_t isdirpr;
+		bool_t isselpr;
 		bool_t isrealpr;
 		bool_t isrefpr;
 		bool_t isrenamepr;
@@ -1337,6 +1338,7 @@ noref_elim_recurse(nh_t parh,
 		isdirpr = (cldp->n_flags & NF_ISDIR);
 		isrealpr = (cldp->n_flags & NF_REAL);
 		isrefpr = (cldp->n_flags & NF_REFED);
+		isselpr = (cldp->n_flags & NF_SUBTREE);
 		isrenamepr = (isdirpr && cldp->n_lnkh != NH_NULL);
 		renameh = cldp->n_lnkh;
 		grandcldh = cldp->n_cldh;
@@ -1352,6 +1354,11 @@ noref_elim_recurse(nh_t parh,
 
 		Node_unmap(cldh, &cldp);
 
+		if (!isselpr) {
+			cldh = nextcldh;
+			continue;
+		}
+
 		if (isdirpr) {
 			bool_t ok;
 
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-07 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26  2:54 [PATCH] xfsrestore: only process subtrees that are selected Donald Douwsma
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-05 17:12 ` [PATCH] xfsrestore: only process subtrees that are selected Andrey Albershteyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox