Compare commits

...

No commits in common. "c8" and "c8-beta" have entirely different histories.
c8 ... c8-beta

4 changed files with 8 additions and 154 deletions

View File

@ -15,12 +15,14 @@ Signed-off-by: Pavel Reichl <preichl@redhat.com>
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/restore/content.c b/restore/content.c
index b19bb90..8bb5fa4 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -5468,19 +5468,16 @@ pi_addfile( Media_t *Mediap,
@@ -5467,18 +5467,14 @@
/* ask inventory to convert buffer into session
* desc.
*/
sessp = 0;
- sessp = 0;
- if ( ! buflen ) {
- ok = BOOL_FALSE;
- } else {
@ -36,14 +38,10 @@ diff --git a/restore/content.c b/restore/content.c
ok = BOOL_TRUE;
- }
}
- if ( ! ok || ! sessp ) {
- mlog( MLOG_DEBUG | MLOG_WARNING | MLOG_MEDIA, _(
+
+ if (!ok || !sessp) {
+ mlog(MLOG_DEBUG | MLOG_WARNING | MLOG_MEDIA, _(
if ( ! ok || ! sessp ) {
mlog( MLOG_DEBUG | MLOG_WARNING | MLOG_MEDIA, _(
"on-media session "
"inventory corrupt\n") );
} else {
--
2.47.3
2.41.0

View File

@ -1,57 +0,0 @@
From 8e97f9c2b3c362fa6dd872d72594713c713479bc Mon Sep 17 00:00:00 2001
From: Donald Douwsma <ddouwsma@redhat.com>
Date: Thu, 24 Aug 2023 12:07:04 +1000
Subject: [PATCH] xfsrestore: suggest -x rather than assert for false roots
If we're going to have a fix for false root problems its a good idea to
let people know that there's a way to recover, error out with a useful
message that mentions the `-x` option rather than just assert.
Before
xfsrestore: searching media for directory dump
xfsrestore: reading directories
xfsrestore: tree.c:757: tree_begindir: Assertion `ino != persp->p_rootino || hardh == persp->p_rooth' failed.
Aborted
After
xfsrestore: ERROR: tree.c:791: tree_begindir: Assertion `ino != persp->p_rootino || hardh == persp->p_rooth` failed.
xfsrestore: ERROR: False root detected. Recovery may be possible using the `-x` option
Aborted
Fixes: d7cba7410710 ("xfsrestore: fix rootdir due to xfsdump bulkstat misuse")
Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
restore/tree.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/restore/tree.c b/restore/tree.c
index bfa07fe..6f3180f 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -783,8 +783,15 @@ tree_begindir( filehdr_t *fhdrp, dah_t *dahp )
/* lookup head of hardlink list
*/
hardh = link_hardh( ino, gen );
- if (need_fixrootdir == BOOL_FALSE)
- assert( ino != persp->p_rootino || hardh == persp->p_rooth );
+ if (need_fixrootdir == BOOL_FALSE &&
+ !(ino != persp->p_rootino || hardh == persp->p_rooth)) {
+ mlog(MLOG_ERROR | MLOG_TREE,
+"%s:%d: %s: Assertion `ino != persp->p_rootino || hardh == persp->p_rooth` failed.\n",
+ __FILE__, __LINE__, __func__);
+ mlog(MLOG_ERROR | MLOG_TREE, _(
+"False root detected. Recovery may be possible using the `-x` option\n"));
+ return NH_NULL;
+ }
/* already present
*/
--
2.41.0

View File

@ -1,75 +0,0 @@
From dd63de5d42e1073c09314fb1afc82c55e91c2853 Mon Sep 17 00:00:00 2001
From: Donald Douwsma <ddouwsma@redhat.com>
Date: Thu, 26 Mar 2026 13:54:43 +1100
Subject: [PATCH] xfsrestore: only process subtrees that are selected
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>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
---
restore/tree.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/restore/tree.c b/restore/tree.c
index 0eb9fa3..44a46ea 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -1278,6 +1278,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;
@@ -1291,10 +1292,11 @@ noref_elim_recurse( nh_t parh,
ino = cldp->n_ino;
gen = cldp->n_gen;
inorphanagepr = cldp->n_parh == persp->p_orphh;
- isdirpr = ( cldp->n_flags & NF_ISDIR );
- isrealpr = ( cldp->n_flags & NF_REAL );
- isrefpr = ( cldp->n_flags & NF_REFED );
- isrenamepr = ( isdirpr && cldp->n_lnkh != NH_NULL );
+ 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;
nextcldh = cldp->n_sibh;
@@ -1309,7 +1311,12 @@ noref_elim_recurse( nh_t parh,
Node_unmap( cldh, &cldp );
- if ( isdirpr ) {
+ if (!isselpr) {
+ cldh = nextcldh;
+ continue;
+ }
+
+ if (isdirpr) {
bool_t ok;
ok = noref_elim_recurse( cldh,
--
2.47.3

View File

@ -1,7 +1,7 @@
Summary: Administrative utilities for the XFS filesystem
Name: xfsdump
Version: 3.1.8
Release: 8%{?dist}
Release: 6%{?dist}
# Licensing based on generic "GNU GENERAL PUBLIC LICENSE"
# in source, with no mention of version.
License: GPL+
@ -16,8 +16,6 @@ Patch4: 0005-v3.1.12-xfsrestore-fix-on-media-inventory-media-unpacking.patch
Patch5: 0006-v3.1.12-xfsrestore-fix-on-media-inventory-stream-unpacking.patch
Patch6: 0007-v3.1.12-xfsdump-fix-on-media-inventory-stream-packing.patch
Patch7: 0008-v3.1.12-xfsrestore-untangle-inventory-unpacking-logic.patch
Patch8: 0009-v3.1.13-xfsrestore-suggest-x-rather-than-assert-for-false-ro.patch
Patch9: 0010-v3.3.0-xfsrestore-only-process-subtrees-that-are-selected.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libtool, gettext, gawk
BuildRequires: xfsprogs-devel, libuuid-devel, libattr-devel ncurses-devel
@ -50,8 +48,6 @@ subtrees may be restored from full or partial backups.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%build
%configure
@ -85,14 +81,6 @@ rm -rf $RPM_BUILD_ROOT
%{_sharedstatedir}/xfsdump/inventory
%changelog
* Tue Jun 2 2026 Donald Douwsma <ddouwsma@redhat.com> - 3.1.8-8
- xfsrestore: only process subtrees that are selected
- Related: RHEL-31075, RHEL-179062
* Thu Oct 05 2023 Pavel Reichl <preichl@redhat.com> - 3.1.8-7
- xfsdump/xfsrestore: suggest recovery for false roots may be possible using -x
- Related: RHEL-11883
* Tue Jun 20 2023 Pavel Reichl <preichl@redhat.com> - 3.1.8-6
- xfsdump: restoring inventory prevents non-directory files being restored from tape
- related: bz#2166554