Files
poky/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/fix-nbblocks-cast.patch
Dexuan Cui 79c806cb40 genext2fs: support large files and filesystems without using large amounts of memory
update_to_1.95.patch was generated by making a diff bewteen the 1.4.1 release
and the latest 1.9.5 version in the cvs repo:
http://genext2fs.cvs.sourceforge.net/viewvc/genext2fs/genext2fs/genext2fs.c?revision=1.95

The patches 0001-0019 come from mailing list of genext2fs-devel
http://sourceforge.net/mailarchive/forum.php?forum_name=genext2fs-devel&max_rows=100&style=flat&viewmonth=201106

(From OE-Core rev: 8f17e499cf91191727c8767e839738cb39c21655)

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-02 04:31:48 +01:00

38 lines
1.1 KiB
Diff

This patch fixes up the computation of nbinodes which would go
negative due to an int overflow issue when nbblocks > 2Meg for
a 2Gig or greater filesystem.
The computation is now done as a float equation, since both nbblocks
and bytes_per_inode are no floats, and then cast to int by assignment.
int tmp_nbinodes = nbblocks * BLOCKSIZE / bytes_per_inode;
Upstream-Status: Submitted
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Rebased by Dexuan Cui <dexuan.cui@intel.com>
Index: genext2fs-1.4.1/genext2fs.c
===================================================================
--- a/genext2fs.c 2012-03-29 00:07:20.308856017 +0800
+++ b/genext2fs.c 2012-03-29 00:09:06.848856005 +0800
@@ -3041,7 +3041,7 @@
int
main(int argc, char **argv)
{
- int nbblocks = -1;
+ float nbblocks = -1;
int nbinodes = -1;
int nbresrvd = -1;
float bytes_per_inode = -1;
@@ -3203,7 +3203,7 @@
}
if(fs_timestamp == -1)
fs_timestamp = time(NULL);
- fs = init_fs(nbblocks, nbinodes, nbresrvd, holes, fs_timestamp,
+ fs = init_fs((int)nbblocks, nbinodes, nbresrvd, holes, fs_timestamp,
bigendian, fsout);
}
if (volumelabel != NULL)