Hide Forgot
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
Thank you for the report. I confirm the issue exists in RHEL 7 and that the patch fixes it.
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