Skip to content
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

Fix compilation errors #1124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ AC_CHECK_TYPES([struct file_handle],,,[
#include <fcntl.h>
])

AC_CHECK_TYPES([struct fs_quota_statv],,,[#include <xfs/xqm.h>])
AC_CHECK_TYPES([struct fs_quota_statv],,,[
#define _GNU_SOURCE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly you are trying to fix?

struct fs_quota_statv is not guarded by _GNU_SOURCE: https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/include/xqm.h. Therefore my system check for struct fs_quota_statv works as is (without _GNU_SOURCE).

Quoting your commit message:

Required as xfs/xqm.h uses fallocate() which is only defined when _GNU_SOURCE is defined.`

None of our quotactl tests use fallocate().

I see only musl defines fallocate64 when _GNU_SOURCE defined, but I don't see how this could be used here.

#if defined(_GNU_SOURCE)
#define fallocate64 fallocate
#endif

#include <xfs/xqm.h>
])
AC_CHECK_TYPES([struct if_nextdqblk],,,[#include <linux/quota.h>])
AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>])
AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>])
Expand Down
1 change: 1 addition & 0 deletions testcases/kernel/syscalls/quotactl/quotactl07.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* ("xfs: Sanity check flags of Q_XQUOTARM call").
*/

#define _GNU_SOURCE 1
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ char *simplePing(union u_argument *inVar, SVCXPRT * transp)
char *svc_getcaller_test(union u_argument *inVar, SVCXPRT * transp)
{
//In this function we test svc_getcaller function basically (simple call)
struct sockaddr_in *sa = NULL;
struct sockaddr *sa = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: IPv6 is not used at all, try to run rpc_test.sh with -6 and it fails, therefore this does not make sense unless you add rpc_test.sh support.

static int result;

sa = svc_getcaller(transp);
sa = (struct sockaddr *) svc_getcaller(transp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The casting would be needed in many RPC tests:

$ git grep -l sockaddr_in testcases/network/rpc/ | wc -l
39

It would make sense to fix them all (with sed or awk scripting to make editing fast).
FYI TI-RPC tests are in terrible shape (code duplicity, lots of compiler warnings, useless comments), but upstream does not care.

//If the result is not NULL we consider that function call succeeds
//so returns 0 (PASS)
result = (sa != NULL) ? 0 : 1;
Expand Down