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 1077463 - gfs2: quotas not refreshed in gfs2_adjust_quota
Summary: gfs2: quotas not refreshed in gfs2_adjust_quota
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.6
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Abhijith Das
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 1088740
TreeView+ depends on / blocked
 
Reported: 2014-03-18 04:10 UTC by Abhijith Das
Modified: 2018-12-06 16:07 UTC (History)
3 users (show)

Fixed In Version: kernel-2.6.32-465.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1088740 (view as bug list)
Environment:
Last Closed: 2014-10-14 06:03:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed fix (327 bytes, patch)
2014-04-02 21:05 UTC, Abhijith Das
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:1392 0 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2014-10-14 01:28:44 UTC

Description Abhijith Das 2014-03-18 04:10:20 UTC
Description of problem:
When quota warn/limit values are specified using setquota for gfs2, they don't seem to take effect on the filesystem. With the filesystem mounted with quota=on, a user is able to exceed allotted quotas without the filesystem issuing warnings or returning error.

Version-Release number of selected component (if applicable):
Probably exists in upstream/rhel7 versions as well.

How reproducible:
Always

Steps to Reproduce:
[root@skol-01 rhel6]# dd if=/dev/zero of=/dev/skolo/1g bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 5.21575 s, 206 MB/s
[root@skol-01 rhel6]# mkfs.gfs2 -j1 -p lock_nolock /dev/skolo/1g -O
Device:                    /dev/skolo/1g
Blocksize:                 4096
Device Size                1.00 GB (262144 blocks)
Filesystem Size:           1.00 GB (262142 blocks)
Journals:                  1
Resource Groups:           4
Locking Protocol:          "lock_nolock"
Lock Table:                ""
UUID:                      ee4f26f7-6333-b612-420d-8863b1520047

[root@skol-01 rhel6]# mount -t gfs2 -o rw,relatime,nodiratime,localflocks,acl,quota=on /dev/skolo/1g /mnt/gfs2/
[root@skol-01 rhel6]# 
[root@skol-01 rhel6]# setquota -u test 10 20 0 0 /mnt/gfs2/
[root@skol-01 rhel6]# chmod 777 /mnt/gfs2
[root@skol-01 rhel6]# sync
[root@skol-01 rhel6]# 
[root@skol-01 rhel6]# su test
[test@skol-01 rhel6]$ /tmp/creator /mnt/gfs2 123 20
[test@skol-01 rhel6]$ exit
exit
[root@skol-01 rhel6]# 
[root@skol-01 rhel6]# sync
[root@skol-01 rhel6]# repquota -vu /mnt/gfs2
*** Report for user quotas on device /dev/dm-3
Block grace time: 00:00; Inode grace time: 00:00
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --       4       0       0              0     0     0       
test      +-      80       8      20              0     0     0       

*** Status for user quotas on device /dev/dm-3
Accounting: ON; Enforcement: ON
Inode: #33122 (24 blocks, 1 extents)

[root@skol-01 rhel6]# rm -Rf /mnt/gfs2/*
[root@skol-01 rhel6]# umount /mnt/gfs2

Actual results:
No quota warnings or errors and user is able to exceed quotas

Expected results:
Appropriate warning and errors should be returned and user shouldn't be allowed to exceed allotted quota

Comment 2 Petr Pisar 2014-03-18 08:45:49 UTC
And is it because GFS2 kernel driver slips the limits sometimes or because setquota should call Q_SYNC. And if the second one, how can you prevent from race (set, exceed limit, sync)? I was always told that this is how GFS2 behaves because it's distributed file system.

I gave a try with 2.6.32-431.el6.x86_64 and quota-3.17-21.el6_5.x86_64 and I get "Disk quota exceeded" error from dd(1) tool while creating the file. (Although kernel breaks at 24 KB).

This or that cannot be bug in user space. Assigning to kernel component.

Comment 4 RHEL Program Management 2014-03-26 00:11:18 UTC
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.

Comment 5 Abhijith Das 2014-04-02 21:05:58 UTC
Created attachment 882009 [details]
Proposed fix

This patch causes the quota to be refreshed to the latest values so quotas are enforced correctly.

Comment 6 Abhijith Das 2014-04-17 20:38:42 UTC
Posted patch above to rhkernel-list for inclusion in RHEL6

Comment 7 Rafael Aquini 2014-05-14 12:34:59 UTC
Patch(es) available on kernel-2.6.32-465.el6

Comment 10 Justin Payne 2014-09-12 03:25:58 UTC
Verified in kernel-2.6.32-500.el6:

[root@dash-01 ~]# uname -r
2.6.32-500.el6.x86_64
[root@dash-01 ~]# dd if=/dev/zero of=/dev/mapper/mpathap1 bs=4G count=27
0+27 records in
0+27 records out
57981947904 bytes (58 GB) copied, 3816.36 s, 15.2 MB/s
[root@dash-01 ~]# mkfs.gfs2 -j1 -p lock_nolock /dev/mapper/mpathap1 -O
Device:                    /dev/mapper/mpathap1
Blocksize:                 4096
Device Size                100.00 GB (26214055 blocks)
Filesystem Size:           100.00 GB (26214053 blocks)
Journals:                  1
Resource Groups:           400
Locking Protocol:          "lock_nolock"
Lock Table:                ""
UUID:                      b1b7e47d-e211-1883-7b9c-a0852838eb3f

[root@dash-01 ~]# mount -t gfs2 -o rw,relatime,nodiratime,localflocks,acl,quota=on /dev/mapper/mpathap1 /mnt/gfs2/
[root@dash-01 ~]# setquota -u test 10 20 0 0 /mnt/gfs2/
[root@dash-01 ~]# chmod 777 /mnt/gfs2
[root@dash-01 ~]# sync
[root@dash-01 ~]# su test
[test@dash-01 root]$ /tmp/creator /mnt/gfs2 123 20
write(/mnt/gfs2/lrbbmqbhcdarzowkky) failed: Disk quota exceeded
create_and_write(/mnt/gfs2/lrbbmqbhcdarzowkky) failed: Disk quota exceeded
[test@dash-01 root]$ exit
exit
[root@dash-01 ~]# sync
[root@dash-01 ~]# repquota -vu /mnt/gfs2
*** Report for user quotas on device /dev/dm-5
Block grace time: 00:00; Inode grace time: 00:00
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --       4       0       0              0     0     0       
test      +-      24       8      20              0     0     0       

*** Status for user quotas on device /dev/dm-5
Accounting: ON; Enforcement: ON
Inode: #33132 (24 blocks, 1 extents)
[root@dash-01 ~]# rm -rf /mnt/gfs2/*
[root@dash-01 ~]# umount /mnt/gfs2/

Comment 11 errata-xmlrpc 2014-10-14 06:03:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-1392.html


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