-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There was a error when building zfs #5101
Conversation
if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, | ||
start_off, off_len) < 0) { | ||
perror("fallocate"); | ||
return (1); | ||
} | ||
#endif /* defined(FALLOC_FL_PUNCH_HOLE) && defined(FALLOC_FL_KEEP_SIZE) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does fix the build issue but it also silently breaks this utility for older kernels. Let's add an #else
case to the conditional to print an error message along the lines of "FALLOC_FL_PUNCH_HOLE unsupported" and return (1);
to indicate an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your advice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have submitted the same code twice, but the CI has different failures log , why? The CI environment is unstable? Please help me, thank you @behlendorf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please just address the inline comments.
202778f
to
cae428f
Compare
issues: zfs build randfree_file.c: In function ‘main’: randfree_file.c:101: error: ‘FALLOC_FL_PUNCH_HOLE’ undeclared (first use in this function) solution: The FALLOC_FL_PUNCH_HOLE flag was introduced in the 2.6.38 kernel. So we need add the "#if #else #endif" for older kernel.
Unfortunately, we do still have some occasional test failures in the CI environment. We're working to improve that but for the moment there are still problems. If you do get a failure I'd suggest looking at the open issues marked with the Test Suite label to determine if it's a known issue. For example, your Ubuntu 14.04 failure was due to issue #4034, I've opened #5120 to disable the offending test case for now since it's a long standing issue which has suddenly before more frequent. It would be great if you could review the #5120 PR. As for this patch, it's definitely not causing any of these failures so I'll get it merged. |
Thanks so much for your suggestion. I will continue to focus on this issue, and the test case. @behlendorf |
issues:
zfs build
./configure --with-spl=/home/liuhua/OpenZFS/spl-master913/spl-master/
make -s -j$(nproc)
randfree_file.c: In function ‘main’:
randfree_file.c:101: error: ‘FALLOC_FL_PUNCH_HOLE’ undeclared (first use in this function)
randfree_file.c:101: error: (Each undeclared identifier is reported only once
randfree_file.c:101: error: for each function it appears in.)
make[5]: *** [randfree_file.o] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
The FALLOC_FL_PUNCH_HOLE flag was introduced in the 2.6.38 kernel. So we need add the "#if...#endif" when linux kernel is 2.6.33.20.