From: nathan Date: Wed, 29 Jul 2009 20:00:54 +0000 (+0000) Subject: b=19856 X-Git-Tag: v1_9_230~17 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=6e2be01b6bbc0fc7727ac0389ad01eb4c3eb3756 b=19856 fix various build issues, re-enable netlink configure check --- diff --git a/libcfs/libcfs/linux/linux-kernelcomm.c b/libcfs/libcfs/linux/linux-kernelcomm.c index 9845b6c..b7e1d49 100644 --- a/libcfs/libcfs/linux/linux-kernelcomm.c +++ b/libcfs/libcfs/linux/linux-kernelcomm.c @@ -57,6 +57,14 @@ #include +/* OFED backport #defines netlink_kernel_create with 6 args. + I haven't a clue why that header file gets included here, + but we must undo its mischief. */ +#ifdef BACKPORT_LINUX_NETLINK_H +#undef netlink_kernel_create +#endif + + /* Single Netlink Message type to send all Lustre messages */ #define LNL_MSG 26 diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 7f634ec..15fbe17 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1636,6 +1636,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_PERCPU_COUNTER LC_QUOTA64 LC_4ARGS_VFS_SYMLINK + LC_NETLINK # does the kernel have VFS intent patches? LC_VFS_INTENT_PATCHES @@ -2013,6 +2014,26 @@ LB_LINUX_TRY_COMPILE([ ]) # +# LC_NETLINK +# +# If we have netlink.h +# +AC_DEFUN([LC_NETLINK], +[LB_CHECK_FILE([$LINUX/include/net/netlink.h],[ + AC_MSG_CHECKING([if netlink.h can be compiled]) + LB_LINUX_TRY_COMPILE([ + #include + ],[],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_NETLINK, 1, [net/netlink.h found]) + ],[ + AC_MSG_RESULT([no]) + ]) +], +[]) +]) + +# # LC_CONFIGURE # # other configure checks diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index d7f65e3..87643f8 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -480,12 +480,14 @@ struct hsm_action_list { } __attribute__((packed)); /* Return pointer to first hai in action list */ -static inline struct hsm_action_item * hai_zero(struct hsm_action_list *hal) { +static __inline__ struct hsm_action_item * hai_zero(struct hsm_action_list *hal) +{ return (struct hsm_action_item *)(hal->hal_fsname + size_round(strlen(hal->hal_fsname))); } /* Return pointer to next hai */ -static inline struct hsm_action_item * hai_next(struct hsm_action_item *hai) { +static __inline__ struct hsm_action_item * hai_next(struct hsm_action_item *hai) +{ return (struct hsm_action_item *)((char *)hai + size_round(hai->hai_len)); } diff --git a/lustre/tests/copytool.c b/lustre/tests/copytool.c index a74fac3..c862426 100644 --- a/lustre/tests/copytool.c +++ b/lustre/tests/copytool.c @@ -47,15 +47,34 @@ */ #include +#include #include #include #include -int main() { +int main(int argc, char **argv) { + int c, test = 0; + struct option long_opts[] = { + {"test", no_argument, 0, 't'}, + {0, 0, 0, 0} + }; void *ctdata; int archive_nums[] = {1}; /* which archive numbers we care about */ int rc; + optind = 0; + while ((c = getopt_long(argc, argv, "t", long_opts, NULL)) != -1) { + switch (c) { + case 't': + test++; + break; + default: + fprintf(stderr, "error: %s: option '%s' unrecognized\n", + argv[0], argv[optind - 1]); + return -EINVAL; + } + } + rc = llapi_copytool_start(&ctdata, 0, ARRAY_SIZE(archive_nums), archive_nums); if (rc < 0) { @@ -64,6 +83,9 @@ int main() { return rc; } + if (test) + return llapi_copytool_fini(&ctdata); + printf("Waiting for message from kernel (pid=%d)\n", getpid()); while(1) { diff --git a/lustre/tests/mpi/lp_utils.c b/lustre/tests/mpi/lp_utils.c index ae7bd77..7f47b3d 100644 --- a/lustre/tests/mpi/lp_utils.c +++ b/lustre/tests/mpi/lp_utils.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "lustre/lustre_user.h" #include "lp_utils.h" @@ -94,7 +95,7 @@ inline void end(char *str) { timestamp(), str, elapsed / 60); } else { printf("%s:\tFinished %-15s(%.3f sec)\n", - timestamp(), str, elapsed); + timestamp(), str, elapsed); } fflush(stdout); diff --git a/lustre/tests/mpi/parallel_grouplock.c b/lustre/tests/mpi/parallel_grouplock.c index 3c63369..a2a6e86 100644 --- a/lustre/tests/mpi/parallel_grouplock.c +++ b/lustre/tests/mpi/parallel_grouplock.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include "lp_utils.h" @@ -251,7 +252,7 @@ void grouplock_test1(char *filename, int fd, int blocking_op, int unlock_op) filename, errno, strerror(errno)); FAIL(errmsg); } - + /* Wait for task1 to complete. */ iter = MAX_WAIT_TRIES; do { @@ -685,7 +686,7 @@ void grouplock_test4(char *filename, int fd) } } -/* +/* * task0 attempts GR(gid=1) -- granted * task1 attempts PR on non-blocking fd -> should return -EWOULDBLOCK * task2 attempts PW on non-blocking fd -> should return -EWOULDBLOCK @@ -796,7 +797,7 @@ void grouplock_errorstest(char *filename, int fd) "with errno %d instead of EINVAL\n", errno); FAIL(errmsg); - } + } } else { FAIL("Taking second GROUP lock on same fd succeed\n"); } @@ -808,7 +809,7 @@ void grouplock_errorstest(char *filename, int fd) "different gid failed with errno %d " "instead of EINVAL\n", errno); FAIL(errmsg); - } + } } else { FAIL("Taking second GROUP lock on same fd, with " "different gid, succeeded.\n"); @@ -821,7 +822,7 @@ void grouplock_errorstest(char *filename, int fd) "failed with errno %d instead of " "EINVAL\n", errno); FAIL(errmsg); - } + } } else { FAIL("GROUP unlock with wrong gid succeed\n"); } @@ -841,7 +842,7 @@ void grouplock_errorstest(char *filename, int fd) "fd failed with errno %d instead of " "EINVAL.\n", errno); FAIL(errmsg); - } + } } else { FAIL("GROUP unlock on never locked fd succeed\n"); } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 1e70847..f838a5f 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6376,7 +6376,8 @@ test_162() { run_test 162 "path lookup sanity" test_163() { - copytool & + copytool --test || { skip "copytool test: $? 38=enosys" && return; } + copytool & sleep 1 # this proc file is temporary and linux-only $LCTL set_param mdc.lustre-MDT0000-mdc-*.netlink=0 || error "lnl send failed"