aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2012-05-14 10:55:09 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-05-14 10:55:09 -0400
commit40024fdbafdf3875a0950e8fee5dd8bf69ea6b6c (patch)
tree7c41e39c8acb9cf173700119dbb26da332a044c2
parentce10c313e618826544779ec26432a6ffb0cbb684 (diff)
downloadandroid_external_e2fsprogs-40024fdbafdf3875a0950e8fee5dd8bf69ea6b6c.tar.gz
android_external_e2fsprogs-40024fdbafdf3875a0950e8fee5dd8bf69ea6b6c.tar.bz2
android_external_e2fsprogs-40024fdbafdf3875a0950e8fee5dd8bf69ea6b6c.zip
libext2fs: fix bug in unix_io corrupted > 16TB file systems on 32-bit systems
The code was assuming that "unsigned long" was 64-bit, which of course it isn't on 32-bit systems. This caused blocks to get written to the wrong place. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--lib/ext2fs/unix_io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 2ce05631..e66b5c8b 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -71,11 +71,11 @@
if ((struct)->magic != (code)) return (code)
struct unix_cache {
- char *buf;
- unsigned long block;
- int access_time;
- unsigned dirty:1;
- unsigned in_use:1;
+ char *buf;
+ unsigned long long block;
+ int access_time;
+ unsigned dirty:1;
+ unsigned in_use:1;
};
#define CACHE_SIZE 8