diff -u --recursive --new-file v2.2.3/linux/arch/i386/kernel/i386_ksyms.c linux/arch/i386/kernel/i386_ksyms.c --- v2.2.3/linux/arch/i386/kernel/i386_ksyms.c Tue Feb 23 15:21:32 1999 +++ linux/arch/i386/kernel/i386_ksyms.c Wed Mar 10 15:07:19 1999 @@ -75,8 +75,11 @@ EXPORT_SYMBOL(cpu_data); EXPORT_SYMBOL(kernel_flag); EXPORT_SYMBOL(smp_invalidate_needed); +EXPORT_SYMBOL(cpu_number_map); EXPORT_SYMBOL(__cpu_logical_map); EXPORT_SYMBOL(smp_num_cpus); +EXPORT_SYMBOL(cpu_present_map); +EXPORT_SYMBOL(cpu_online_map); /* Global SMP irq stuff */ EXPORT_SYMBOL(synchronize_irq); diff -u --recursive --new-file v2.2.3/linux/drivers/block/nbd.c linux/drivers/block/nbd.c --- v2.2.3/linux/drivers/block/nbd.c Wed Mar 10 15:29:45 1999 +++ linux/drivers/block/nbd.c Tue Mar 9 16:58:05 1999 @@ -418,7 +418,7 @@ return 0; #endif case BLKGETSIZE: - return put_user(nbd_bytesizes[dev] << 9, (long *) arg); + return put_user(nbd_bytesizes[dev] >> 9, (long *) arg); } return -EINVAL; } diff -u --recursive --new-file v2.2.3/linux/fs/autofs/root.c linux/fs/autofs/root.c --- v2.2.3/linux/fs/autofs/root.c Tue Feb 23 15:21:34 1999 +++ linux/fs/autofs/root.c Wed Mar 10 15:07:56 1999 @@ -281,7 +281,7 @@ autofs_say(dentry->d_name.name,dentry->d_name.len); if ( !autofs_oz_mode(sbi) ) - return -EPERM; + return -EACCES; if ( dentry->d_name.len > NAME_MAX ) return -ENAMETOOLONG; @@ -349,17 +349,20 @@ struct autofs_dir_ent *ent; unsigned int n; - if ( !autofs_oz_mode(sbi) ) - return -EPERM; + /* This allows root to remove symlinks */ + if ( !autofs_oz_mode(sbi) && !capable(CAP_SYS_ADMIN) ) + return -EACCES; ent = autofs_hash_lookup(dh, &dentry->d_name); if ( !ent ) return -ENOENT; n = ent->ino - AUTOFS_FIRST_SYMLINK; - if ( n >= AUTOFS_MAX_SYMLINKS || !test_bit(n,sbi->symlink_bitmap) ) - return -EINVAL; /* Not a symlink inode, can't unlink */ - + if ( n >= AUTOFS_MAX_SYMLINKS ) + return -EISDIR; /* It's a directory, dummy */ + if ( !test_bit(n,sbi->symlink_bitmap) ) + return -EINVAL; /* Nonexistent symlink? Shouldn't happen */ + dentry->d_time = (unsigned long)(struct autofs_dirhash *)NULL; autofs_hash_delete(ent); clear_bit(n,sbi->symlink_bitmap); @@ -376,7 +379,7 @@ struct autofs_dir_ent *ent; if ( !autofs_oz_mode(sbi) ) - return -EPERM; + return -EACCES; ent = autofs_hash_lookup(dh, &dentry->d_name); if ( !ent ) @@ -405,7 +408,7 @@ ino_t ino; if ( !autofs_oz_mode(sbi) ) - return -EPERM; + return -EACCES; if ( dentry->d_name.len > NAME_MAX ) return -ENAMETOOLONG; diff -u --recursive --new-file v2.2.3/linux/fs/buffer.c linux/fs/buffer.c --- v2.2.3/linux/fs/buffer.c Wed Mar 10 15:29:49 1999 +++ linux/fs/buffer.c Tue Mar 9 09:45:14 1999 @@ -862,20 +862,17 @@ */ struct buffer_head * bread(kdev_t dev, int block, int size) { - struct buffer_head * bh = getblk(dev, block, size); + struct buffer_head * bh; - if (bh) { - touch_buffer(bh); - if (buffer_uptodate(bh)) - return bh; - ll_rw_block(READ, 1, &bh); - wait_on_buffer(bh); - if (buffer_uptodate(bh)) - return bh; - brelse(bh); - return NULL; - } - printk("VFS: bread: impossible error\n"); + bh = getblk(dev, block, size); + touch_buffer(bh); + if (buffer_uptodate(bh)) + return bh; + ll_rw_block(READ, 1, &bh); + wait_on_buffer(bh); + if (buffer_uptodate(bh)) + return bh; + brelse(bh); return NULL; } @@ -899,9 +896,10 @@ if (pos >= filesize) return NULL; - if (block < 0 || !(bh = getblk(dev,block,bufsize))) + if (block < 0) return NULL; + bh = getblk(dev, block, bufsize); index = BUFSIZE_INDEX(bh->b_size); touch_buffer(bh); diff -u --recursive --new-file v2.2.3/linux/fs/ext2/inode.c linux/fs/ext2/inode.c --- v2.2.3/linux/fs/ext2/inode.c Thu May 7 22:51:53 1998 +++ linux/fs/ext2/inode.c Wed Mar 10 10:42:56 1999 @@ -697,7 +697,7 @@ if (buffer_req(bh) && !buffer_uptodate(bh)) { printk ("IO error syncing ext2 inode [" "%s:%08lx]\n", - kdevname(inode->i_dev), inode->i_ino); + bdevname(inode->i_dev), inode->i_ino); err = -EIO; } } diff -u --recursive --new-file v2.2.3/linux/fs/ext2/super.c linux/fs/ext2/super.c --- v2.2.3/linux/fs/ext2/super.c Sun Nov 8 14:03:05 1998 +++ linux/fs/ext2/super.c Wed Mar 10 11:04:27 1999 @@ -56,9 +56,9 @@ (le16_to_cpu(sb->u.ext2_sb.s_es->s_errors) == EXT2_ERRORS_PANIC && !test_opt (sb, ERRORS_CONT) && !test_opt (sb, ERRORS_RO))) panic ("EXT2-fs panic (device %s): %s: %s\n", - kdevname(sb->s_dev), function, error_buf); + bdevname(sb->s_dev), function, error_buf); printk (KERN_CRIT "EXT2-fs error (device %s): %s: %s\n", - kdevname(sb->s_dev), function, error_buf); + bdevname(sb->s_dev), function, error_buf); if (test_opt (sb, ERRORS_RO) || (le16_to_cpu(sb->u.ext2_sb.s_es->s_errors) == EXT2_ERRORS_RO && !test_opt (sb, ERRORS_CONT) && !test_opt (sb, ERRORS_PANIC))) { @@ -87,7 +87,7 @@ sb->s_lock=0; sb->s_flags |= MS_RDONLY; panic ("EXT2-fs panic (device %s): %s: %s\n", - kdevname(sb->s_dev), function, error_buf); + bdevname(sb->s_dev), function, error_buf); } void ext2_warning (struct super_block * sb, const char * function, @@ -99,7 +99,7 @@ vsprintf (error_buf, fmt, args); va_end (args); printk (KERN_WARNING "EXT2-fs warning (device %s): %s: %s\n", - kdevname(sb->s_dev), function, error_buf); + bdevname(sb->s_dev), function, error_buf); } void ext2_put_super (struct super_block * sb) @@ -444,7 +444,7 @@ if (sb->s_magic != EXT2_SUPER_MAGIC) { if (!silent) printk ("VFS: Can't find an ext2 filesystem on dev " - "%s.\n", kdevname(dev)); + "%s.\n", bdevname(dev)); failed_mount: sb->s_dev = 0; unlock_super (sb); @@ -457,14 +457,14 @@ if (le32_to_cpu(es->s_feature_incompat) & ~EXT2_FEATURE_INCOMPAT_SUPP) { printk("EXT2-fs: %s: couldn't mount because of " "unsupported optional features.\n", - kdevname(dev)); + bdevname(dev)); goto failed_mount; } if (!(sb->s_flags & MS_RDONLY) && (le32_to_cpu(es->s_feature_ro_compat) & ~EXT2_FEATURE_RO_COMPAT_SUPP)) { printk("EXT2-fs: %s: couldn't mount RDWR because of " "unsupported optional features.\n", - kdevname(dev)); + bdevname(dev)); goto failed_mount; } } @@ -553,13 +553,13 @@ if (!silent) printk ("VFS: Can't find an ext2 filesystem on dev " "%s.\n", - kdevname(dev)); + bdevname(dev)); goto failed_mount; } if (sb->s_blocksize != bh->b_size) { if (!silent) printk ("VFS: Unsupported blocksize on dev " - "%s.\n", kdevname(dev)); + "%s.\n", bdevname(dev)); goto failed_mount; } diff -u --recursive --new-file v2.2.3/linux/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c --- v2.2.3/linux/fs/ncpfs/inode.c Mon Dec 28 15:00:52 1998 +++ linux/fs/ncpfs/inode.c Wed Mar 10 15:16:58 1999 @@ -472,7 +472,7 @@ goto out; if (((attr->ia_valid & ATTR_GID) && - (attr->ia_uid != NCP_SERVER(inode)->m.gid))) + (attr->ia_gid != NCP_SERVER(inode)->m.gid))) goto out; if (((attr->ia_valid & ATTR_MODE) && diff -u --recursive --new-file v2.2.3/linux/fs/open.c linux/fs/open.c --- v2.2.3/linux/fs/open.c Tue Feb 23 15:21:34 1999 +++ linux/fs/open.c Tue Mar 9 08:54:34 1999 @@ -751,12 +751,7 @@ */ asmlinkage int sys_creat(const char * pathname, int mode) { - int ret; - - lock_kernel(); - ret = sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); - unlock_kernel(); - return ret; + return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); } #endif diff -u --recursive --new-file v2.2.3/linux/include/linux/genhd.h linux/include/linux/genhd.h --- v2.2.3/linux/include/linux/genhd.h Mon Dec 28 15:00:53 1998 +++ linux/include/linux/genhd.h Wed Mar 10 15:16:13 1999 @@ -10,6 +10,7 @@ */ #include +#include #define CONFIG_MSDOS_PARTITION 1 diff -u --recursive --new-file v2.2.3/linux/include/net/tcp.h linux/include/net/tcp.h --- v2.2.3/linux/include/net/tcp.h Tue Feb 23 15:21:35 1999 +++ linux/include/net/tcp.h Wed Mar 10 15:17:18 1999 @@ -487,9 +487,7 @@ extern int tcp_v4_rcv(struct sk_buff *skb, unsigned short len); -extern int tcp_do_sendmsg(struct sock *sk, - int iovlen, struct iovec *iov, - int flags); +extern int tcp_do_sendmsg(struct sock *sk, struct msghdr *msg); extern int tcp_ioctl(struct sock *sk, int cmd, @@ -808,6 +806,23 @@ (tcp_packets_in_flight(tp) < tp->snd_cwnd) && !after(TCP_SKB_CB(skb)->end_seq, tp->snd_una + tp->snd_wnd) && tp->retransmits == 0); +} + +/* Push out any pending frames which were held back due to + * TCP_CORK or attempt at coalescing tiny packets. + * The socket must be locked by the caller. + */ +static __inline__ void tcp_push_pending_frames(struct sock *sk, struct tcp_opt *tp) +{ + if(tp->send_head) { + if(tcp_snd_test(sk, tp->send_head)) + tcp_write_xmit(sk); + else if(tp->packets_out == 0 && !tp->pending) { + /* We held off on this in tcp_send_skb() */ + tp->pending = TIME_PROBE0; + tcp_reset_xmit_timer(sk, TIME_PROBE0, tp->rto); + } + } } /* This tells the input processing path that an ACK should go out diff -u --recursive --new-file v2.2.3/linux/net/ipv4/arp.c linux/net/ipv4/arp.c --- v2.2.3/linux/net/ipv4/arp.c Wed Mar 10 15:29:52 1999 +++ linux/net/ipv4/arp.c Tue Mar 9 22:32:43 1999 @@ -1,6 +1,6 @@ /* linux/net/inet/arp.c * - * Version: $Id: arp.c,v 1.75 1998/11/16 04:51:56 davem Exp $ + * Version: $Id: arp.c,v 1.76 1999/03/09 14:10:07 davem Exp $ * * Copyright (C) 1994 by Florian La Roche * diff -u --recursive --new-file v2.2.3/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c --- v2.2.3/linux/net/ipv4/tcp.c Wed Mar 10 15:29:52 1999 +++ linux/net/ipv4/tcp.c Wed Mar 10 10:39:21 1999 @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp.c,v 1.136 1999/03/07 13:26:01 davem Exp $ + * Version: $Id: tcp.c,v 1.137 1999/03/10 08:56:36 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -735,18 +735,25 @@ * Note: must be called with the socket locked. */ -int tcp_do_sendmsg(struct sock *sk, int iovlen, struct iovec *iov, int flags) +int tcp_do_sendmsg(struct sock *sk, struct msghdr *msg) { - struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); - int mss_now; - int err = 0; - int copied = 0; + struct iovec *iov; + struct tcp_opt *tp; struct sk_buff *skb; + int iovlen, flags; + int mss_now; + int err, copied; + + lock_sock(sk); + + err = 0; + tp = &(sk->tp_pinfo.af_tcp); /* Wait for a connection to finish. */ + flags = msg->msg_flags; if ((1 << sk->state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) if((err = wait_for_tcp_connect(sk, flags)) != 0) - return err; + goto out; /* This should be in poll */ sk->socket->flags &= ~SO_NOSPACE; /* clear SIGIO XXX */ @@ -754,6 +761,10 @@ mss_now = tcp_current_mss(sk); /* Ok commence sending. */ + iovlen = msg->msg_iovlen; + iov = msg->msg_iov; + copied = 0; + while(--iovlen >= 0) { int seglen=iov->iov_len; unsigned char * from=iov->iov_base; @@ -926,26 +937,36 @@ } } sk->err = 0; - return copied; + err = copied; + goto out; do_sock_err: if(copied) - return copied; - return sock_error(sk); + err = copied; + else + err = sock_error(sk); + goto out; do_shutdown: if(copied) - return copied; - if (!(flags&MSG_NOSIGNAL)) - send_sig(SIGPIPE, current, 0); - return -EPIPE; + err = copied; + else { + if (!(flags&MSG_NOSIGNAL)) + send_sig(SIGPIPE, current, 0); + err = -EPIPE; + } + goto out; do_interrupted: if(copied) - return copied; - return err; + err = copied; + goto out; do_fault: kfree_skb(skb); do_fault2: - return -EFAULT; + err = -EFAULT; +out: + tcp_push_pending_frames(sk, tp); + release_sock(sk); + return err; } #undef PSH_NEEDED @@ -1681,13 +1702,9 @@ } else { sk->nonagle = 0; - if (tp->send_head) { - lock_sock(sk); - if (tp->send_head && - tcp_snd_test (sk, tp->send_head)) - tcp_write_xmit(sk); - release_sock(sk); - } + lock_sock(sk); + tcp_push_pending_frames(sk, tp); + release_sock(sk); } return 0; diff -u --recursive --new-file v2.2.3/linux/net/ipv4/tcp_ipv4.c linux/net/ipv4/tcp_ipv4.c --- v2.2.3/linux/net/ipv4/tcp_ipv4.c Wed Mar 10 15:29:52 1999 +++ linux/net/ipv4/tcp_ipv4.c Wed Mar 10 10:28:50 1999 @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_ipv4.c,v 1.166 1999/02/23 08:12:41 davem Exp $ + * Version: $Id: tcp_ipv4.c,v 1.168 1999/03/10 08:56:38 davem Exp $ * * IPv4 specific functions * @@ -657,7 +657,6 @@ static int tcp_v4_sendmsg(struct sock *sk, struct msghdr *msg, int len) { - struct tcp_opt *tp; int retval = -EINVAL; /* Do sanity checking for sendmsg/sendto/send. */ @@ -679,15 +678,7 @@ if (addr->sin_addr.s_addr != sk->daddr) goto out; } - - lock_sock(sk); - retval = tcp_do_sendmsg(sk, msg->msg_iovlen, msg->msg_iov, - msg->msg_flags); - /* Push out partial tail frames if needed. */ - tp = &(sk->tp_pinfo.af_tcp); - if(tp->send_head && tcp_snd_test(sk, tp->send_head)) - tcp_write_xmit(sk); - release_sock(sk); + retval = tcp_do_sendmsg(sk, msg); out: return retval; diff -u --recursive --new-file v2.2.3/linux/net/ipv4/tcp_output.c linux/net/ipv4/tcp_output.c --- v2.2.3/linux/net/ipv4/tcp_output.c Wed Mar 10 15:29:52 1999 +++ linux/net/ipv4/tcp_output.c Wed Mar 10 11:06:52 1999 @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_output.c,v 1.104 1999/03/07 13:26:04 davem Exp $ + * Version: $Id: tcp_output.c,v 1.105 1999/03/10 18:59:52 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -233,8 +233,9 @@ buff->csum = csum_partial_copy(skb->data + len, skb_put(buff, nsize), nsize, 0); - TCP_SKB_CB(skb)->end_seq -= nsize; - skb_trim(skb, skb->len - nsize); + /* This takes care of the FIN sequence number too. */ + TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(buff)->seq; + skb_trim(skb, len); /* Rechecksum original buffer. */ skb->csum = csum_partial(skb->data, skb->len, 0); diff -u --recursive --new-file v2.2.3/linux/net/ipv6/tcp_ipv6.c linux/net/ipv6/tcp_ipv6.c --- v2.2.3/linux/net/ipv6/tcp_ipv6.c Wed Mar 10 15:29:52 1999 +++ linux/net/ipv6/tcp_ipv6.c Wed Mar 10 10:28:34 1999 @@ -5,7 +5,7 @@ * Authors: * Pedro Roque * - * $Id: tcp_ipv6.c,v 1.96 1999/03/05 13:23:13 davem Exp $ + * $Id: tcp_ipv6.c,v 1.98 1999/03/10 08:56:41 davem Exp $ * * Based on: * linux/net/ipv4/tcp.c @@ -535,7 +535,6 @@ static int tcp_v6_sendmsg(struct sock *sk, struct msghdr *msg, int len) { - struct tcp_opt *tp; struct ipv6_pinfo *np = &sk->net_pinfo.af_inet6; int retval = -EINVAL; @@ -564,14 +563,7 @@ goto out; } - lock_sock(sk); - retval = tcp_do_sendmsg(sk, msg->msg_iovlen, msg->msg_iov, - msg->msg_flags); - /* Push out partial tail frames if needed. */ - tp = &(sk->tp_pinfo.af_tcp); - if(tp->send_head && tcp_snd_test(sk, tp->send_head)) - tcp_write_xmit(sk); - release_sock(sk); + retval = tcp_do_sendmsg(sk, msg); out: return retval; diff -u --recursive --new-file v2.2.3/linux/net/socket.c linux/net/socket.c --- v2.2.3/linux/net/socket.c Tue Jan 19 11:32:53 1999 +++ linux/net/socket.c Tue Mar 9 09:20:19 1999 @@ -41,6 +41,7 @@ * Kevin Buhr : Fixed the dumb errors in the above. * Andi Kleen : Some small cleanups, optimizations, * and fixed a copy_from_user() bug. + * Tigran Aivazian : sys_send(args) calls sys_sendto(args, NULL, 0) * * * This program is free software; you can redistribute it and/or @@ -929,40 +930,6 @@ } /* - * Send a datagram down a socket. The datagram as with write() is - * in user space. We check it can be read. - */ - -asmlinkage int sys_send(int fd, void * buff, size_t len, unsigned flags) -{ - struct socket *sock; - int err; - struct msghdr msg; - struct iovec iov; - - lock_kernel(); - sock = sockfd_lookup(fd, &err); - if (sock) { - iov.iov_base=buff; - iov.iov_len=len; - msg.msg_name=NULL; - msg.msg_namelen=0; - msg.msg_iov=&iov; - msg.msg_iovlen=1; - msg.msg_control=NULL; - msg.msg_controllen=0; - if (sock->file->f_flags & O_NONBLOCK) - flags |= MSG_DONTWAIT; - msg.msg_flags = flags; - err = sock_sendmsg(sock, &msg, len); - - sockfd_put(sock); - } - unlock_kernel(); - return err; -} - -/* * Send a datagram to a given address. We move the address into kernel * space and check the user space data area is readable before invoking * the protocol. @@ -1008,6 +975,14 @@ return err; } +/* + * Send a datagram down a socket. + */ + +asmlinkage int sys_send(int fd, void * buff, size_t len, unsigned flags) +{ + return sys_sendto(fd, buff, len, flags, NULL, 0); +} /* * Receive a frame from the socket and optionally record the address of the @@ -1059,7 +1034,7 @@ asmlinkage int sys_recv(int fd, void * ubuf, size_t size, unsigned flags) { - return sys_recvfrom(fd,ubuf,size,flags, NULL, NULL); + return sys_recvfrom(fd, ubuf, size, flags, NULL, NULL); } /*