[PATCH] xfsprogs: skip over "rootfs" entry if mtab links to /proc/mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is for RH bug 727938, xfs_fsr regression for root file system

Fedora has made /etc/mtab a symlink to /proc/mounts, but when
we issue "xfs_fsr /" and fsr's getmntany() goes looking for
the "/" entry, the first one it finds is

rootfs / rootfs rw 0 0

it says no way, that's a rootfs filesystem type, not xfs!
And it never finds this later:

/dev/sda2 / xfs rw,relatime,attr2,noquota 0 0

This patch to skip over the rootfs entry seems to fix it.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 40c2e6f..eaf8ac7 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -1648,6 +1648,9 @@ getmntany(FILE *fp, struct mntent *mp, struct mntent *mpref, struct stat64 *s)
 	struct stat64 ms;
 
 	while ((t = getmntent(fp))) {
+		/* skip over "rootfs / rootfs" if mtab is really /proc/mounts */
+		if (strcmp(t->mnt_type, "rootfs") == 0)
+			continue;
 		if (mpref->mnt_fsname) {	/* device */
 			if (stat64(t->mnt_fsname, &ms) < 0)
 				continue;

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux