Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1362101

Summary: xfs_quota prints helpless error message when GETNEXTQUOTA falls back to GETQUOTA
Product: Red Hat Enterprise Linux 7 Reporter: Zorro Lang <zlang>
Component: xfsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED DUPLICATE QA Contact: Filesystem QE <fs-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: esandeen
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-16 15:47:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zorro Lang 2016-08-01 09:51:33 UTC
Description of problem:
aarch64 use kernel-4.5.0-0.48.el7.aarch64, it doesn't have XFS GETNEXTQUOTA feature. But xfsprogs-4.5.0-5.el7.aarch64(from RHEL-7.3 Alhpa-1.0) merged this feature.

This feature add a new flag GETNEXTQUOTA_FLAG. So if xfsprogs merged this feature, it can't work well with kernel not merge it, then return "XFS_GETQUOTA: Invalid argument", due to kernel don't know this new flag.

Version-Release number of selected component (if applicable):
kernel-4.5.0-0.48.el7.aarch64
xfsprogs-4.5.0-5.el7.aarch64

How reproducible:
xfstests xfs/299 or xfs/260(but this case can reproduce another bug, I don't know if aarch64 kernel want to merge that)

Actual results:
XFS_GETQUOTA: Invalid argument

Expected results:
No error maybe?

Additional info:
In xfsprogs quota/report.c report_user_mount():
....
        } else if (report_mount(fp, id, NULL, &oid, form,
                                XFS_USER_QUOTA, mount,
                                flags|GETNEXTQUOTA_FLAG)) {
                id = oid + 1;
                flags |= GETNEXTQUOTA_FLAG;
                flags |= NO_HEADER_FLAG;
                while (report_mount(fp, id, NULL, &oid, form, XFS_USER_QUOTA,
                                    mount, flags)) {
                        id = oid + 1;
                }
        } else {
....
....

It try to run GETNEXTQUOTA ioctl(this bug happened at here), if it return failure, then back to the old GETQUOTA ioctl.

1. Should aarch64 kernel merge GETNEXTQUOTA feature?
2. Or xfsprogs find a way to filter this error output, likes below(haven't tested):

diff --git a/quota/report.c b/quota/report.c
index 59290e1..964df33 100644
--- a/quota/report.c
+++ b/quota/report.c
@@ -348,7 +348,8 @@ report_mount(
                cmd = XFS_GETQUOTA;
 
        if (xfsquotactl(cmd, dev, type, id, (void *)&d) < 0) {
-               if (errno != ENOENT && errno != ENOSYS && errno != ESRCH)
+               if (errno != ENOENT && errno != ENOSYS \
+                   && errno != ESRCH && errno != EINVAL)
                        perror("XFS_GETQUOTA");
                return 0;
        }

What do you think, Eric?

Anyway, I think we shouldn't let customers face this un-compatible problem.

Comment 1 Zorro Lang 2016-08-02 07:08:03 UTC
Eric suggest to fix this bug in xfsprogs, I have sent a patch to upstream(Thanks Eric's help): [PATCH] xfs_quota: fall back silently if XFS_GETNEXTQUOTA fails

So it's not an aarch64 bug now, change component to xfsprogs.

Comment 3 Eric Sandeen 2016-08-16 15:47:41 UTC

*** This bug has been marked as a duplicate of bug 1365256 ***