Skip to contentSkip to conversation

mkfs.f2fs: support formating large size file in 32-bits platform

PATCH New Chao Yu 1 participant 1 message Oct 17, 2018 Library code

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 mkfs.f2fs: support formating large size file in 32-bits platform

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.

---
 lib/libf2fs.c            | 1 +
 mkfs/f2fs_format_utils.c | 4 ++++
 2 files changed, 5 insertions(+)
lib/libf2fs.c +1 -0
index 8bda1fed082c..529f1caa4144 100644
@@ -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>
mkfs/f2fs_format_utils.c +4 -0
index 5b9cc0c6ac69..e620190df4b7 100644
@@ -16,6 +16,10 @@
 #define _GNU_SOURCE
 #endif
 
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+
 #include <f2fs_fs.h>
 
 #include <stdio.h>
Signature · 1 line
2.18.0.rc1