diff -u --recursive --new-file v2.1.91/linux/Makefile linux/Makefile --- v2.1.91/linux/Makefile Thu Mar 26 15:57:02 1998 +++ linux/Makefile Thu Mar 26 15:58:18 1998 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 91 +SUBLEVEL = 92 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) diff -u --recursive --new-file v2.1.91/linux/arch/i386/Makefile linux/arch/i386/Makefile --- v2.1.91/linux/arch/i386/Makefile Tue Mar 17 22:18:13 1998 +++ linux/arch/i386/Makefile Fri Mar 27 09:32:02 1998 @@ -93,6 +93,7 @@ @$(MAKEBOOT) BOOTIMAGE=bzImage install archclean: + rm -f .kernel_offset.lds @$(MAKEBOOT) clean archdep: diff -u --recursive --new-file v2.1.91/linux/drivers/block/nbd.c linux/drivers/block/nbd.c --- v2.1.91/linux/drivers/block/nbd.c Thu Mar 26 15:57:02 1998 +++ linux/drivers/block/nbd.c Fri Mar 27 09:37:42 1998 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -432,7 +433,7 @@ #endif blksize_size[MAJOR_NR] = nbd_blksizes; blk_size[MAJOR_NR] = nbd_sizes; - blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST; + blk_dev[MAJOR_NR].request_fn = do_nbd_request; for (i = 0; i < MAX_NBD; i++) { nbd_dev[i].refcnt = 0; nbd_dev[i].file = NULL; diff -u --recursive --new-file v2.1.91/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c --- v2.1.91/linux/drivers/char/tty_io.c Thu Mar 26 15:57:03 1998 +++ linux/drivers/char/tty_io.c Fri Mar 27 09:34:00 1998 @@ -1285,7 +1285,7 @@ } if ((tty->driver.type == TTY_DRIVER_TYPE_SERIAL) && (tty->driver.subtype == SERIAL_TYPE_CALLOUT)) { - printk("Warning, %s opened, is a deprecated tty " + printk(KERN_INFO "Warning, %s opened, is a deprecated tty " "callout device\n", tty_name(tty, buf)); } return 0; diff -u --recursive --new-file v2.1.91/linux/drivers/net/ppp.c linux/drivers/net/ppp.c --- v2.1.91/linux/drivers/net/ppp.c Tue Mar 17 22:18:14 1998 +++ linux/drivers/net/ppp.c Fri Mar 27 17:45:16 1998 @@ -8,7 +8,7 @@ * Dynamic PPP devices by Jim Freeman . * ppp_tty_receive ``noisy-raise-bug'' fixed by Ove Ewerlid * - * ==FILEVERSION 980123== + * ==FILEVERSION 980319== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the number above to the @@ -1326,6 +1326,10 @@ (*ppp->sc_rcomp->incomp) (ppp->sc_rc_state, data, count); } + } else if (proto == PPP_COMP && (ppp->flags & SC_DEBUG)) { + printk(KERN_DEBUG "ppp: frame not decompressed: " + "flags=%x, count=%d, sc_rc_state=%p\n", + ppp->flags, count, ppp->sc_rc_state); } /* * Process the uncompressed frame. @@ -1659,6 +1663,9 @@ } break; } + if (ppp->flags & SC_DEBUG) + printk(KERN_DEBUG "ppp_proto_ccp: %s code %d, flags=%x\n", + (rcvd? "rcvd": "sent"), CCP_CODE(dp), ppp->flags); restore_flags(flags); } @@ -1977,16 +1984,15 @@ (control == PPP_UI) && (proto != PPP_LCP) && (proto != PPP_CCP)) { - new_data = kmalloc (ppp->mtu, GFP_ATOMIC); + new_data = kmalloc (ppp->mtu + PPP_HDRLEN, GFP_ATOMIC); if (new_data == NULL) { - if (ppp->flags & SC_DEBUG) - printk (KERN_ERR - "ppp_dev_xmit_frame: no memory\n"); + printk (KERN_ERR "ppp_dev_xmit_frame: no memory\n"); return 1; } new_count = (*ppp->sc_xcomp->compress) - (ppp->sc_xc_state, data, new_data, count, ppp->mtu); + (ppp->sc_xc_state, data, new_data, count, + ppp->mtu + PPP_HDRLEN); if (new_count > 0 && (ppp->flags & SC_CCP_UP)) { ppp_dev_xmit_lower (ppp, buf, new_data, new_count, 0); @@ -2153,7 +2159,7 @@ } /* - * Process the BSD compression IOCTL event for the tty device. + * Process the set-compression ioctl. */ static int @@ -2187,7 +2193,7 @@ save_flags(flags); cli(); - ppp->flags &= ~(SC_COMP_RUN | SC_DECOMP_RUN); + ppp->flags &= ~(data.transmit? SC_COMP_RUN: SC_DECOMP_RUN); restore_flags(flags); cp = find_compressor (ccp_option[0]); @@ -2257,8 +2263,9 @@ unsigned int param2, unsigned long param3) { struct ppp *ppp = tty2ppp (tty); - register int temp_i = 0; + register int temp_i = 0, oldflags; int error = 0; + unsigned long flags; /* * Verify the status of the PPP device. */ @@ -2308,16 +2315,18 @@ if (error != 0) break; temp_i &= SC_MASK; - temp_i |= (ppp->flags & ~SC_MASK); - if ((ppp->flags & SC_CCP_OPEN) && - (temp_i & SC_CCP_OPEN) == 0) - ppp_ccp_closed (ppp); + if ((ppp->flags & SC_CCP_OPEN) && (temp_i & SC_CCP_OPEN) == 0) + ppp_ccp_closed(ppp); - if ((ppp->flags | temp_i) & SC_DEBUG) + save_flags(flags); + cli(); + oldflags = ppp->flags; + ppp->flags = temp_i |= (ppp->flags & ~SC_MASK); + restore_flags(flags); + if ((oldflags | temp_i) & SC_DEBUG) printk (KERN_INFO "ppp_tty_ioctl: set flags to %x\n", temp_i); - ppp->flags = temp_i; break; /* * Set the compression mode diff -u --recursive --new-file v2.1.91/linux/drivers/net/ppp_deflate.c linux/drivers/net/ppp_deflate.c --- v2.1.91/linux/drivers/net/ppp_deflate.c Fri Jan 30 11:28:07 1998 +++ linux/drivers/net/ppp_deflate.c Fri Mar 27 17:45:16 1998 @@ -1,5 +1,5 @@ /* - * ==FILEVERSION 971001== + * ==FILEVERSION 980319== * * ppp_deflate.c - interface the zlib procedures for Deflate compression * and decompression (as used by gzip) to the PPP code. @@ -188,20 +188,21 @@ struct ppp_deflate_state *state; int w_size; - MOD_INC_USE_COUNT; - if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len != CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || options[3] != DEFLATE_CHK_SEQUENCE) - goto out_fail; + return NULL; w_size = DEFLATE_SIZE(options[2]); if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) - goto out_fail; + return NULL; state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) - goto out_fail; + return NULL; + MOD_INC_USE_COUNT; memset (state, 0, sizeof (struct ppp_deflate_state)); state->strm.next_in = NULL; state->strm.zalloc = zalloc_init; @@ -217,7 +218,6 @@ out_free: z_comp_free(state); -out_fail: MOD_DEC_USE_COUNT; return NULL; } @@ -230,7 +230,8 @@ { struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; - if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len < CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || DEFLATE_SIZE(options[2]) != state->w_size @@ -264,7 +265,7 @@ int isize, osize; { struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; - int r, proto, off, olen; + int r, proto, off, olen, oavail; unsigned char *wptr; /* @@ -291,9 +292,10 @@ wptr += PPP_HDRLEN; wptr[0] = state->seqno >> 8; wptr[1] = state->seqno; - wptr += 2; + wptr += DEFLATE_OVHD; + olen = PPP_HDRLEN + DEFLATE_OVHD; state->strm.next_out = wptr; - state->strm.avail_out = osize - (PPP_HDRLEN + 2); + state->strm.avail_out = oavail = osize - olen; ++state->seqno; off = (proto > 0xff) ? 2 : 3; /* skip 1st proto byte if 0 */ @@ -301,25 +303,23 @@ state->strm.next_in = rptr; state->strm.avail_in = (isize - off); - olen = 0; for (;;) { r = deflate(&state->strm, Z_PACKET_FLUSH); if (r != Z_OK) { if (state->debug) - printk(KERN_DEBUG "z_compress: deflate returned %d (%s)\n", - r, (state->strm.msg? state->strm.msg: "")); + printk(KERN_ERR + "z_compress: deflate returned %d\n", r); break; } if (state->strm.avail_out == 0) { - olen += osize; + olen += oavail; state->strm.next_out = NULL; - state->strm.avail_out = 1000000; + state->strm.avail_out = oavail = 1000000; } else { break; /* all done */ } } - if (olen < osize) - olen += osize - state->strm.avail_out; + olen += oavail - state->strm.avail_out; /* * See if we managed to reduce the size of the packet. @@ -372,19 +372,21 @@ struct ppp_deflate_state *state; int w_size; - MOD_INC_USE_COUNT; - if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len != CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || options[3] != DEFLATE_CHK_SEQUENCE) - goto out_fail; + return NULL; w_size = DEFLATE_SIZE(options[2]); if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) - goto out_fail; + return NULL; state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) - goto out_fail; + return NULL; + + MOD_INC_USE_COUNT; memset (state, 0, sizeof (struct ppp_deflate_state)); state->w_size = w_size; state->strm.next_out = NULL; @@ -398,7 +400,6 @@ out_free: z_decomp_free(state); -out_fail: MOD_DEC_USE_COUNT; return NULL; } @@ -411,7 +412,8 @@ { struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; - if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE + if (opt_len < CILEN_DEFLATE + || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || DEFLATE_SIZE(options[2]) != state->w_size @@ -543,8 +545,12 @@ } } - if (decode_proto) + if (decode_proto) { + if (state->debug) + printk(KERN_DEBUG "z_decompress%d: didn't get proto\n", + state->unit); return DECOMP_ERROR; + } olen = osize + overflow - state->strm.avail_out; state->stats.unc_bytes += olen; @@ -634,6 +640,23 @@ z_comp_stats, /* decomp_stat */ }; +struct compressor ppp_deflate_draft = { + CI_DEFLATE_DRAFT, /* compress_proto */ + z_comp_alloc, /* comp_alloc */ + z_comp_free, /* comp_free */ + z_comp_init, /* comp_init */ + z_comp_reset, /* comp_reset */ + z_compress, /* compress */ + z_comp_stats, /* comp_stat */ + z_decomp_alloc, /* decomp_alloc */ + z_decomp_free, /* decomp_free */ + z_decomp_init, /* decomp_init */ + z_decomp_reset, /* decomp_reset */ + z_decompress, /* decompress */ + z_incomp, /* incomp */ + z_comp_stats, /* decomp_stat */ +}; + #ifdef MODULE /************************************************************* * Module support routines @@ -646,6 +669,7 @@ if (answer == 0) printk (KERN_INFO "PPP Deflate Compression module registered\n"); + ppp_register_compressor(&ppp_deflate_draft); return answer; } @@ -655,7 +679,9 @@ if (MOD_IN_USE) printk (KERN_INFO "Deflate Compression module busy, remove delayed\n"); - else + else { ppp_unregister_compressor (&ppp_deflate); + ppp_unregister_compressor (&ppp_deflate_draft); + } } #endif diff -u --recursive --new-file v2.1.91/linux/fs/ext2/file.c linux/fs/ext2/file.c --- v2.1.91/linux/fs/ext2/file.c Fri Jan 30 15:50:57 1998 +++ linux/fs/ext2/file.c Fri Mar 27 10:11:38 1998 @@ -219,6 +219,11 @@ count -= c; mark_buffer_uptodate(bh, 1); mark_buffer_dirty(bh, 0); + + /* Mark the buffer untouched if we'll move on to the next one.. */ + if (!(pos & (sb->s_blocksize-1))) + clear_bit(BH_Touched, &bh->b_state); + if (filp->f_flags & O_SYNC) bufferlist[buffercount++] = bh; else diff -u --recursive --new-file v2.1.91/linux/include/linux/if_ppp.h linux/include/linux/if_ppp.h --- v2.1.91/linux/include/linux/if_ppp.h Mon Jan 12 15:28:18 1998 +++ linux/include/linux/if_ppp.h Fri Mar 27 17:45:16 1998 @@ -65,7 +65,6 @@ #define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */ #define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */ #define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */ -#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */ #define SC_COMP_RUN 0x00001000 /* compressor has been inited */ #define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */ #define SC_DEBUG 0x00010000 /* enable debug messages */ @@ -73,12 +72,9 @@ #define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */ #define SC_LOG_RAWIN 0x00080000 /* log all chars received */ #define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */ -#define SC_MASK 0x0fE0ffff /* bits that user can change */ +#define SC_MASK 0x0f0000ff /* bits that user can change */ /* state bits */ -#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */ -#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */ -#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */ #define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */ #define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */ #define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */ diff -u --recursive --new-file v2.1.91/linux/include/linux/ppp-comp.h linux/include/linux/ppp-comp.h --- v2.1.91/linux/include/linux/ppp-comp.h Tue Dec 23 10:57:31 1997 +++ linux/include/linux/ppp-comp.h Fri Mar 27 17:45:16 1998 @@ -24,11 +24,11 @@ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. * - * $Id: ppp-comp.h,v 1.7 1995/05/01 01:43:37 paulus Exp $ + * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $ */ /* - * ==FILEVERSION 971024== + * ==FILEVERSION 980319== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the above date. @@ -173,7 +173,8 @@ * Definitions for Deflate. */ -#define CI_DEFLATE 24 /* config option for Deflate */ +#define CI_DEFLATE 26 /* config option for Deflate */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ #define CILEN_DEFLATE 4 /* length of its config option */ #define DEFLATE_MIN_SIZE 8 diff -u --recursive --new-file v2.1.91/linux/include/linux/skbuff.h linux/include/linux/skbuff.h --- v2.1.91/linux/include/linux/skbuff.h Thu Mar 26 15:57:06 1998 +++ linux/include/linux/skbuff.h Fri Mar 27 17:45:16 1998 @@ -461,12 +461,7 @@ if(skb->tail>skb->end) { __label__ here; -#if 1 - printk(KERN_DEBUG "skbput: over: %p:tail=%p:end=%p:len=%u\n", - &&here, skb->tail, skb->end, len); -#else panic(skb_put_errstr,&&here,len); -#endif here: ; } return tmp; diff -u --recursive --new-file v2.1.91/linux/kernel/kmod.c linux/kernel/kmod.c --- v2.1.91/linux/kernel/kmod.c Thu Mar 26 15:57:06 1998 +++ linux/kernel/kmod.c Fri Mar 27 09:49:37 1998 @@ -14,6 +14,7 @@ */ int kmod_unload_delay = 60; char modprobe_path[256] = "/sbin/modprobe"; +static int kmod_running = 0; static char module_name[64] = ""; static char * argv[] = { "modprobe", "-k", module_name, NULL, }; static char * envp[] = { "HOME=/", "TERM=linux", NULL, }; @@ -41,6 +42,7 @@ current->pgrp = 1; sprintf(current->comm, "kmod"); sigfillset(¤t->blocked); + kmod_running = 1; /* This is the main kmod_thread loop. It first sleeps, then @@ -133,6 +135,9 @@ the module into module_name. Once that is done, wake up kmod_thread. */ + if(!kmod_running) + return 0; + strncpy(module_name, name, sizeof(module_name)); module_name[sizeof(module_name)-1] = '\0'; wake_up(&kmod_queue); diff -u --recursive --new-file v2.1.91/linux/mm/page_alloc.c linux/mm/page_alloc.c --- v2.1.91/linux/mm/page_alloc.c Thu Mar 26 15:57:06 1998 +++ linux/mm/page_alloc.c Fri Mar 27 10:45:03 1998 @@ -126,7 +126,14 @@ { int retval = 0; unsigned long flags; - struct free_area_struct * list = NULL; + struct free_area_struct * list; + + /* + * If we have more than 25% of all memory free, + * consider it to be good enough for anything. + */ + if (nr_free_pages > num_physpages >> 2) + return nr+1; list = free_area + NR_MEM_LISTS; spin_lock_irqsave(&page_alloc_lock, flags); diff -u --recursive --new-file v2.1.91/linux/net/socket.c linux/net/socket.c --- v2.1.91/linux/net/socket.c Thu Mar 26 15:57:25 1998 +++ linux/net/socket.c Fri Mar 27 10:14:25 1998 @@ -1144,7 +1144,7 @@ unsigned char ctl[sizeof(struct cmsghdr) + 20]; /* 20 is size of ipv6_pktinfo */ unsigned char *ctl_buf = ctl; struct msghdr msg_sys; - int err, total_len; + int err, ctl_len, total_len; lock_kernel(); @@ -1161,16 +1161,16 @@ err = verify_iovec(&msg_sys, iov, address, VERIFY_READ); if (err < 0) goto out; - total_len=err; sock = sockfd_lookup(fd, &err); if (!sock) goto out_freeiov; - if (msg_sys.msg_controllen) + ctl_len = msg_sys.msg_controllen; + if (ctl_len) { - if (msg_sys.msg_controllen > sizeof(ctl)) + if (ctl_len > sizeof(ctl)) { /* Suggested by the Advanced Sockets API for IPv6 draft: * Limit the msg_controllen size by the SO_SNDBUF size. @@ -1179,15 +1179,13 @@ * SMP machines you have a race to fix here. */ err = -ENOBUFS; - ctl_buf = sock_kmalloc(sock->sk, msg_sys.msg_controllen, - GFP_KERNEL); + ctl_buf = sock_kmalloc(sock->sk, ctl_len, GFP_KERNEL); if (ctl_buf == NULL) - goto failed2; + goto out_put; } err = -EFAULT; - if (copy_from_user(ctl_buf, msg_sys.msg_control, - msg_sys.msg_controllen)) - goto failed; + if (copy_from_user(ctl_buf, msg_sys.msg_control, ctl_len)) + goto out_freectl; msg_sys.msg_control = ctl_buf; } msg_sys.msg_flags = flags; @@ -1196,10 +1194,10 @@ msg_sys.msg_flags |= MSG_DONTWAIT; err = sock_sendmsg(sock, &msg_sys, total_len); -failed: +out_freectl: if (ctl_buf != ctl) - sock_kfree_s(sock->sk, ctl_buf, msg_sys.msg_controllen); -failed2: + sock_kfree_s(sock->sk, ctl_buf, ctl_len); +out_put: sockfd_put(sock); out_freeiov: if (msg_sys.msg_iov != iov)