solution: ibcs-2.1-981105 on kernels >= 2.2.12

From: Christian Lademann (cal@zls.de)
Date: Fri Jan 07 2000 - 12:05:37 EST


The appended small patch fixed the oopses for me.

1. current->files->open_fds and current->files-> close_on_exec are
pointers since 2.2.12.
2. changed NR_OPEN to current->files->max_fdset at some places.

Christian.

--
*  Christian A. Lademann, ZLS Software GmbH               mailto:cal@zls.de
*  ZLS Software GmbH
*  Frankfurter Strasse 59       Postfach 1628             mailto:zls@zls.de
*  D-65779 Kelkheim             D-65766 Kelkheim          http://www.zls.de
*  Telefon +49-6195-9902-0      Telefax +49-6195-900600
*  Geschäftsführer John A. Shuter     -     Amtsgericht Königstein HRB 3105

diff -ruN ibcs-2.1-981105/iBCSemul/ioctl.c ibcs/iBCSemul/ioctl.c --- ibcs-2.1-981105/iBCSemul/ioctl.c Thu Nov 5 22:50:29 1998 +++ ibcs/iBCSemul/ioctl.c Fri Jan 7 17:58:00 2000 @@ -222,11 +222,19 @@ { switch (func) { case BSD__IOV('f', 1): case BSD__IO('f', 1): /* FIOCLEX */ +#if LINUX_VERSION_CODE < 0x02020c /* less than 2.2.12 */ FD_SET(fd, &current->files->close_on_exec); +#else + FD_SET(fd, current->files->close_on_exec); +#endif return 0; case BSD__IOV('f', 2): case BSD__IO('f', 2): /* FIONCLEX */ +#if LINUX_VERSION_CODE < 0x02020c /* less than 2.2.12 */ FD_CLR(fd, &current->files->close_on_exec); +#else + FD_CLR(fd, current->files->close_on_exec); +#endif return 0; case BSD__IOV('f', 3): case BSD__IO('f', 3): { /* FIORDCHK */ diff -ruN ibcs-2.1-981105/iBCSemul/open.c ibcs/iBCSemul/open.c --- ibcs-2.1-981105/iBCSemul/open.c Sun Aug 16 18:34:08 1998 +++ ibcs/iBCSemul/open.c Fri Jan 7 17:28:58 2000 @@ -554,8 +554,13 @@ */ case 8: /* F_GETHFDO */ if (arg1 == -1) +#if LINUX_VERSION_CODE < 0x02020c /* less than 2.2.12 */ return find_first_zero_bit(&current->files->open_fds, NR_OPEN); +#else + return find_first_zero_bit(current->files->open_fds->fds_bits, + current->files->max_fdset); +#endif /* else fall through to fail */ #else /* The following are defined but reserved and unknown. */ diff -ruN ibcs-2.1-981105/iBCSemul/socksys.c ibcs/iBCSemul/socksys.c --- ibcs-2.1-981105/iBCSemul/socksys.c Thu Nov 5 22:50:29 1998 +++ ibcs/iBCSemul/socksys.c Fri Jan 7 17:58:58 2000 @@ -409,7 +409,11 @@ */ if (ino && !ino->i_sock) { int fd; +#if LINUX_VERSION_CODE < 0x02020c /* less than 2.2.12 */ for (fd=0; fd<NR_OPEN; fd++) { +#else + for (fd=0; fd<current->files->max_fdset; fd++) { +#endif if (fcheck(fd) == filep) { int error; error = ibcs_socksys_fd_init(fd, 0, NULL, NULL); @@ -438,7 +442,11 @@ */ if (ino && !ino->i_sock) { int fd; +#if LINUX_VERSION_CODE < 0x02020c /* less than 2.2.12 */ for (fd=0; fd<NR_OPEN; fd++) { +#else + for (fd=0; fd<current->files->max_fdset; fd++) { +#endif if (fcheck(fd) == filep) { int error; error = ibcs_socksys_fd_init(fd, 1, buf, &count);

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:09 EST