Commit d0a516d5 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.2.3

parent 4b84b5cd
VERSION = 1 VERSION = 1
PATCHLEVEL = 2 PATCHLEVEL = 2
SUBLEVEL = 2 SUBLEVEL = 3
ARCH = i386 ARCH = i386
......
...@@ -125,11 +125,11 @@ ...@@ -125,11 +125,11 @@
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/malloc.h> #include <linux/malloc.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/major.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/blkdev.h>
#include <asm/bitops.h> #include <asm/bitops.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/segment.h> #include <asm/segment.h>
......
...@@ -80,7 +80,6 @@ vcs_read(struct inode *inode, struct file *file, char *buf, int count) ...@@ -80,7 +80,6 @@ vcs_read(struct inode *inode, struct file *file, char *buf, int count)
if (!vc_cons_allocated(cons)) if (!vc_cons_allocated(cons))
return -ENXIO; return -ENXIO;
clear_selection();
size = vcs_size(inode); size = vcs_size(inode);
if (count < 0 || p > size) if (count < 0 || p > size)
return -EINVAL; return -EINVAL;
...@@ -139,7 +138,6 @@ vcs_write(struct inode *inode, struct file *file, char *buf, int count) ...@@ -139,7 +138,6 @@ vcs_write(struct inode *inode, struct file *file, char *buf, int count)
if (!vc_cons_allocated(cons)) if (!vc_cons_allocated(cons))
return -ENXIO; return -ENXIO;
clear_selection();
size = vcs_size(inode); size = vcs_size(inode);
if (count < 0 || p > size) if (count < 0 || p > size)
return -EINVAL; return -EINVAL;
......
...@@ -62,8 +62,6 @@ endif ...@@ -62,8 +62,6 @@ endif
ifdef CONFIG_SCSI_AHA152X ifdef CONFIG_SCSI_AHA152X
SCSI_OBJS := $(SCSI_OBJS) aha152x.o SCSI_OBJS := $(SCSI_OBJS) aha152x.o
SCSI_SRCS := $(SCSI_SRCS) aha152x.c SCSI_SRCS := $(SCSI_SRCS) aha152x.c
else
SCSI_MODULE_OBJS := $(SCSI_MODULE_OBJS) aha152x.o
endif endif
ifdef CONFIG_SCSI_AHA1542 ifdef CONFIG_SCSI_AHA1542
......
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
/* DEFINES */ /* DEFINES */
/* For PCMCIA cards, always use AUTOCONF */ /* For PCMCIA cards, always use AUTOCONF */
#ifdef PCMCIA #if defined(PCMCIA) || defined(MODULE)
#define AUTOCONF #define AUTOCONF
#endif #endif
......
...@@ -251,6 +251,7 @@ back_over_eof(int dev) ...@@ -251,6 +251,7 @@ back_over_eof(int dev)
Scsi_Cmnd *SCpnt; Scsi_Cmnd *SCpnt;
Scsi_Tape *STp = &(scsi_tapes[dev]); Scsi_Tape *STp = &(scsi_tapes[dev]);
unsigned char cmd[10]; unsigned char cmd[10];
unsigned int flags;
cmd[0] = SPACE; cmd[0] = SPACE;
cmd[1] = 0x01; /* Space FileMarks */ cmd[1] = 0x01; /* Space FileMarks */
...@@ -264,7 +265,12 @@ back_over_eof(int dev) ...@@ -264,7 +265,12 @@ back_over_eof(int dev)
(void *) cmd, (void *) (STp->buffer)->b_data, 0, (void *) cmd, (void *) (STp->buffer)->b_data, 0,
st_sleep_done, ST_TIMEOUT, MAX_RETRIES); st_sleep_done, ST_TIMEOUT, MAX_RETRIES);
/* need to do the check with interrupts off. -RAB */
save_flags(flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
SCpnt->request.dev = -1; SCpnt->request.dev = -1;
if ((STp->buffer)->last_result != 0) { if ((STp->buffer)->last_result != 0) {
printk("st%d: Backing over filemark failed.\n", dev); printk("st%d: Backing over filemark failed.\n", dev);
...@@ -283,6 +289,7 @@ flush_write_buffer(int dev) ...@@ -283,6 +289,7 @@ flush_write_buffer(int dev)
{ {
int offset, transfer, blks; int offset, transfer, blks;
int result; int result;
unsigned int flags;
unsigned char cmd[10]; unsigned char cmd[10];
Scsi_Cmnd *SCpnt; Scsi_Cmnd *SCpnt;
Scsi_Tape *STp = &(scsi_tapes[dev]); Scsi_Tape *STp = &(scsi_tapes[dev]);
...@@ -327,7 +334,11 @@ flush_write_buffer(int dev) ...@@ -327,7 +334,11 @@ flush_write_buffer(int dev)
(void *) cmd, (STp->buffer)->b_data, transfer, (void *) cmd, (STp->buffer)->b_data, transfer,
st_sleep_done, ST_TIMEOUT, MAX_WRITE_RETRIES); st_sleep_done, ST_TIMEOUT, MAX_WRITE_RETRIES);
/* this must be done with interrupts off */
save_flags (flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
if ((STp->buffer)->last_result_fatal != 0) { if ((STp->buffer)->last_result_fatal != 0) {
printk("st%d: Error on flush.\n", dev); printk("st%d: Error on flush.\n", dev);
...@@ -406,6 +417,7 @@ scsi_tape_open(struct inode * inode, struct file * filp) ...@@ -406,6 +417,7 @@ scsi_tape_open(struct inode * inode, struct file * filp)
{ {
int dev; int dev;
unsigned short flags; unsigned short flags;
unsigned int processor_flags;
int i; int i;
unsigned char cmd[10]; unsigned char cmd[10];
Scsi_Cmnd * SCpnt; Scsi_Cmnd * SCpnt;
...@@ -459,7 +471,12 @@ scsi_tape_open(struct inode * inode, struct file * filp) ...@@ -459,7 +471,12 @@ scsi_tape_open(struct inode * inode, struct file * filp)
0, st_sleep_done, ST_LONG_TIMEOUT, 0, st_sleep_done, ST_LONG_TIMEOUT,
MAX_READY_RETRIES); MAX_READY_RETRIES);
/* this must be done with interrupts off */
save_flags (processor_flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(processor_flags);
if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 && if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 &&
(SCpnt->sense_buffer[2] & 0x0f) == UNIT_ATTENTION) { /* New media? */ (SCpnt->sense_buffer[2] & 0x0f) == UNIT_ATTENTION) { /* New media? */
...@@ -473,7 +490,13 @@ scsi_tape_open(struct inode * inode, struct file * filp) ...@@ -473,7 +490,13 @@ scsi_tape_open(struct inode * inode, struct file * filp)
0, st_sleep_done, ST_LONG_TIMEOUT, 0, st_sleep_done, ST_LONG_TIMEOUT,
MAX_READY_RETRIES); MAX_READY_RETRIES);
/* this must be done with interrupts off */
save_flags (processor_flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(processor_flags);
(STp->mt_status)->mt_fileno = STp->drv_block = 0; (STp->mt_status)->mt_fileno = STp->drv_block = 0;
STp->eof = ST_NOEOF; STp->eof = ST_NOEOF;
} }
...@@ -509,7 +532,12 @@ scsi_tape_open(struct inode * inode, struct file * filp) ...@@ -509,7 +532,12 @@ scsi_tape_open(struct inode * inode, struct file * filp)
(void *) cmd, (void *) (STp->buffer)->b_data, (void *) cmd, (void *) (STp->buffer)->b_data,
6, st_sleep_done, ST_TIMEOUT, MAX_READY_RETRIES); 6, st_sleep_done, ST_TIMEOUT, MAX_READY_RETRIES);
/* this must be done with interrupts off */
save_flags (processor_flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(processor_flags);
if (!SCpnt->result && !SCpnt->sense_buffer[0]) { if (!SCpnt->result && !SCpnt->sense_buffer[0]) {
STp->max_block = ((STp->buffer)->b_data[1] << 16) | STp->max_block = ((STp->buffer)->b_data[1] << 16) |
...@@ -539,7 +567,12 @@ scsi_tape_open(struct inode * inode, struct file * filp) ...@@ -539,7 +567,12 @@ scsi_tape_open(struct inode * inode, struct file * filp)
(void *) cmd, (void *) (STp->buffer)->b_data, (void *) cmd, (void *) (STp->buffer)->b_data,
12, st_sleep_done, ST_TIMEOUT, MAX_READY_RETRIES); 12, st_sleep_done, ST_TIMEOUT, MAX_READY_RETRIES);
/* this must be done with interrupts off */
save_flags (processor_flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
if ((STp->buffer)->last_result_fatal != 0) { if ((STp->buffer)->last_result_fatal != 0) {
#ifdef DEBUG #ifdef DEBUG
...@@ -626,6 +659,7 @@ scsi_tape_close(struct inode * inode, struct file * filp) ...@@ -626,6 +659,7 @@ scsi_tape_close(struct inode * inode, struct file * filp)
static unsigned char cmd[10]; static unsigned char cmd[10];
Scsi_Cmnd * SCpnt; Scsi_Cmnd * SCpnt;
Scsi_Tape * STp; Scsi_Tape * STp;
unsigned int flags;
dev = MINOR(inode->i_rdev); dev = MINOR(inode->i_rdev);
rewind = (dev & 0x80) == 0; rewind = (dev & 0x80) == 0;
...@@ -653,7 +687,13 @@ scsi_tape_close(struct inode * inode, struct file * filp) ...@@ -653,7 +687,13 @@ scsi_tape_close(struct inode * inode, struct file * filp)
(void *) cmd, (void *) (STp->buffer)->b_data, (void *) cmd, (void *) (STp->buffer)->b_data,
0, st_sleep_done, ST_TIMEOUT, MAX_WRITE_RETRIES); 0, st_sleep_done, ST_TIMEOUT, MAX_WRITE_RETRIES);
/* this must be done with interrupts off */
save_flags (flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
if ((STp->buffer)->last_result_fatal != 0) { if ((STp->buffer)->last_result_fatal != 0) {
SCpnt->request.dev = -1; /* Mark as not busy */ SCpnt->request.dev = -1; /* Mark as not busy */
...@@ -710,6 +750,7 @@ st_write(struct inode * inode, struct file * filp, char * buf, int count) ...@@ -710,6 +750,7 @@ st_write(struct inode * inode, struct file * filp, char * buf, int count)
char *b_point; char *b_point;
Scsi_Cmnd * SCpnt; Scsi_Cmnd * SCpnt;
Scsi_Tape * STp; Scsi_Tape * STp;
unsigned int flags;
dev = MINOR(inode->i_rdev) & 127; dev = MINOR(inode->i_rdev) & 127;
STp = &(scsi_tapes[dev]); STp = &(scsi_tapes[dev]);
...@@ -813,7 +854,12 @@ st_write(struct inode * inode, struct file * filp, char * buf, int count) ...@@ -813,7 +854,12 @@ st_write(struct inode * inode, struct file * filp, char * buf, int count)
(void *) cmd, (STp->buffer)->b_data, transfer, (void *) cmd, (STp->buffer)->b_data, transfer,
st_sleep_done, ST_TIMEOUT, MAX_WRITE_RETRIES); st_sleep_done, ST_TIMEOUT, MAX_WRITE_RETRIES);
/* this must be done with interrupts off */
save_flags (flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
if ((STp->buffer)->last_result_fatal != 0) { if ((STp->buffer)->last_result_fatal != 0) {
#ifdef DEBUG #ifdef DEBUG
...@@ -944,6 +990,7 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count) ...@@ -944,6 +990,7 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count)
static unsigned char cmd[10]; static unsigned char cmd[10];
Scsi_Cmnd * SCpnt; Scsi_Cmnd * SCpnt;
Scsi_Tape * STp; Scsi_Tape * STp;
unsigned int flags;
dev = MINOR(inode->i_rdev) & 127; dev = MINOR(inode->i_rdev) & 127;
STp = &(scsi_tapes[dev]); STp = &(scsi_tapes[dev]);
...@@ -1019,7 +1066,12 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count) ...@@ -1019,7 +1066,12 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count)
(STp->buffer)->buffer_size, (STp->buffer)->buffer_size,
st_sleep_done, ST_TIMEOUT, MAX_RETRIES); st_sleep_done, ST_TIMEOUT, MAX_RETRIES);
/* this must be done with interrupts off */
save_flags (flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
(STp->buffer)->read_pointer = 0; (STp->buffer)->read_pointer = 0;
STp->eof_hit = 0; STp->eof_hit = 0;
...@@ -1232,6 +1284,7 @@ st_int_ioctl(struct inode * inode,struct file * file, ...@@ -1232,6 +1284,7 @@ st_int_ioctl(struct inode * inode,struct file * file,
Scsi_Cmnd * SCpnt; Scsi_Cmnd * SCpnt;
Scsi_Tape * STp; Scsi_Tape * STp;
int fileno, blkno, at_sm, undone, datalen; int fileno, blkno, at_sm, undone, datalen;
unsigned int flags;
dev = dev & 127; dev = dev & 127;
STp = &(scsi_tapes[dev]); STp = &(scsi_tapes[dev]);
...@@ -1551,7 +1604,13 @@ st_int_ioctl(struct inode * inode,struct file * file, ...@@ -1551,7 +1604,13 @@ st_int_ioctl(struct inode * inode,struct file * file,
(void *) cmd, (void *) (STp->buffer)->b_data, datalen, (void *) cmd, (void *) (STp->buffer)->b_data, datalen,
st_sleep_done, timeout, MAX_RETRIES); st_sleep_done, timeout, MAX_RETRIES);
/* this must be done with interrupts off */
save_flags (flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
ioctl_result = (STp->buffer)->last_result_fatal; ioctl_result = (STp->buffer)->last_result_fatal;
...@@ -1676,6 +1735,7 @@ st_ioctl(struct inode * inode,struct file * file, ...@@ -1676,6 +1735,7 @@ st_ioctl(struct inode * inode,struct file * file,
unsigned char scmd[10]; unsigned char scmd[10];
Scsi_Cmnd *SCpnt; Scsi_Cmnd *SCpnt;
Scsi_Tape *STp; Scsi_Tape *STp;
unsigned int flags;
dev = dev & 127; dev = dev & 127;
STp = &(scsi_tapes[dev]); STp = &(scsi_tapes[dev]);
...@@ -1803,7 +1863,13 @@ st_ioctl(struct inode * inode,struct file * file, ...@@ -1803,7 +1863,13 @@ st_ioctl(struct inode * inode,struct file * file,
(void *) scmd, (void *) (STp->buffer)->b_data, (void *) scmd, (void *) (STp->buffer)->b_data,
20, st_sleep_done, ST_TIMEOUT, MAX_READY_RETRIES); 20, st_sleep_done, ST_TIMEOUT, MAX_READY_RETRIES);
/* this must be done with interrupts off */
save_flags (flags);
cli();
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) ); if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
restore_flags(flags);
if ((STp->buffer)->last_result_fatal != 0) { if ((STp->buffer)->last_result_fatal != 0) {
mt_pos.mt_blkno = (-1); mt_pos.mt_blkno = (-1);
......
...@@ -47,7 +47,7 @@ int send_sig(unsigned long sig,struct task_struct * p,int priv) ...@@ -47,7 +47,7 @@ int send_sig(unsigned long sig,struct task_struct * p,int priv)
if (!p || sig > 32) if (!p || sig > 32)
return -EINVAL; return -EINVAL;
if (!priv && ((sig != SIGCONT) || (current->session != p->session)) && if (!priv && ((sig != SIGCONT) || (current->session != p->session)) &&
(current->euid != p->euid) && (current->uid != p->uid) && !suser()) (current->euid != p->euid) && (current->euid != p->uid) && !suser())
return -EPERM; return -EPERM;
if (!sig) if (!sig)
return 0; return 0;
......
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