RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1304258 - quotaon -p prints quota off state for an XFS mount point mount with usrquota,grpquota mount options
Summary: quotaon -p prints quota off state for an XFS mount point mount with usrquota,...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: quota
Version: 6.10
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Petr Pisar
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1494503
TreeView+ depends on / blocked
 
Reported: 2016-02-03 08:07 UTC by Zorro Lang
Modified: 2017-12-06 10:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-06 10:39:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
FIx ported to 3.17, first part (1.14 KB, patch)
2016-02-03 13:19 UTC, Petr Pisar
no flags Details | Diff
Fix ported to 3.17, second part (4.62 KB, patch)
2016-02-03 13:19 UTC, Petr Pisar
no flags Details | Diff

Description Zorro Lang 2016-02-03 08:07:56 UTC
Description of problem:
I find this bug when I ran xfstests generic/082 on XFS. generic/082 failed as:
  group quota on SCRATCH_MNT (SCRATCH_DEV) is off
  user quota on SCRATCH_MNT (SCRATCH_DEV) is off

But the SCRATCH_MNT is mount with usrquota,grpquota.

For skip some useless steps in generic/082, I just run:
1. mkfs.xfs /dev/sda2

2. mount /dev/sda2 /mnt/xfstests/mnt1 -o usrquota,grpquota

3. mount -l|grep /dev/sda2
/dev/sda2 on /mnt/xfstests/mnt1 type xfs (rw,usrquota,grpquota)

4. cat /proc/mounts|grep /dev/sda2
/dev/sda2 /mnt/xfstests/mnt1 xfs rw,seclabel,relatime,attr2,delaylog,usrquota,grpquota 0 0

5. quotacheck -ug /mnt/xfstests/mnt1
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

6. quotaon /mnt/xfstests/mnt1
quotaon: Enforcing group quota already on /dev/sda2
quotaon: Enforcing user quota already on /dev/sda2

7. quotaon -p /mnt/xfstests/mnt1
group quota on /mnt/xfstests/mnt1 (/dev/sda2) is off
user quota on /mnt/xfstests/mnt1 (/dev/sda2) is off

8. xfs_quota -x -c "state -ug" /mnt/xfstests/mnt1
User quota state on /mnt/xfstests/mnt1 (/dev/sda2)
  Accounting: ON
  Enforcement: ON
  Inode: #131 (1 blocks, 1 extents)
Group quota state on /mnt/xfstests/mnt1 (/dev/sda2)
  Accounting: ON
  Enforcement: ON
  Inode: #132 (1 blocks, 1 extents)
Blocks grace time: [7 days 00:00:30]
Inodes grace time: [7 days 00:00:30]
Realtime Blocks grace time: [7 days 00:00:30]


So 
step#3 and step#4 show I really mount with quota option
step#5 and step#7 show quota-tools report quota is off
step#8 xfs_quota shows quota is on.

By the way, this failure can't be found on ext3/4.

Actual results:
quotaon -p show quota off if mount xfs with usrquota,grpquota

Expected results:
quotaon -p show quota on if mount xfs with usrquota,grpquota

Additional info:
I try to strace quotaon -p $mnt:
on RHEL-6.8, the quotactl() system call shows as:
---
[root@sgi-uv30-01 ~]# strace -e quotactl quotaon -p /mnt/xfstests/mnt1
quotactl(Q_GETFMT|GRPQUOTA, "/dev/sda2", 0, 0x7ffdc57e848c) = -1 ESRCH (No such process)
group quota on /mnt/xfstests/mnt1 (/dev/sda2) is off
quotactl(Q_GETFMT|USRQUOTA, "/dev/sda2", 0, 0x7ffdc57e848c) = -1 ESRCH (No such process)
user quota on /mnt/xfstests/mnt1 (/dev/sda2) is off
+++ exited with 0 +++
---

