[GH-ISSUE #1590] 升级s3fs报错 #832

Closed
opened 2026-03-04 01:49:11 +03:00 by kerem · 4 comments
Owner

Originally created by @zhangyn1 on GitHub (Mar 2, 2021).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1590

make  all-recursive
make[1]: Entering directory `/tmp/s3fs-fuse-1.88'
Making all in src
make[2]: Entering directory `/tmp/s3fs-fuse-1.88/src'
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2      -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_entity.o -MD -MP -MF .deps/fdcache_entity.Tpo -c -o fdcache_entity.o fdcache_entity.cpp
fdcache_entity.cpp: In member function ‘bool FdEntity::PunchHole(off_t, size_t)’:
fdcache_entity.cpp:1652:31: error: ‘FALLOC_FL_PUNCH_HOLE’ was not declared in this scope
         if(0 != fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, iter->offset, iter->bytes)){
                               ^
fdcache_entity.cpp:1652:54: error: ‘FALLOC_FL_KEEP_SIZE’ was not declared in this scope
         if(0 != fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, iter->offset, iter->bytes)){
                                                      ^
make[2]: *** [fdcache_entity.o] Error 1
make[2]: Leaving directory `/tmp/s3fs-fuse-1.88/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/s3fs-fuse-1.88'
make: *** [all] Error 2
Originally created by @zhangyn1 on GitHub (Mar 2, 2021). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1590 ``` make all-recursive make[1]: Entering directory `/tmp/s3fs-fuse-1.88' Making all in src make[2]: Entering directory `/tmp/s3fs-fuse-1.88/src' g++ -DHAVE_CONFIG_H -I. -I.. -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_entity.o -MD -MP -MF .deps/fdcache_entity.Tpo -c -o fdcache_entity.o fdcache_entity.cpp fdcache_entity.cpp: In member function ‘bool FdEntity::PunchHole(off_t, size_t)’: fdcache_entity.cpp:1652:31: error: ‘FALLOC_FL_PUNCH_HOLE’ was not declared in this scope if(0 != fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, iter->offset, iter->bytes)){ ^ fdcache_entity.cpp:1652:54: error: ‘FALLOC_FL_KEEP_SIZE’ was not declared in this scope if(0 != fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, iter->offset, iter->bytes)){ ^ make[2]: *** [fdcache_entity.o] Error 1 make[2]: Leaving directory `/tmp/s3fs-fuse-1.88/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/s3fs-fuse-1.88' make: *** [all] Error 2 ```
kerem closed this issue 2026-03-04 01:49:11 +03:00
Author
Owner

@gaul commented on GitHub (Mar 3, 2021):

Which operating system do you run on? Did you run autogen.sh and configure? It appears your system has fallocate but not the FALLOC_FL_PUNCH_HOLE and FALLOC_FL_KEEP_SIZE defines.

@ggtakec maybe the autoconf logic is incomplete?

<!-- gh-comment-id:789671208 --> @gaul commented on GitHub (Mar 3, 2021): Which operating system do you run on? Did you run `autogen.sh` and `configure`? It appears your system has `fallocate` but not the `FALLOC_FL_PUNCH_HOLE` and `FALLOC_FL_KEEP_SIZE` defines. @ggtakec maybe the autoconf logic is incomplete?
Author
Owner

@Navi2016 commented on GitHub (Apr 1, 2021):

Hi,

Having the same issue on CentOS 6.10 Kernel 2.6.32-754.35.1.el6.x86_64. glibc 2.12-1.212.el6_10.3

I did run autogen.sh and configure, followed this manual: (see step 5)
https://geektnt.com/how-to-instal-s3fs-fuse-on-centos-6-8.html

They ran fine. Make install ends with:

g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2      -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache.o -MD -MP -MF .deps/fdcache.Tpo -c -o fdcache.o fdcache.cpp
mv -f .deps/fdcache.Tpo .deps/fdcache.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2      -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_entity.o -MD -MP -MF .deps/fdcache_entity.Tpo -c -o fdcache_entity.o fdcache_entity.cpp
fdcache_entity.cpp: In member function bool FdEntity::PunchHole(off_t, size_t):
fdcache_entity.cpp:1656: error: FALLOC_FL_PUNCH_HOLE was not declared in this scope
fdcache_entity.cpp:1656: error: FALLOC_FL_KEEP_SIZE was not declared in this scope
make[2]: *** [fdcache_entity.o] Error 1
make[2]: Leaving directory /usr/local/src/s3fs-fuse/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory /usr/local/src/s3fs-fuse'
make: *** [all] Error 2

My system has fallocate installed.

Update 1:
bottom of this page:
https://stackoverflow.com/questions/9995093/how-to-make-holes-in-file-to-erase-data-by-c-in-linux

Reads:
The FALLOC_FL_* flags are defined in glibc headers only since version 2.18.

So it appears my glibc version is too old!

Update 2:
I fixed this by adding:

// Constants are defined in glibc >= 2.18
#define FALLOC_FL_KEEP_SIZE    0x1
#define FALLOC_FL_PUNCH_HOLE   0x2

to the top of src/fdcache_entity.h

Seems to compile and work now..

<!-- gh-comment-id:811786844 --> @Navi2016 commented on GitHub (Apr 1, 2021): Hi, Having the same issue on CentOS 6.10 Kernel 2.6.32-754.35.1.el6.x86_64. glibc 2.12-1.212.el6_10.3 I did run autogen.sh and configure, followed this manual: (see step 5) https://geektnt.com/how-to-instal-s3fs-fuse-on-centos-6-8.html They ran fine. Make install ends with: ``` g++ -DHAVE_CONFIG_H -I. -I.. -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache.o -MD -MP -MF .deps/fdcache.Tpo -c -o fdcache.o fdcache.cpp mv -f .deps/fdcache.Tpo .deps/fdcache.Po g++ -DHAVE_CONFIG_H -I. -I.. -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_entity.o -MD -MP -MF .deps/fdcache_entity.Tpo -c -o fdcache_entity.o fdcache_entity.cpp fdcache_entity.cpp: In member function bool FdEntity::PunchHole(off_t, size_t): fdcache_entity.cpp:1656: error: FALLOC_FL_PUNCH_HOLE was not declared in this scope fdcache_entity.cpp:1656: error: FALLOC_FL_KEEP_SIZE was not declared in this scope make[2]: *** [fdcache_entity.o] Error 1 make[2]: Leaving directory /usr/local/src/s3fs-fuse/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /usr/local/src/s3fs-fuse' make: *** [all] Error 2 ``` My system has fallocate installed. **Update 1:** bottom of this page: https://stackoverflow.com/questions/9995093/how-to-make-holes-in-file-to-erase-data-by-c-in-linux Reads: The FALLOC_FL_* flags are defined in glibc headers only since version 2.18. So it appears my glibc version is too old! **Update 2:** I fixed this by adding: ``` // Constants are defined in glibc >= 2.18 #define FALLOC_FL_KEEP_SIZE 0x1 #define FALLOC_FL_PUNCH_HOLE 0x2 ``` to the top of src/fdcache_entity.h Seems to compile and work now..
Author
Owner

@gaul commented on GitHub (Apr 1, 2021):

@ggtakec Can you add some autoconf magic for this?

<!-- gh-comment-id:811804979 --> @gaul commented on GitHub (Apr 1, 2021): @ggtakec Can you add some autoconf magic for this?
Author
Owner

@ggtakec commented on GitHub (Apr 21, 2021):

Sorry for my late reply.
I issued PR #1628 for this bug.
Changed to define these undefined symbols in the file when there is no fallocate function or before Linux 2.6.38.

<!-- gh-comment-id:824097299 --> @ggtakec commented on GitHub (Apr 21, 2021): Sorry for my late reply. I issued PR #1628 for this bug. Changed to define these undefined symbols in the file when there is no fallocate function or before Linux 2.6.38.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#832
No description provided.