Skip to contentSkip to conversation

fs/ext4/extents_status.c: fix 64-bit number truncation bug

PATCH In review Chen Gang 3 participants 6 messages Mar 31, 2014 – Apr 7, 2014 ext4 file system

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 fs/ext4/extents_status.c: fix 64-bit number truncation bug

'0x7FDEADBEEF' will be truncated to 32-bit number under unicore32. Need append 'ULL' for it.

The related warning (with allmodconfig under unicore32):

CC [M] fs/ext4/extents_status.o
fs/ext4/extents_status.c: In function ‘__es_remove_extent’:
fs/ext4/extents_status.c:813: warning: integer constant is too large for ‘long’ type

---
 fs/ext4/extents_status.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents_status.c +1 -1
index 0a014a7..0ebc212 100644
@@ -810,7 +810,7 @@ retry:
 
 			newes.es_lblk = end + 1;
 			newes.es_len = len2;
-			block = 0x7FDEADBEEF;
+			block = 0x7FDEADBEEFULL;
 			if (ext4_es_is_written(&orig_es) ||
 			    ext4_es_is_unwritten(&orig_es))
 				block = ext4_es_pblock(&orig_es) +
Signature · 1 line
1.7.9.5
author
#1 lore raw

Hello Maintains:

Please help check this patch, when you have time, thanks.

Quoted 29 lines · Chen Gang

'0x7FDEADBEEF' will be truncated to 32-bit number under unicore32. Need append 'ULL' for it.

The related warning (with allmodconfig under unicore32):

CC [M] fs/ext4/extents_status.o
fs/ext4/extents_status.c: In function ‘__es_remove_extent’:
fs/ext4/extents_status.c:813: warning: integer constant is too large for ‘long’ type

---
 fs/ext4/extents_status.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents_status.c +1 -1
index 0a014a7..0ebc212 100644
@@ -810,7 +810,7 @@ retry:
 
 			newes.es_lblk = end + 1;
 			newes.es_len = len2;
-			block = 0x7FDEADBEEF;
+			block = 0x7FDEADBEEFULL;
 			if (ext4_es_is_written(&orig_es) ||
 			    ext4_es_is_unwritten(&orig_es))
 				block = ext4_es_pblock(&orig_es) +
Signature · 7 lines
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#2 lore raw
In reply to Chen Gang
Quoted 8 lines · Chen Gang

'0x7FDEADBEEF' will be truncated to 32-bit number under unicore32. Need append 'ULL' for it.

The related warning (with allmodconfig under unicore32):

CC [M] fs/ext4/extents_status.o
fs/ext4/extents_status.c: In function ‘__es_remove_extent’:
fs/ext4/extents_status.c:813: warning: integer constant is too large for ‘long’ type

Thanks! This is failing on all 32-bit architectures.

Quoted 1 line
Quoted 9 lines
---
 fs/ext4/extents_status.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents_status.c +0 -0
index 0a014a7..0ebc212 100644

fs/ext4/extents_status.c retry: · line 816

Quoted 8 lines
fs/ext4/extents_status.c +1 -1
@@ -810,7 +810,7 @@ retry:
 
                        newes.es_lblk = end + 1;
                        newes.es_len = len2;
-                       block = 0x7FDEADBEEF;
+                       block = 0x7FDEADBEEFULL;
                        if (ext4_es_is_written(&orig_es) ||
                            ext4_es_is_unwritten(&orig_es))
                                block = ext4_es_pblock(&orig_es) +

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author
#3 lore raw
Quoted 4 lines · Geert Uytterhoeven
Quoted 3 lines · Chen Gang

'0x7FDEADBEEF' will be truncated to 32-bit number under unicore32. Need append 'ULL' for it.

Quoted 8 lines
Quoted 5 lines

The related warning (with allmodconfig under unicore32):

CC [M] fs/ext4/extents_status.o
fs/ext4/extents_status.c: In function ‘__es_remove_extent’:
fs/ext4/extents_status.c:813: warning: integer constant is too large for ‘long’ type

Thanks! This is failing on all 32-bit architectures.

Yeah.

Quoted 4 lines
Quoted 1 line

[...]

Thank you very much!

I will/should continue, and try to finish unicore32 within this month (although, excuse me, in this week and next week, I will have no much free time on open source).

Thanks.

Signature · 7 lines
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#4 lore raw
In reply to Geert Uytterhoeven
Quoted 11 lines · Geert Uytterhoeven
Quoted 8 lines · Chen Gang

'0x7FDEADBEEF' will be truncated to 32-bit number under unicore32. Need append 'ULL' for it.

The related warning (with allmodconfig under unicore32):

CC [M] fs/ext4/extents_status.o
fs/ext4/extents_status.c: In function ‘__es_remove_extent’:
fs/ext4/extents_status.c:813: warning: integer constant is too large for ‘long’ type

Thanks! This is failing on all 32-bit architectures.

Yes, it's harmless (since we don't actually check the value anywhere; this is just so humans could easily spot bugs when debugging), but I'll make sure this gets queued for 3.15 fixes in the ext4 tree.

Thanks!!

- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#5 lore raw
Quoted 11 lines · Theodore Ts'o
Quoted 10 lines · Geert Uytterhoeven
Quoted 8 lines · Chen Gang

'0x7FDEADBEEF' will be truncated to 32-bit number under unicore32. Need append 'ULL' for it.

The related warning (with allmodconfig under unicore32):

CC [M] fs/ext4/extents_status.o
fs/ext4/extents_status.c: In function ‘__es_remove_extent’:
fs/ext4/extents_status.c:813: warning: integer constant is too large for ‘long’ type

Quoted 8 lines
Quoted 1 line

Thanks! This is failing on all 32-bit architectures.

Yes, it's harmless (since we don't actually check the value anywhere; this is just so humans could easily spot bugs when debugging), but I'll make sure this gets queued for 3.15 fixes in the ext4 tree.

Thanks!!

OK, thanks. Also thank for the related Application usage information.

Next, in open source, welcome to provide related Application usage information, when review my patches. It will be useful to evaluate my contributions (at least, it can let myself more clearer).

It will also be useful to me (in fact, for most of my patches, I am not familiar with the related Application's usage case).

Thanks.

Signature · 3 lines
Chen Gang

Open, share, and attitude like air, water, and life which God blessed