mkfs.f2fs: support formating large size file in 32-bits platform
authorChao Yu <yuchao0@huawei.com>
Wed, 17 Oct 2018 01:40:56 +0000 (09:40 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 21 Nov 2018 19:38:23 +0000 (11:38 -0800)
In 32-bits platform, {f,}stat on a large size file during mkfs, it will
cause EOVERFLOW error, this patch fixes to add macro definition
_FILE_OFFSET_BITS to avoid that error.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
lib/libf2fs.c
mkfs/f2fs_format_utils.c

index a1f8beb..fd3e006 100644 (file)
@@ -7,6 +7,7 @@
  * Dual licensed under the GPL or LGPL version 2 licenses.
  */
 #define _LARGEFILE64_SOURCE
+#define _FILE_OFFSET_BITS 64
 
 #include <f2fs_fs.h>
 #include <stdio.h>
index bf9ffbd..2c901f2 100644 (file)
 #define _GNU_SOURCE
 #endif
 
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+
 #include <f2fs_fs.h>
 
 #include <stdio.h>