Patch for 2.1.127
Hi,
There seems to be a bug in 2.1.127 that causes kernel panic when the
kernel runs init. I think the reason is the interface changes in
do_select(), which did not propagate into alpha-specific code. The
patch below worked for me.
Nikita
--- linux-2.1.127/arch/alpha/kernel/osf_sys.c.orig Wed Nov 11 15:02:13 1998
+++ linux-2.1.127/arch/alpha/kernel/osf_sys.c Wed Nov 11 15:47:59 1998
@@ -1133,10 +1133,10 @@
struct timeval32 *tvp)
{
fd_set_buffer *fds;
- unsigned long timeout;
+ long timeout;
int ret;
- timeout = ~0UL;
+ timeout = MAX_SCHEDULE_TIMEOUT;
if (tvp) {
time_t sec, usec;
@@ -1147,8 +1147,6 @@
timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
timeout += sec * HZ;
- if (timeout)
- timeout += jiffies + 1;
}
ret = -ENOMEM;
@@ -1168,7 +1166,7 @@
zero_fd_set(n, fds->res_out);
zero_fd_set(n, fds->res_ex);
- ret = do_select(n, fds, timeout);
+ ret = do_select(n, fds, &timeout);
/* OSF does not copy back the remaining time. */
--- linux-2.1.127/arch/sparc64/kernel/sys_sparc32.c.orig Wed Nov 11 15:25:30 1998
+++ linux-2.1.127/arch/sparc64/kernel/sys_sparc32.c Wed Nov 11 15:47:59 1998
@@ -1110,10 +1110,11 @@
{
fd_set_buffer *fds;
struct timeval32 *tvp = (struct timeval32 *)AA(tvp_x);
- unsigned long timeout, nn;
+ long timeout;
+ unsigned long nn;
int ret;
- timeout = ~0UL;
+ timeout = MAX_SCHEDULE_TIMEOUT;
if (tvp) {
time_t sec, usec;
@@ -1124,8 +1125,6 @@
timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
timeout += sec * HZ;
- if (timeout)
- timeout += jiffies + 1;
}
ret = -ENOMEM;
@@ -1147,12 +1146,11 @@
zero_fd_set(n, fds->res_out);
zero_fd_set(n, fds->res_ex);
- ret = do_select(n, fds, timeout);
+ ret = do_select(n, fds, &timeout);
if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
- unsigned long timeout = current->timeout - jiffies - 1;
time_t sec = 0, usec = 0;
- if ((long) timeout > 0) {
+ if (timeout) {
sec = timeout / HZ;
usec = timeout % HZ;
usec *= (1000000/HZ);
@@ -1160,7 +1158,6 @@
put_user(sec, &tvp->tv_sec);
put_user(usec, &tvp->tv_usec);
}
- current->timeout = 0;
if (ret < 0)
goto out;
Reply to: