lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Dec 2009 22:28:05 +0100
From:	Jan Kara <jack@...e.cz>
To:	Jerry Leo <jerryleo860202@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] quota: integer constant is too large for ‘long’ type in

On Tue 15-12-09 21:27:50, Jerry Leo wrote:
> Hi, Jan Kara,
> 
> the Patch is for this:
> 
> CC      fs/quota/quota_v2.o
> fs/quota/quota_v2.c: In function ‘v2_read_file_info’:
> fs/quota/quota_v2.c:123: warning: integer constant is too large for ‘long’ type
> fs/quota/quota_v2.c:124: warning: integer constant is too large for ‘long’ type
> 
> 
> Can this patch be fixed?
  Ops, yes. I didn't see these warnings because I'm using 64-bit
machines... Thanks for the fix. You actually have to use ULL as Joe pointed
out. So I've merged the patch below:

>From 0ec834cacfc98633133b5a90c951f2d02e341048 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@...e.cz>
Date: Tue, 15 Dec 2009 22:24:36 +0100
Subject: [PATCH] quota: Fix 64-bit limits setting on 32-bit archs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix warnings:
fs/quota/quota_v2.c: In function ‘v2_read_file_info’:
fs/quota/quota_v2.c:123: warning: integer constant is too large for ‘long’ type
fs/quota/quota_v2.c:124: warning: integer constant is too large for ‘long’ type

Reported-by: Jerry Leo <jerryleo860202@...il.com>
Signed-off-by: Jan Kara <jack@...e.cz>
---
 fs/quota/quota_v2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index 3dfc23e..669855c 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -120,8 +120,8 @@ static int v2_read_file_info(struct super_block *sb, int type)
 		info->dqi_maxilimit = 0xffffffff;
 	} else {
 		/* used space is stored as unsigned 64-bit value */
-		info->dqi_maxblimit = 0xffffffffffffffff;	/* 2^64-1 */
-		info->dqi_maxilimit = 0xffffffffffffffff;
+		info->dqi_maxblimit = 0xffffffffffffffffULL;	/* 2^64-1 */
+		info->dqi_maxilimit = 0xffffffffffffffffULL;
 	}
 	info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace);
 	info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace);
-- 
1.6.4.2

-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