Bug 727938 - xfs_fsr regression for root file system
Summary: xfs_fsr regression for root file system
Alias: None
Product: Fedora
Classification: Fedora
Component: xfsprogs
Version: 15
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Carlos Maiolino
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-08-03 17:45 UTC by arth
Modified: 2012-08-08 14:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-08-07 20:28:00 UTC

Attachments (Terms of Use)

Description arth 2011-08-03 17:45:28 UTC
Description of problem:

xfs_fsr seems to have a regression:

[root@ahlinux2 ~]# df -t xfs
Filesystem           1K-blocks      Used Available Use% Mounted on
                      52403200   5304444  47098756  11% /
                      52403200    199332  52203868   1% /home
[root@ahlinux2 ~]# awk '($3 == "xfs")' /etc/fstab
/dev/mapper/vg_ahlinux2-lv_root /	xfs	defaults	1 1
/dev/mapper/vg_ahlinux2-lv_home	/home	xfs	defaults	1 2

[root@ahlinux2 ~]# xfs_fsr -v /
/: Directory defragmentation not supported

This works for F14:
root@ahlinux ~ # xfs_fsr -v /
/ start inode=0

Version-Release number of selected component (if applicable):

Additional info:

It is possible that this is due to the switch to use /proc/mounts, where the first entry for / is of type "rootfs" instead of "xfs".

Comment 1 arth 2011-08-03 18:08:04 UTC
The use of /proc/mounts being the culprit appears to be correct.

The problem can be replicated on F14 by moving aside /etc/mtab and making mtab a symlink to /proc/mounts

In other words, this will break on F15 even if xfs_fsr is reverted to use mtab instead of /proc/mounts, because F15 has mtab as a symlink to /proc/mounts.

A change to getmntany() in xfs_fsr.c might be needed.

Comment 2 Eric Sandeen 2011-08-03 18:36:42 UTC
Ho hum, thanks for the report, that /proc/mounts change did break a few things.  :)

It looks like it's checking that "/" is of type "xfs" but when it finds:

rootfs / rootfs rw 0 0

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

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

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

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

Comment 3 Eric Sandeen 2011-08-03 18:42:41 UTC
I've sent a patch to the xfs mailing list for this, thanks.


Comment 4 arth 2011-08-03 19:06:00 UTC
/proc/mounts sure did cause excitement - we're still waiting for a "df" without dupes.

I can confirm that the fix works:

[root@ahlinux2 .libs]# pwd
[root@ahlinux2 .libs]# ./xfs_fsr /
/ start inode=0


Comment 5 Eric Sandeen 2011-08-03 19:45:28 UTC
Well, hch didn't like my patch and he has a point, we should probably skip to the last entry matching the mountpoint, as we could have /dev/foo, /dev/bar, and /dev/baz all mounted on /mnt/quux

that fix would solve the rootfs problem, too.

One way or another we'll get it fixed upstream.


Comment 6 Carlos Maiolino 2012-02-08 12:03:21 UTC
Patch suggestion sent upstream.

Comment 7 Fedora End Of Life 2012-08-07 20:28:02 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:

Comment 8 Eric Sandeen 2012-08-08 14:51:17 UTC
This actually is fixed upstream now, FWIW.

Note You need to log in before you can comment on or make changes to this bug.