Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 260310 | Differences between
and this patch

Collapse All | Expand All

(-)a/acinclude.m4 (+1 lines)
Lines 773-778 case $AFS_SYSNAME in *_linux* | *_umlinux*) Link Here
773
                 LINUX_EXPORTS_SYS_OPEN
773
                 LINUX_EXPORTS_SYS_OPEN
774
                 LINUX_EXPORTS_SYS_WAIT4
774
                 LINUX_EXPORTS_SYS_WAIT4
775
		 LINUX_EXPORTS_RCU_READ_LOCK
775
		 LINUX_EXPORTS_RCU_READ_LOCK
776
		 LINUX_OPENVZ
776
		 LINUX_WHICH_MODULES
777
		 LINUX_WHICH_MODULES
777
                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
778
                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
778
                   AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
779
                   AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
(-)a/src/afs/LINUX/osi_groups.c (-1 / +4 lines)
Lines 646-652 void osi_keyring_init(void) Link Here
646
#  endif
646
#  endif
647
	    rcu_read_lock();
647
	    rcu_read_lock();
648
# endif
648
# endif
649
#if defined(EXPORTED_FIND_TASK_BY_PID)
649
650
#if defined(HAVE_OPENVZ)
651
	p = find_task_by_pid_all(1);
652
#elif defined(EXPORTED_FIND_TASK_BY_PID)
650
	p = find_task_by_pid(1);
653
	p = find_task_by_pid(1);
651
#else
654
#else
652
	p = find_task_by_vpid(1);
655
	p = find_task_by_vpid(1);
(-)a/src/afs/afs_osi.c (-11 / +4 lines)
Lines 853-871 afs_osi_TraverseProcTable() Link Here
853
	rcu_read_lock();
853
	rcu_read_lock();
854
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) */
854
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) */
855
855
856
#ifdef DEFINED_FOR_EACH_PROCESS
856
#if defined(HAVE_OPENVZ)
857
    for_each_process_all(p) if (p->pid) {
858
#elif defined(DEFINED_FOR_EACH_PROCESS)
857
    for_each_process(p) if (p->pid) {
859
    for_each_process(p) if (p->pid) {
858
#ifdef STRUCT_TASK_STRUCT_HAS_EXIT_STATE
859
	if (p->exit_state)
860
	    continue;
861
#else
862
	if (p->state & TASK_ZOMBIE)
863
	    continue;
864
#endif
865
	afs_GCPAGs_perproc_func(p);
866
    }
867
#else
860
#else
868
    for_each_task(p) if (p->pid) {
861
    for_each_task(p) if (p->pid) {
862
#endif
869
#ifdef STRUCT_TASK_STRUCT_HAS_EXIT_STATE
863
#ifdef STRUCT_TASK_STRUCT_HAS_EXIT_STATE
870
	if (p->exit_state)
864
	if (p->exit_state)
871
	    continue;
865
	    continue;
Lines 875-881 afs_osi_TraverseProcTable() Link Here
875
#endif
869
#endif
876
	afs_GCPAGs_perproc_func(p);
870
	afs_GCPAGs_perproc_func(p);
877
    }
871
    }
878
#endif
879
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK)
872
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK)
880
    if (&tasklist_lock)
873
    if (&tasklist_lock)
881
	read_unlock(&tasklist_lock);
874
	read_unlock(&tasklist_lock);
(-)a/src/cf/linux-test4.m4 (+16 lines)
Lines 1057-1059 AC_DEFUN([LINUX_HAVE_WRITE_BEGIN_AOP], [ Link Here
1057
  if test "x$ac_cv_linux_write_begin" = "xyes"; then
1057
  if test "x$ac_cv_linux_write_begin" = "xyes"; then
1058
    AC_DEFINE([HAVE_WRITE_BEGIN], 1, [define if your kernel has a write_begin() address space op])
1058
    AC_DEFINE([HAVE_WRITE_BEGIN], 1, [define if your kernel has a write_begin() address space op])
1059
  fi])
1059
  fi])