on RHEL-7, no this bug. quotaon -p can report quota on. its strace output as:
---
[root@ibm-x3650m4-10 ~]# strace -e quotactl quotaon -p /mnt/xfstests/mnt1                                              
quotactl(Q_XGETQSTAT|GRPQUOTA, "/dev/mapper/rhel_ibm--x3650m4--10-xfscratch", 0, {version=1, ...}) = 0
group quota on /mnt/xfstests/mnt1 (/dev/mapper/rhel_ibm--x3650m4--10-xfscratch) is on
quotactl(Q_XGETQSTAT|USRQUOTA, "/dev/mapper/rhel_ibm--x3650m4--10-xfscratch", 0, {version=1, ...}) = 0
user quota on /mnt/xfstests/mnt1 (/dev/mapper/rhel_ibm--x3650m4--10-xfscratch) is on
+++ exited with 2 +++
---

on RHEL-6.8, strace xfs_quota -x -c "state -ug" show as:
---
quotactl(Q_XGETQSTAT|USRQUOTA, "/dev/sda2", 0, {version=1, ...}) = 0
User quota state on /mnt/xfstests/mnt1 (/dev/sda2)
  Accounting: ON
  Enforcement: ON
  Inode: #131 (1 blocks, 1 extents)
Group quota state on /mnt/xfstests/mnt1 (/dev/sda2)
  Accounting: ON
  Enforcement: ON
  Inode: #132 (1 blocks, 1 extents)
Blocks grace time: [7 days 00:00:30]
Inodes grace time: [7 days 00:00:30]
Realtime Blocks grace time: [7 days 00:00:30]
+++ exited with 0 +++
---

Both RHEL-7 quotaon and xfs_quota use Q_XGETQSTAT, but RHEL-6 quotaon use Q_GETFMT. That's the difference.

BTW, I can reproduce this bug on upstream linux 4.5.0-rc2 on RHEL-6.8. So I think it's not a RHEL-6 kernel bug.

Comment 1 Eryu Guan 2016-02-03 11:02:57 UTC
Upstream quota tools doesn't have this problem. I think that's because upstream commit 40e09a3

commit 40e09a3b49827699d770f8144f973d4928f248b2
Author: Jan Kara <jack>
Date:   Thu Nov 17 00:02:59 2011 +0100

    Add support for quotas on ext4 in system files

changed the order of quota type detection. After this commit, kern_quota_on() detects for XFS first, on the other hand prior to this commit it detects for kernel_iface first (and that was IFACE_GENERIC, then quotactl(Q_GETFMT...) was called and failed).

Comment 2 Petr Pisar 2016-02-03 12:08:27 UTC
I confirm that quota-3.17-23.el6.x86_64 misreports XFS quota accounting state with "quotaon -p" and "quotaoff -p". I also note that "quotaoff" cannot disable XFS quota enforcing on.

A workaround for getting the status are "repquota -v" or "xfs_quota -x -c 'state -ug'" commands.

Is this an old bug or a new regression and it sometimes worked before on RHEL-6?

Comment 5 Petr Pisar 2016-02-03 12:53:01 UTC
Upstream fixed it with this two commits:

commit 86b82591a57198dbe88f5b37402f299a424e1b57
Author: jkar8572 <jkar8572>
Date:   Mon Jun 14 12:42:57 2010 +0000

    Fix kern_quota_on() to work with XFS filesystems (Jan Kara)
    Fix quotaon to work correctly with XFS filesystems (Jan Kara)

commit 22418226016a589a2ea355f1965f4123276e6bb8
Author: jkar8572 <jkar8572>
Date:   Mon Jun 14 10:06:04 2010 +0000

    For XFS, quotaon -f should turn off only limit enforcement as described in the manpage (Eric Sandeen)

Comment 6 Petr Pisar 2016-02-03 13:19:10 UTC
Created attachment 1120781 [details]
FIx ported to 3.17, first part

Comment 7 Petr Pisar 2016-02-03 13:19:53 UTC
Created attachment 1120782 [details]
Fix ported to 3.17, second part

Comment 12 Jan Kurik 2017-12-06 10:39:23 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/


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