From e2e6f6fe07049f33cb6348780fa975162752e421 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 12 Dec 2013 13:38:32 +0100 Subject: initial commit of Enea Linux 3.1 Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau --- .../genext2fs-1.4.1/fix-nbblocks-cast.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 meta/recipes-devtools/genext2fs/genext2fs-1.4.1/fix-nbblocks-cast.patch (limited to 'meta/recipes-devtools/genext2fs/genext2fs-1.4.1/fix-nbblocks-cast.patch') diff --git a/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/fix-nbblocks-cast.patch b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/fix-nbblocks-cast.patch new file mode 100644 index 0000000000..05b095edf0 --- /dev/null +++ b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/fix-nbblocks-cast.patch @@ -0,0 +1,37 @@ + +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 + +Rebased by Dexuan Cui + +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) -- cgit v1.2.3-54-g00ecf