1060
1061
AC_DEFUN([LINUX_OPENVZ], [
1062
  AC_MSG_CHECKING([for linux OpenVZ project extensions])
1063
  AC_CACHE_VAL([ac_cv_linux_openvz], [
1064
    AC_TRY_KBUILD(
1065
[#include <linux/sched.h>
1066
#include <linux/delay.h>
1067
#include <linux/capability.h>
1068
#include <linux/ve.h>],
1069
[get_ve(NULL);],
1070
      ac_cv_linux_openvz=yes,
1071
      ac_cv_linux_openvz=no)])
1072
  AC_MSG_RESULT($ac_cv_linux_openvz)
1073
  if test "x$ac_cv_linux_openvz" = "xyes"; then
1074
    AC_DEFINE([HAVE_OPENVZ], 1, [define if your kernel have configured OpenVZ extensions])
1075
  fi])
(-)a/src/rx/LINUX/rx_knet.c (+19 lines)
Lines 102-107 osi_NetSend(osi_socket sop, struct sockaddr_in *to, struct iovec *iovec, Link Here
102
    struct msghdr msg;
102
    struct msghdr msg;
103
    int code;
103
    int code;
104
104
105
#ifdef HAVE_OPENVZ
106
    struct ve_struct *ve;
107
#endif
108
105
    msg.msg_iovlen = iovcnt;
109
    msg.msg_iovlen = iovcnt;
106
    msg.msg_iov = iovec;
110
    msg.msg_iov = iovec;
107
    msg.msg_name = to;
111
    msg.msg_name = to;
Lines 110-118 osi_NetSend(osi_socket sop, struct sockaddr_in *to, struct iovec *iovec, Link Here
110
    msg.msg_controllen = 0;
114
    msg.msg_controllen = 0;
111
    msg.msg_flags = 0;
115
    msg.msg_flags = 0;
112
116
117
#ifdef HAVE_OPENVZ
118
    ve = set_exec_env(get_ve0());
119
#endif
113
    TO_USER_SPACE();
120
    TO_USER_SPACE();
114
    code = sock_sendmsg(sop, &msg, size);
121
    code = sock_sendmsg(sop, &msg, size);
115
    TO_KERNEL_SPACE();
122
    TO_KERNEL_SPACE();
123
#ifdef HAVE_OPENVZ
124
    (void)set_exec_env(ve);
125
#endif
116
    return (code < 0) ? code : 0;
126
    return (code < 0) ? code : 0;
117
}
127
}
118
128
Lines 147-152 osi_NetReceive(osi_socket so, struct sockaddr_in *from, struct iovec *iov, Link Here
147
    int code;
157
    int code;
148
    struct iovec tmpvec[RX_MAXWVECS + 2];
158
    struct iovec tmpvec[RX_MAXWVECS + 2];
149
    struct socket *sop = (struct socket *)so;
159
    struct socket *sop = (struct socket *)so;
160
#ifdef HAVE_OPENVZ
161
    struct ve_struct *ve;
162
#endif
150
163
151
    if (iovcnt > RX_MAXWVECS + 2) {
164
    if (iovcnt > RX_MAXWVECS + 2) {
152
	osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", iovcnt);
165
	osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", iovcnt);
Lines 159-167 osi_NetReceive(osi_socket so, struct sockaddr_in *from, struct iovec *iov, Link Here
159
    msg.msg_controllen = 0;
172
    msg.msg_controllen = 0;
160
    msg.msg_flags = 0;
173
    msg.msg_flags = 0;
161
174
175
#ifdef HAVE_OPENVZ
176
    ve = set_exec_env(get_ve0());
177
#endif
162
    TO_USER_SPACE();
178
    TO_USER_SPACE();
163
    code = sock_recvmsg(sop, &msg, *lengthp, 0);
179
    code = sock_recvmsg(sop, &msg, *lengthp, 0);
164
    TO_KERNEL_SPACE();
180
    TO_KERNEL_SPACE();
181
#ifdef HAVE_OPENVZ
182
    (void)set_exec_env(ve);
183
#endif
165
184
166
    if (code < 0) {
185
    if (code < 0) {
167
#ifdef AFS_LINUX26_ENV
186
#ifdef AFS_LINUX26_ENV
(-)a/src/rx/rx_lwp.c (-2 / +30 lines)
Lines 428-434 rxi_Listen(osi_socket sock) Link Here
428
int
428
int
429
rxi_Recvmsg(int socket, struct msghdr *msg_p, int flags)
429
rxi_Recvmsg(int socket, struct msghdr *msg_p, int flags)
430
{
430
{
431
    return recvmsg((int)socket, msg_p, flags);
431
#ifdef HAVE_OPENVZ
432
	struct ve_struct *ve;
433
	int ret;
434
435
	ve = set_exec_env(get_ve0());
436
	ret = recvmsg((int)socket, msg_p, flags);
437
	(void)set_exec_env(ve);
438
439
	return ret;
440
#else
441
	return recvmsg((int)socket, msg_p, flags);
442
#endif
432
}
443
}
433
444
434
/*
445
/*
Lines 438-443 rxi_Recvmsg(int socket, struct msghdr *msg_p, int flags) Link Here
438
int
449
int
439
rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
450
rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
440
{
451
{
452
#ifdef HAVE_OPENVZ
453
	struct ve_struct *ve;
454
	ve = set_exec_env(get_ve0());
455
#endif
441
    fd_set *sfds = (fd_set *) 0;
456
    fd_set *sfds = (fd_set *) 0;
442
    while (sendmsg(socket, msg_p, flags) == -1) {
457
    while (sendmsg(socket, msg_p, flags) == -1) {
443
	int err;
458
	int err;
Lines 446-451 rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags) Link Here
446
	if (!sfds) {
461
	if (!sfds) {
447
	    if (!(sfds = IOMGR_AllocFDSet())) {
462
	    if (!(sfds = IOMGR_AllocFDSet())) {
448
		(osi_Msg "rx failed to alloc fd_set: ");
463
		(osi_Msg "rx failed to alloc fd_set: ");
464
#ifdef HAVE_OPENVZ
465
		(void)set_exec_env(ve);
466
#endif
449
		perror("rx_sendmsg");
467
		perror("rx_sendmsg");
450
		return -1;
468
		return -1;
451
	    }
469
	    }
Lines 465-478 rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags) Link Here
465
	{
483
	{
466
	    (osi_Msg "rx failed to send packet: ");
484
	    (osi_Msg "rx failed to send packet: ");
467
	    perror("rx_sendmsg");
485
	    perror("rx_sendmsg");
486
#ifdef HAVE_OPENVZ
487
		(void)set_exec_env(ve);
488
#endif
468
	    return -1;
489
	    return -1;
469
	}
490
	}
470
	while ((err = select(socket + 1, 0, sfds, 0, 0)) != 1) {
491
	while ((err = select(socket + 1, 0, sfds, 0, 0)) != 1) {
471
	    if (err >= 0 || errno != EINTR)
492
	    if (err >= 0 || errno != EINTR) {
493
#ifdef HAVE_OPENVZ
494
		(void)set_exec_env(ve);
495
#endif
472
		osi_Panic("rxi_sendmsg: select error %d.%d", err, errno);
496
		osi_Panic("rxi_sendmsg: select error %d.%d", err, errno);
497
	    }
473
	}
498
	}
474
    }
499
    }
475
    if (sfds)
500
    if (sfds)
476
	IOMGR_FreeFDSet(sfds);
501
	IOMGR_FreeFDSet(sfds);
502
#ifdef HAVE_OPENVZ
503
	(void)set_exec_env(ve);
504
#endif
477
    return 0;
505
    return 0;
478
}
506
}
(-)a/src/rx/rx_pthread.c (+14 lines)
Lines 401-407 int Link Here
401
rxi_Recvmsg(int socket, struct msghdr *msg_p, int flags)
401
rxi_Recvmsg(int socket, struct msghdr *msg_p, int flags)
402
{
402
{
403
    int ret;
403
    int ret;
404
#ifdef HAVE_OPENVZ
405
	struct ve_struct *ve;
406
	(void)set_exec_env(ve);
407
#endif
404
    ret = recvmsg(socket, msg_p, flags);
408
    ret = recvmsg(socket, msg_p, flags);
409
#ifdef HAVE_OPENVZ
410
	(void)set_exec_env(ve);
411
#endif
405
    return ret;
412
    return ret;
406
}
413
}
407
414
Lines 411-418 rxi_Recvmsg(int socket, struct msghdr *msg_p, int flags) Link Here
411
int
418
int
412
rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
419
rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
413
{
420
{
421
#ifdef HAVE_OPENVZ
422
	struct ve_struct *ve
423
	ve = set_exec_env(get_ve0());
424
#endif
414
    int ret;
425
    int ret;
415
    ret = sendmsg(socket, msg_p, flags);
426
    ret = sendmsg(socket, msg_p, flags);
427
#ifdef HAVE_OPENVZ
428
    (void)set_exec_env(ve);
429
#endif
416
#ifdef AFS_LINUX22_ENV
430
#ifdef AFS_LINUX22_ENV
417
    /* linux unfortunately returns ECONNREFUSED if the target port
431
    /* linux unfortunately returns ECONNREFUSED if the target port
418
     * is no longer in use */
432
     * is no longer in use */

Return to bug 260310