From 84b2b0185dad63ee91dca35b71ce9d3ab7b382d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 30 May 2018 13:54:10 +0200 Subject: [PATCH] Fix current block usage limit in RPC client --- ...-rpc-Fix-wrong-limit-for-space-usage.patch | 35 +++++++++++++++++++ quota.spec | 9 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 quota-4.04-rpc-Fix-wrong-limit-for-space-usage.patch diff --git a/quota-4.04-rpc-Fix-wrong-limit-for-space-usage.patch b/quota-4.04-rpc-Fix-wrong-limit-for-space-usage.patch new file mode 100644 index 0000000..5d4ed11 --- /dev/null +++ b/quota-4.04-rpc-Fix-wrong-limit-for-space-usage.patch @@ -0,0 +1,35 @@ +From d7694c952073bf2ebb852014d9f979b5e3e7c018 Mon Sep 17 00:00:00 2001 +From: Jan Kara +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 +Signed-off-by: Petr Písař +--- + 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 + diff --git a/quota.spec b/quota.spec index d9ca605..48cdb37 100644 --- a/quota.spec +++ b/quota.spec @@ -10,7 +10,7 @@ Name: quota Epoch: 1 Version: 4.04 -Release: 6%{?dist} +Release: 7%{?dist} Summary: System administration tools for monitoring users' disk usage # quota_nld.c, quotaio_xfs.h: GPLv2 # bylabel.c copied from util-linux: GPLv2+ @@ -76,6 +76,9 @@ Patch9: quota-4.04-quotacheck-Fail-check-if-quota-file-magic-is-invalid.patch # Fix busy loop in rpc.rquotad, bug #1575956, in upstream after 4.04, # Patch10: quota-4.04-Listen-on-a-TCP-socket.patch +# Fix current block usage limit in RPC client, in upstream after 4.04, +# +Patch11: quota-4.04-rpc-Fix-wrong-limit-for-space-usage.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bash @@ -200,6 +203,7 @@ Linux/UNIX environment. %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 # Regenerate build scripts autoreconf -f -i @@ -344,6 +348,9 @@ make check %changelog +* Wed May 30 2018 Petr Pisar - 1:4.04-7 +- Fix current block usage limit in RPC client + * Tue May 22 2018 Petr Pisar - 1:4.04-6 - Fix busy loop in rpc.rquotad (bug #1575956)