third_party_f2fs-tools/tools
Dylan Chang a84478b3a4 tools: fix file too large causing overflow
fibmap: Fix file too large causing file_pos overflow

fibmap show file_pos with incorrectly value when passing a large file.

Before:

----------------file info-------------------
/data/media/0/data1 :
--------------------------------------------
dev       [254:18]
ino       [0x    4db1 : 19889]
mode      [0x    81b0 : 33200]
nlink     [0x       1 : 1]
uid       [0x    280e : 10254]
gid       [0x     3ff : 1023]
size      [0x1b3dca314 : 7312548628]
blksize   [0x    1000 : 4096]
blocks    [0x  da2530 : 14296368]
--------------------------------------------

file_pos   start_blk     end_blk        blks
       0     3197602     3198463         862
 3530752     3197509     3197509           1
 3534848     3197557     3197578          22
 3624960     3198464     3396701      198238
815607808     3396703     3632480      235778
1781354496     3632482     3652095       19614
1861693440     3396702     3396702           1
1861697536     3632481     3632481           1
1861701632     1514948     1514948           1
1861705728     1518774     1518774           1
1861709824     2543104     2543125          22
...
1862111232     2457813     2457813           1
1862115328     3652096     3878168      226073
-1506856960     3878170     4133725      255556
-460099584     1510048     1510052           5

Patched:
----------------file info-------------------
/data/media/0/data1 :
--------------------------------------------
dev       [254:18]
ino       [0x    4db1 : 19889]
mode      [0x    81b0 : 33200]
nlink     [0x       1 : 1]
uid       [0x    280e : 10254]
gid       [0x     3ff : 1023]
size      [0x1b3dca314 : 7312548628]
blksize   [0x    1000 : 4096]
blocks    [0x  da2530 : 14296368]
--------------------------------------------

file_pos   start_blk     end_blk        blks
       0     3197602     3198463         862
 3530752     3197509     3197509           1
 3534848     3197557     3197578          22
 3624960     3198464     3396701      198238
815607808     3396703     3632480      235778
1781354496     3632482     3652095       19614
1861693440     3396702     3396702           1
1861697536     3632481     3632481           1
1861701632     1514948     1514948           1
1861705728     1518774     1518774           1
1861709824     2543104     2543125          22
...
1862111232     2457813     2457813           1
1862115328     3652096     3878168      226073
2788110336     3878170     4133725      255556
3834867712     1510048     1510052           5

Signed-off-by: Dylan Chang <dylan.chang@oneplus.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-04-15 11:29:16 +08:00
..
debug_tools f2fs_do_mount-dfx 2024-03-21 10:39:24 +08:00
f2fs_io Remove unnecessary config.h 2024-04-15 11:29:16 +08:00
sg_write_buffer Build successful,add one config.h and four BUILD.gn, modify seven files to relsove macro redefined,.Delete two Android.bp files.Add OAT related files,OAT.xml,README.OpenSource and README.md. 2021-12-15 10:45:47 +08:00
BUILD.gn f2fs-tools构建规范化整改 2023-06-21 09:25:04 +08:00
f2fs_io_parse.c f2fs-tools: fix a few spelling errors in f2fs-tools 2023-04-13 14:13:44 +08:00
f2fscrypt.8 f2fs-tools: fix a few spelling errors in f2fs-tools 2023-04-13 14:13:44 +08:00
f2fscrypt.c Remove unnecessary config.h 2024-04-15 11:29:16 +08:00
f2fstat.c f2fs-tools: Fix various compilation warnings 2019-03-23 18:59:24 +09:00
fibmap.c tools: fix file too large causing overflow 2024-04-15 11:29:16 +08:00
Makefile.am Fix the MinGW build 2023-04-13 14:13:49 +08:00
sha512.c Remove unnecessary config.h 2024-04-15 11:29:16 +08:00