Blame SOURCES/0001-xfsdump-Revert-xfsdump-handle-bind-mount-targets.patch

fdaf15
From 3b71c7f1f5a1dd45712d7de1139290d0a8cf03c4 Mon Sep 17 00:00:00 2001
fdaf15
From: Gao Xiang <hsiangkao@redhat.com>
fdaf15
Date: Thu, 3 Feb 2022 12:42:30 -0500
fdaf15
Subject: [PATCH 1/2] xfsdump: Revert "xfsdump: handle bind mount targets"
fdaf15
fdaf15
Bind mount mntpnts will be forbided in the next commits
fdaf15
instead since it's not the real rootdir.
fdaf15
fdaf15
This cannot be reverted cleanly due to several cleanup
fdaf15
patches, but the logic is reverted equivalently.
fdaf15
fdaf15
This reverts commit 25195ebf107dc81b1b7cea1476764950e1d6cc9d.
fdaf15
fdaf15
Fixes: 25195ebf107d ("xfsdump: handle bind mount targets")
fdaf15
Cc: Eric Sandeen <sandeen@redhat.com>
fdaf15
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
fdaf15
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
fdaf15
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
fdaf15
---
fdaf15
fdaf15
Index: xfsdump-3.1.8/dump/content.c
fdaf15
===================================================================
fdaf15
--- xfsdump-3.1.8.orig/dump/content.c
fdaf15
+++ xfsdump-3.1.8/dump/content.c
fdaf15
@@ -1382,17 +1382,11 @@ baseuuidbypass:
fdaf15
 	}
fdaf15
 
fdaf15
 	/* figure out the ino for the root directory of the fs
fdaf15
-	 * and get its xfs_bstat_t for inomap_build().  This could
fdaf15
-	 * be a bind mount; don't ask for the mount point inode,
fdaf15
-	 * find the actual lowest inode number in the filesystem.
fdaf15
+	 * and get its xfs_bstat_t for inomap_build()
fdaf15
 	 */
fdaf15
 	{
fdaf15
 		stat64_t rootstat;
fdaf15
-		xfs_ino_t lastino = 0;
fdaf15
-		int ocount = 0;
fdaf15
-		xfs_fsop_bulkreq_t bulkreq;
fdaf15
 
fdaf15
-		/* Get the inode of the mount point */
fdaf15
 		rval = fstat64( sc_fsfd, &rootstat );
fdaf15
 		if ( rval ) {
fdaf15
 			mlog( MLOG_NORMAL, _(
fdaf15
@@ -1404,21 +1398,11 @@ baseuuidbypass:
fdaf15
 			( xfs_bstat_t * )calloc( 1, sizeof( xfs_bstat_t ));
fdaf15
 		assert( sc_rootxfsstatp );
fdaf15
 
fdaf15
-		/* Get the first valid (i.e. root) inode in this fs */
fdaf15
-		bulkreq.lastip = (__u64 *)&lastino;
fdaf15
-		bulkreq.icount = 1;
fdaf15
-		bulkreq.ubuffer = sc_rootxfsstatp;
fdaf15
-		bulkreq.ocount = &ocount;
fdaf15
-		if (ioctl(sc_fsfd, XFS_IOC_FSBULKSTAT, &bulkreq) < 0) {
fdaf15
+		if (bigstat_one(sc_fsfd, rootstat.st_ino, sc_rootxfsstatp) < 0) {
fdaf15
 			mlog( MLOG_ERROR,
fdaf15
 			      _("failed to get bulkstat information for root inode\n"));
fdaf15
 			return BOOL_FALSE;
fdaf15
 		}
fdaf15
-
fdaf15
-		if (sc_rootxfsstatp->bs_ino != rootstat.st_ino)
fdaf15
-			mlog ( MLOG_NORMAL | MLOG_NOTE,
fdaf15
-			       _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
fdaf15
-			         sc_rootxfsstatp->bs_ino, rootstat.st_ino);
fdaf15
 	}
fdaf15
 	
fdaf15
 	/* alloc a file system handle, to be used with the jdm_open()