Blame SOURCES/0006-xfsrestore-untangle-inventory-unpacking-logic.patch

4c97d8
From aaaa57f32a605e4ebd2e4230fe036afc009ae0a0 Mon Sep 17 00:00:00 2001
4c97d8
From: Donald Douwsma <ddouwsma@redhat.com>
4c97d8
Date: Fri, 14 Oct 2022 18:58:47 +1100
4c97d8
Subject: [PATCH 6/7] xfsrestore: untangle inventory unpacking logic
4c97d8
4c97d8
stobj_unpack_sessinfo returns bool_t, fix logic in pi_addfile so errors
4c97d8
can be properly reported.
4c97d8
4c97d8
Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>
4c97d8
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
4c97d8
Signed-off-by: Carlos Maiolino <cem@kernel.org>
4c97d8
---
4c97d8
4c97d8
diff --git a/restore/content.c b/restore/content.c
4c97d8
index b19bb90..8bb5fa4 100644
4c97d8
--- a/restore/content.c
4c97d8
+++ b/restore/content.c
4c97d8
@@ -5461,17 +5461,14 @@ pi_addfile( Media_t *Mediap,
4c97d8
 			 * desc.
4c97d8
 			 */
4c97d8
 			sessp = 0;
4c97d8
-			if ( ! buflen ) {
4c97d8
-				ok = BOOL_FALSE;
4c97d8
-			} else {
4c97d8
-			    /* extract the session information from the buffer */
4c97d8
-			    if ( stobj_unpack_sessinfo( bufp, buflen, &sessinfo )<0 ) {
4c97d8
-				ok = BOOL_FALSE;
4c97d8
-			    } else {
4c97d8
+			ok = BOOL_FALSE;
4c97d8
+			/* extract the session information from the buffer */
4c97d8
+			if (buflen &&
4c97d8
+			    stobj_unpack_sessinfo(bufp, buflen, &sessinfo)) {
4c97d8
 				stobj_convert_sessinfo(&sessp, &sessinfo);
4c97d8
 				ok = BOOL_TRUE;
4c97d8
-			    }
4c97d8
 			}
4c97d8
+
4c97d8
 			if ( ! ok || ! sessp ) {
4c97d8
 				mlog( MLOG_DEBUG | MLOG_WARNING | MLOG_MEDIA, _(
4c97d8
 				      "on-media session "