Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
.Setting disk quota limits over a network works again for users occupying more than 4 GB of space on the network file system
Previously, the `setquota` utility was unable to handle an occupied space greater than 4 GB when communicating with an NFS server due to an incorrect format of the used disk size. Consequently, when setting disk quota limits for a user exceeding 4 GB of used space on a NFS-mounted file system, `setquota` failed to perform the operation. This update corrects the conversion of the used disk size to an RPC protocol format, and the described problem no longer occurs.
Description of problem:
The rpc quota format sets a limit on the maximum current usage at 4 GiB, due to using a 32-bit-unsigned value.
Upstream patch exists to fix this issue.
Version-Release number of selected component (if applicable):
quota-4.01-18.el7
How reproducible:
easy, see below
Steps to Reproduce:
make a user's current usage greater than 4 GiB:
on the server:
# truncate -s 10G /var/tmp/test_fs.img
# mkfs -t xfs /var/tmp/test_fs.img
# mkdir -p /mnt/export
# mount -oloop,usrquota /var/tmp/test_fs.img /mnt/export
# exportfs '*:/mnt/export
# touch /mnt/export/testfile
# chown user1 /mnt/export/testfile
# dd if=/dev/zero of=/mnt/export/testfile bs=1M count=4100
on the client:
# mount server:/mnt/export /mnt/server
# setquota -F rpc -r -u user1 100M 200M 0 0 /mnt/server
Actual results:
# setquota -F rpc -r -u user1 100M 200M 0 0 /mnt/server
setquota: Trying to set quota usage out of range supported by quota format on server:/mnt/export.
setquota: Cannot write quota for 501 on server:/mnt/export: Numerical result out of range
Expected results:
quota set without error
# setquota -F rpc -r -u user1 100M 200M 0 0 /mnt/server
Additional info:
due to the incorrect maximum, the test in check_dquot_range fails:
quotaio.c:
int check_dquot_range(struct dquot *dquot)
...
if (dquot->dq_dqb.dqb_curinodes > info->dqi_max_i_usage ||
dquot->dq_dqb.dqb_curspace > info->dqi_max_b_usage) {
errstr(_("Trying to set quota usage out of range "
"supported by quota format on %s.\n"), dquot->dq_h->qh_quotadev);
return -1;
}
both of these tests must be false in order for the range to be valid:
(dquot->dq_dqb.dqb_curspace = 4831772672) > (info->dqi_max_b_usage = 4294966272): FAIL
dquot->dq_dqb.dqb_curinodeo = 2) > (info->dqi_max_i_usage = 4294967295): PASS
upstream commit -
https://sourceforge.net/p/linuxquota/code/ci/d7694c952073bf2ebb852014d9f979b5e3e7c018/
From d7694c952073bf2ebb852014d9f979b5e3e7c018 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack>
Date: Mon, 28 May 2018 18:08:24 +0200
Subject: [PATCH] rpc: Fix wrong limit for space usage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Limit of maximum allowable space usage for RPC transfer was wrongly set
to ~4GB instead of ~4TB due to overflow in constant initialization. Fix
it.
Signed-off-by: Jan Kara <jack>
Signed-off-by: Petr Písař <ppisar>
---
quotaio_rpc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/quotaio_rpc.c b/quotaio_rpc.c
index 6f25144..edc1e9f 100644
--- a/quotaio_rpc.c
+++ b/quotaio_rpc.c
@@ -33,7 +33,8 @@ static int rpc_init_io(struct quota_handle *h)
#ifdef RPC
h->qh_info.dqi_max_b_limit = ~(uint32_t)0;
h->qh_info.dqi_max_i_limit = ~(uint32_t)0;
- h->qh_info.dqi_max_b_usage = (~(uint32_t)0) << QUOTABLOCK_BITS;
+ h->qh_info.dqi_max_b_usage = ((uint64_t)(~(uint32_t)0))
+ << QUOTABLOCK_BITS;
h->qh_info.dqi_max_i_usage = ~(uint32_t)0;
return 0;
#else
--
2.14.3
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.
https://access.redhat.com/errata/RHEA-2019:2093
Description of problem: The rpc quota format sets a limit on the maximum current usage at 4 GiB, due to using a 32-bit-unsigned value. Upstream patch exists to fix this issue. Version-Release number of selected component (if applicable): quota-4.01-18.el7 How reproducible: easy, see below Steps to Reproduce: make a user's current usage greater than 4 GiB: on the server: # truncate -s 10G /var/tmp/test_fs.img # mkfs -t xfs /var/tmp/test_fs.img # mkdir -p /mnt/export # mount -oloop,usrquota /var/tmp/test_fs.img /mnt/export # exportfs '*:/mnt/export # touch /mnt/export/testfile # chown user1 /mnt/export/testfile # dd if=/dev/zero of=/mnt/export/testfile bs=1M count=4100 on the client: # mount server:/mnt/export /mnt/server # setquota -F rpc -r -u user1 100M 200M 0 0 /mnt/server Actual results: # setquota -F rpc -r -u user1 100M 200M 0 0 /mnt/server setquota: Trying to set quota usage out of range supported by quota format on server:/mnt/export. setquota: Cannot write quota for 501 on server:/mnt/export: Numerical result out of range Expected results: quota set without error # setquota -F rpc -r -u user1 100M 200M 0 0 /mnt/server Additional info: due to the incorrect maximum, the test in check_dquot_range fails: quotaio.c: int check_dquot_range(struct dquot *dquot) ... if (dquot->dq_dqb.dqb_curinodes > info->dqi_max_i_usage || dquot->dq_dqb.dqb_curspace > info->dqi_max_b_usage) { errstr(_("Trying to set quota usage out of range " "supported by quota format on %s.\n"), dquot->dq_h->qh_quotadev); return -1; } both of these tests must be false in order for the range to be valid: (dquot->dq_dqb.dqb_curspace = 4831772672) > (info->dqi_max_b_usage = 4294966272): FAIL dquot->dq_dqb.dqb_curinodeo = 2) > (info->dqi_max_i_usage = 4294967295): PASS upstream commit - https://sourceforge.net/p/linuxquota/code/ci/d7694c952073bf2ebb852014d9f979b5e3e7c018/ From d7694c952073bf2ebb852014d9f979b5e3e7c018 Mon Sep 17 00:00:00 2001 From: Jan Kara <jack> Date: Mon, 28 May 2018 18:08:24 +0200 Subject: [PATCH] rpc: Fix wrong limit for space usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Limit of maximum allowable space usage for RPC transfer was wrongly set to ~4GB instead of ~4TB due to overflow in constant initialization. Fix it. Signed-off-by: Jan Kara <jack> Signed-off-by: Petr Písař <ppisar> --- quotaio_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quotaio_rpc.c b/quotaio_rpc.c index 6f25144..edc1e9f 100644 --- a/quotaio_rpc.c +++ b/quotaio_rpc.c @@ -33,7 +33,8 @@ static int rpc_init_io(struct quota_handle *h) #ifdef RPC h->qh_info.dqi_max_b_limit = ~(uint32_t)0; h->qh_info.dqi_max_i_limit = ~(uint32_t)0; - h->qh_info.dqi_max_b_usage = (~(uint32_t)0) << QUOTABLOCK_BITS; + h->qh_info.dqi_max_b_usage = ((uint64_t)(~(uint32_t)0)) + << QUOTABLOCK_BITS; h->qh_info.dqi_max_i_usage = ~(uint32_t)0; return 0; #else -- 2.14.3