84b2b01
From d7694c952073bf2ebb852014d9f979b5e3e7c018 Mon Sep 17 00:00:00 2001
84b2b01
From: Jan Kara <jack@suse.cz>
84b2b01
Date: Mon, 28 May 2018 18:08:24 +0200
84b2b01
Subject: [PATCH] rpc: Fix wrong limit for space usage
84b2b01
MIME-Version: 1.0
84b2b01
Content-Type: text/plain; charset=UTF-8
84b2b01
Content-Transfer-Encoding: 8bit
84b2b01
84b2b01
Limit of maximum allowable space usage for RPC transfer was wrongly set
84b2b01
to ~4GB instead of ~4TB due to overflow in constant initialization. Fix
84b2b01
it.
84b2b01
84b2b01
Signed-off-by: Jan Kara <jack@suse.cz>
84b2b01
Signed-off-by: Petr Písař <ppisar@redhat.com>
84b2b01
---
84b2b01
 quotaio_rpc.c | 3 ++-
84b2b01
 1 file changed, 2 insertions(+), 1 deletion(-)
84b2b01
84b2b01
diff --git a/quotaio_rpc.c b/quotaio_rpc.c
84b2b01
index 6f25144..edc1e9f 100644
84b2b01
--- a/quotaio_rpc.c
84b2b01
+++ b/quotaio_rpc.c
84b2b01
@@ -33,7 +33,8 @@ static int rpc_init_io(struct quota_handle *h)
84b2b01
 #ifdef RPC
84b2b01
 	h->qh_info.dqi_max_b_limit = ~(uint32_t)0;
84b2b01
 	h->qh_info.dqi_max_i_limit = ~(uint32_t)0;
84b2b01
-	h->qh_info.dqi_max_b_usage = (~(uint32_t)0) << QUOTABLOCK_BITS;
84b2b01
+	h->qh_info.dqi_max_b_usage = ((uint64_t)(~(uint32_t)0))
84b2b01
+							 << QUOTABLOCK_BITS;
84b2b01
 	h->qh_info.dqi_max_i_usage = ~(uint32_t)0;
84b2b01
 	return 0;
84b2b01
 #else
84b2b01
-- 
84b2b01
2.14.3
84b2b01