Commit efdf60b6 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.0.2

parent 5eb4898b
VERSION = 1
PATCHLEVEL = 0
SUBLEVEL = 1
SUBLEVEL = 2
all: Version zImage
......
......@@ -126,6 +126,7 @@ static unsigned char generic_sense[6] = {REQUEST_SENSE, 0,0,0, 255, 0};
static struct blist blacklist[] =
{
{"CHINON","CD-ROM CDS-431","H42"}, /* Locks up if polled for lun != 0 */
{"DENON","DRD-25X","V"}, /* A cdrom that locks up when probed at lun != 0 */
{"IMS", "CDD521/10","2.06"}, /* Locks-up when LUN>0 polled. */
{"MAXTOR","XT-3280","PR02"}, /* Locks-up when LUN>0 polled. */
......
......@@ -235,7 +235,7 @@ int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
char scsi_cmd[12];
if ((cmd != 0 && dev->index > NR_SCSI_DEVICES))
return -ENODEV;
return -ENXIO;
switch (cmd) {
case SCSI_IOCTL_GET_IDLUN:
......
......@@ -59,7 +59,7 @@ static int sd_open(struct inode * inode, struct file * filp)
target = DEVICE_NR(MINOR(inode->i_rdev));
if(target >= NR_SD || !rscsi_disks[target].device)
return -ENODEV; /* No such device */
return -ENXIO; /* No such device */
/* Make sure that only one process can do a check_change_disk at one time.
This is also used to lock out further access when the partition table is being re-read. */
......
......@@ -56,7 +56,7 @@ static int sg_ioctl(struct inode * inode,struct file * file,
{
int dev = MINOR(inode->i_rdev);
if ((dev<0) || (dev>=NR_SG))
return -ENODEV;
return -ENXIO
switch(cmd_in)
{
case SG_SET_TIMEOUT:
......@@ -74,7 +74,7 @@ static int sg_open(struct inode * inode, struct file * filp)
int dev=MINOR(inode->i_rdev);
int flags=filp->f_flags;
if (dev>=NR_SG)
return -ENODEV;
return -ENXIO;
if (O_RDWR!=(flags & O_ACCMODE))
return -EACCES;
if (flags & O_EXCL)
......
......@@ -260,7 +260,7 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
static int sr_open(struct inode * inode, struct file * filp)
{
if(MINOR(inode->i_rdev) >= NR_SR ||
!scsi_CDs[MINOR(inode->i_rdev)].device) return -ENODEV; /* No such device */
!scsi_CDs[MINOR(inode->i_rdev)].device) return -ENXIO; /* No such device */
check_disk_change(inode->i_rdev);
......
......@@ -98,7 +98,7 @@ int sr_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigne
int result, target;
target = MINOR(dev);
if (target >= NR_SR) return -ENODEV;
if (target >= NR_SR) return -ENXIO;
switch (cmd)
{
......
......@@ -359,7 +359,7 @@ scsi_tape_open(struct inode * inode, struct file * filp)
dev = MINOR(inode->i_rdev) & 127;
if (dev >= NR_ST)
return (-ENODEV);
return (-ENXIO);
STp = &(scsi_tapes[dev]);
if (STp->in_use) {
printk("st%d: Device already in use.\n", dev);
......
......@@ -135,10 +135,10 @@ __ntohl(unsigned long int x)
static __inline__ unsigned long int
__constant_ntohl(unsigned long int x)
{
return (((x & 0x000000ff) << 24) |
((x & 0x0000ff00) << 8) |
((x & 0x00ff0000) >> 8) |
((x & 0xff000000) >> 24));
return (((x & 0x000000ffU) << 24) |
((x & 0x0000ff00U) << 8) |
((x & 0x00ff0000U) >> 8) |
((x & 0xff000000U) >> 24));
}
static __inline__ unsigned short int
......@@ -164,19 +164,19 @@ __constant_ntohs(unsigned short int x)
#ifdef __OPTIMIZE__
# define ntohl(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((long)(x)) ? \
__constant_ntohl((x)) : \
__ntohl((x)))
# define ntohs(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((short)(x)) ? \
__constant_ntohs((x)) : \
__ntohs((x)))
# define htonl(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((long)(x)) ? \
__constant_htonl((x)) : \
__htonl((x)))
# define htons(x) \
(__builtin_constant_p((x)) ? \
(__builtin_constant_p((short)(x)) ? \
__constant_htons((x)) : \
__htons((x)))
#endif
......
......@@ -14,6 +14,8 @@
#define LONG_MAX ((long)(~0UL>>1))
#define ULONG_MAX (~0UL)
#define STACK_MAGIC 0xdeadbeef
#define KERN_EMERG "<0>" /* system is unusable */
#define KERN_ALERT "<1>" /* action must be taken immediately */
#define KERN_CRIT "<2>" /* critical conditions */
......
......@@ -89,6 +89,8 @@ void release(struct task_struct * p)
if (task[i] == p) {
task[i] = NULL;
REMOVE_LINKS(p);
if (STACK_MAGIC != *(unsigned long *)p->kernel_stack_page)
printk(KERN_ALERT "release: %s kernel stack corruption. Aiee\n", p->comm);
free_page(p->kernel_stack_page);
free_page((long) p);
return;
......@@ -395,9 +397,6 @@ NORET_TYPE void do_exit(long code)
}
}
current->state = TASK_ZOMBIE;
current->exit_code = code;
current->rss = 0;
/*
* Check to see if any process groups have become orphaned
* as a result of our exiting, and if they have any stopped
......@@ -456,6 +455,9 @@ NORET_TYPE void do_exit(long code)
disassociate_ctty(1);
if (last_task_used_math == current)
last_task_used_math = NULL;
current->state = TASK_ZOMBIE;
current->exit_code = code;
current->rss = 0;
#ifdef DEBUG_PROC_TREE
audit_ptree();
#endif
......
......@@ -157,8 +157,9 @@ asmlinkage int sys_fork(struct pt_regs regs)
/*
* set up new TSS and kernel stack
*/
if (!(p->kernel_stack_page = __get_free_page(GFP_KERNEL)))
if (!(p->kernel_stack_page = get_free_page(GFP_KERNEL)))
goto bad_fork_cleanup;
*(unsigned long *)p->kernel_stack_page = STACK_MAGIC;
p->tss.es = KERNEL_DS;
p->tss.cs = KERNEL_CS;
p->tss.ss = KERNEL_DS;
......
......@@ -85,7 +85,7 @@ extern void mem_use(void);
extern int timer_interrupt(void);
asmlinkage int system_call(void);
static unsigned long init_kernel_stack[1024];
static unsigned long init_kernel_stack[1024] = { STACK_MAGIC, };
struct task_struct init_task = INIT_TASK;
unsigned long volatile jiffies=0;
......@@ -95,7 +95,7 @@ struct task_struct *last_task_used_math = NULL;
struct task_struct * task[NR_TASKS] = {&init_task, };
long user_stack [ PAGE_SIZE>>2 ] ;
long user_stack [ PAGE_SIZE>>2 ] = { STACK_MAGIC, };
struct {
long * a;
......@@ -772,6 +772,7 @@ asmlinkage int sys_nice(long increment)
static void show_task(int nr,struct task_struct * p)
{
int free;
static char * stat_nam[] = { "R", "S", "D", "Z", "T", "W" };
printk("%-8s %3d ", p->comm, (p == current) ? -nr : nr);
......@@ -783,8 +784,11 @@ static void show_task(int nr,struct task_struct * p)
printk(" current ");
else
printk(" %08lX ", ((unsigned long *)p->tss.esp)[3]);
printk("%5lu %5d %6d ",
p->tss.esp - p->kernel_stack_page, p->pid, p->p_pptr->pid);
for (free = 1; free < 1024 ; free++) {
if (((unsigned long *)p->kernel_stack_page)[free])
break;
}
printk("%5lu %5d %6d ", free << 2, p->pid, p->p_pptr->pid);
if (p->p_cptr)
printk("%5d ", p->p_cptr->pid);
else
......
......@@ -101,7 +101,10 @@ asmlinkage void alignment_check(void);
printk("ds: %04x es: %04x fs: %04x gs: %04x ss: %04x\n",
regs->ds, regs->es, regs->fs, regs->gs, ss);
store_TR(i);
printk("Pid: %d, process nr: %d (%s)\nStack: ", current->pid, 0xffff & i, current->comm);
if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
printk("Corrupted stack page\n");
printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)\nStack: ",
current->comm, current->pid, 0xffff & i, current->kernel_stack_page);
for(i=0;i<5;i++)
printk("%08lx ", get_seg_long(ss,(i+(unsigned long *)esp)));
printk("\nCode: ");
......
......@@ -300,7 +300,6 @@ if (size &&
}
size = p->bh_length;
p->bh_flags = MF_FREE; /* As of now this block is officially free */
save_flags(flags);
cli ();
p->bh_next = page->firstfree;
......
......@@ -1194,8 +1194,11 @@ inet_accept(struct socket *sock, struct socket *newsock, int flags)
* We need to free it up because the tcp module creates
* it's own when it accepts one.
*/
if (newsock->data) kfree_s(newsock->data, sizeof(struct sock));
newsock->data = NULL;
if (newsock->data) {
struct sock * sk = (struct sock *) newsock->data;
newsock->data = NULL;
kfree_s(sk, sizeof(struct sock));
}
if (sk1->prot->accept == NULL) return(-EOPNOTSUPP);
......
......@@ -413,10 +413,13 @@ unix_proto_bind(struct socket *sock, struct sockaddr *umyaddr,
old_fs = get_fs();
set_fs(get_ds());
i = do_mknod(fname, S_IFSOCK | S_IRWXUGO, 0);
if (i == 0) i = open_namei(fname, 0, S_IFSOCK, &upd->inode, NULL);
if (i == -EEXIST)
i = -EADDRINUSE;
if (i == 0)
i = open_namei(fname, 0, S_IFSOCK, &upd->inode, NULL);
set_fs(old_fs);
if (i < 0) {
printk("UNIX: bind: can't open socket %s\n", fname);
dprintf(1, "UNIX: bind: can't open socket %s\n", fname);
return(i);
}
upd->sockaddr_len = sockaddr_len; /* now its legal */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment