Commit 1b7a152c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Import 1.1.62

parent a6614639
......@@ -733,6 +733,15 @@ S: 520 Edgemont Road
S: Charlottesville, Virginia 22903
S: USA
N: Matthias Urlichs
E: urlichs@noris.de
E: urlichs@smurf.sub.org
D: Consultant, developer, kernel hacker
D: Playing with Streams, ISDN, and BSD networking code for Linux
S: Schleiermacherstrasse 12
S: 90491 Nuernberg
S: Germany
N: Patrick Volkerding
E: volkerdi@ftp.cdrom.com
D: Produced the Slackware distribution, updated the SVGAlib
......@@ -809,6 +818,7 @@ S: New York, New York 10025
S: USA
N: Eric Youngdale
E: eric@aib.com
E: ericy@cais.com
D: General kernel hacker
D: SCSI iso9660 and ELF
......@@ -822,3 +832,10 @@ D: XFree86 and kernel development
S: 1507 145th Place SE #B5
S: Bellevue, Washington 98007
S: USA
N: Leonard N. Zubkoff
E: lnz@dandelion.com
D: XFree86 and BusLogic driver additions
S: 3078 Sulphur Spring Court
S: San Jose, California 95148
S: USA
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 61
SUBLEVEL = 62
ARCH = i386
......
Linux kernel release 1.0
Linux kernel release 1.1.xx
These are the release notes for linux version 1.0. Read them carefully,
These are the release notes for linux version 1.1. Read them carefully,
as they tell you what this is all about, explain how to install the
kernel, and what to do if something goes wrong.
Warning: This is a work in progress. If you are not reasonably at ease with
the C programming language, GCC, installing Linux, and recovering from
system crashes, please use the 1.0 version, or wait for 1.2.
WHAT IS LINUX?
Linux is a Unix clone for 386/486-based PCs written from scratch by
......@@ -24,20 +28,24 @@ INSTALLING the kernel:
- If you install the full sources, do a
cd /usr/src
tar xvf linux-1.0.tar
gzip -cd linux-1.1.XX.tar.gz | tar xfv -
to get it all put in place.
to get it all put in place. Replace "XX" with the version number of the
latest kernel.
- if you install by patching, you need a *clean* 0.99.15 source tree,
which presumably exists in /usr/src/linux. If so, to get the kernel
patched, just do a
- Installing by patching is not worth the effort because the full set of
patches is bigger than a new kernel distribution. Instead, get the
latest full source archive and install as above. Then, get all newer
patch files, and do
cd /usr/src
patch -p0 < linux-1.0.patch
gzip -cd patchXX.gz | patch -p0
and you should be ok. You may want to remove the backup files (xxx~
or xxx.orig), and make sure that there are no failed patches (xxx# or
xxx.rej).
(repeat xx for all versions bigger than the version of your current
source tree, _in_order_) and you should be ok. You may want to remove
the backup files (xxx~ or xxx.orig), and make sure that there are no
failed patches (xxx# or xxx.rej). If there are, either you or me has
made a mistake.
- make sure your /usr/include/linux and /usr/include/asm directories
are just symlinks to the kernel sources:
......@@ -88,10 +96,11 @@ CONFIGURING the kernel:
COMPILING the kernel:
- make sure you have gcc-2.4.5 or newer available. It seems older gcc
- make sure you have gcc-2.5.8 or newer available. It seems older gcc
versions can have problems compiling newer versions of linux. If you
upgrade your compiler, remember to get the new binutils package too
(for as/ld/nm and company)
(for as/ld/nm and company). Do not use gcc-2.6.0; it has a few serious
bugs.
- do a "make zImage" to create a compressed kernel image. If you want
to make a bootdisk (without root filesystem or lilo), insert a floppy
......@@ -148,7 +157,7 @@ IF SOMETHING GOES WRONG:
unable to handle kernel paging request at address C0000010
Oops: 0002
EIP: 0010:xxxxxxxx
EIP: 0010:XXXXXXXX
eax: xxxxxxxx ebx: xxxxxxxx ecx: xxxxxxxx edx: xxxxxxxx
esi: xxxxxxxx edi: xxxxxxxx ebp: xxxxxxxx
ds: xxxx es: xxxx fs: xxxx gs: xxxx
......@@ -194,3 +203,16 @@ IF SOMETHING GOES WRONG:
kernel image or similar), telling me as much about your setup as
possible will help.
- alternately, you can use gdb on a running kernel. (read-only; i.e. you
cannot change values or set break points.) To do this, first compile the
kernel with -g; edit arch/i386/Makefile appropriately, then do a "make
clean". You'll also need to enable CONFIG_PROC_FS (via "make config").
After you've rebooted with the new kernel, do "gdb tools/zSystem
/proc/kcore". You can now use all the usual gdb commands. The command to
look up the point where your system crashed is "l *0xXXXXXXXX". (Replace
the XXXes with the EIP value.)
gdb'ing a non-running kernel currently fails because gdb (wrongly)
disregards the starting offset for which the kernel is compiled.
......@@ -107,6 +107,7 @@ if [ "$CONFIG_NET_ISA" = "y" ]; then
bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE n
bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 n
bool 'DEPCA support' CONFIG_DEPCA n
bool 'EtherWorks 3 support' CONFIG_EWRK3 n
if [ "$CONFIG_NET_ALPHA" = "y" ]; then
bool 'EtherExpress support' CONFIG_EEXPRESS n
bool 'AT1700 support' CONFIG_AT1700 n
......
......@@ -2787,6 +2787,9 @@ cdu31a_init(unsigned long mem_start, unsigned long mem_end)
}
else if (sony_cd_base_io != 0)
{
tmp_irq = irq_used; /* Need IRQ 0 because we can't sleep here. */
irq_used = 0;
get_drive_configuration(sony_cd_base_io,
drive_config.exec_status,
&res_size);
......@@ -2794,9 +2797,12 @@ cdu31a_init(unsigned long mem_start, unsigned long mem_end)
{
drive_found = 1;
}
irq_used = tmp_irq;
}
else
{
irq_used = 0;
i = 0;
while ( (cdu31a_addresses[i].base != 0)
&& (!drive_found))
......@@ -2844,12 +2850,18 @@ cdu31a_init(unsigned long mem_start, unsigned long mem_end)
tmp_irq = autoirq_report(10);
disable_interrupts();
irq_used = 0;
set_drive_params();
irq_used = tmp_irq;
}
else
{
tmp_irq = irq_used; /* Need IRQ 0 because we can't sleep here. */
irq_used = 0;
set_drive_params();
irq_used = tmp_irq;
}
if (irq_used > 0)
......
......@@ -2628,7 +2628,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
case FDCLRPRM:
LOCK_FDC(drive,1);
current_type[drive] = NULL;
floppy_sizes[drive] = 2;
floppy_sizes[drive] = MAX_DISK_SIZE;
UDRS->keep_data = 0;
return invalidate_drive(device);
case FDFMTEND:
......@@ -3159,7 +3159,6 @@ static int floppy_grab_irq_and_dma(void)
static void floppy_release_irq_and_dma(void)
{
int i;
cli();
if (--usage_count){
sti();
......@@ -3170,7 +3169,9 @@ static void floppy_release_irq_and_dma(void)
free_dma(FLOPPY_DMA);
disable_irq(FLOPPY_IRQ);
free_irq(FLOPPY_IRQ);
/* switch off dma gates */
for(i=0; i< N_FDC; i++)
set_dor(i, ~8, 0);
set_dor(0, ~0, 8);
#if N_FDC > 1
if(fdc.address != -1)
set_dor(1, ~8, 0);
#endif
}
Wed Nov 2 10:32:36 1994 Theodore Y. Ts'o (tytso@rt-11)
* n_tty.c (n_tty_receive_room): Only allow excess characters
through if we are in ICANON mode *and* there are other no
pending lines in the buffer. Otherwise cut and paste over
4k breaks.
Sat Oct 29 18:17:34 1994 Theodore Y. Ts'o (tytso@rt-11)
* serial.c (rs_ioctl, get_lsr_info): Added patch suggested by Arne
......
......@@ -585,11 +585,12 @@ static int n_tty_receive_room(struct tty_struct *tty)
int left = N_TTY_BUF_SIZE - tty->read_cnt - 1;
/*
* If we are doing input canonicalization, let as many
* characters through as possible, so that the excess
* characters can be "beeped".
* If we are doing input canonicalization, and there are no
* pending newlines, let characters through without limit, so
* that erase characters will be handled. Other excess
* characters will be beeped.
*/
if (L_ICANON(tty))
if (tty->icanon && !tty->canon_data)
return N_TTY_BUF_SIZE;
if (left > 0)
......
......@@ -1009,6 +1009,12 @@ static void release_dev(struct file * filp)
(tty->ldisc.close)(tty);
tty->ldisc = ldiscs[N_TTY];
tty->termios->c_line = N_TTY;
if (o_tty) {
if (o_tty->ldisc.close)
(o_tty->ldisc.close)(o_tty);
o_tty->ldisc = ldiscs[N_TTY];
o_tty->termios->c_line = N_TTY;
}
tty->driver.table[idx] = NULL;
if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) {
......
This file contains brief information about the SCSI tape driver.
Last modified: Wed Jun 22 23:38:47 1994 by root@kai.home
Last modified: Sun Oct 16 19:20:03 1994 by root@kai.home
BASICS
......@@ -78,7 +78,10 @@ MTBSF Space backward over count filemarks. Tape positioned before
MTBSFM As above but ape positioned after filemark.
MTFSR Space forward over count records.
MTBSR Space backward over count records.
MTFSS Space forward over count setmarks.
MTBSS Space backward over coutn setmarks.
MTWEOF Write count filemarks.
MTWSM Write count setmarks.
MTREW Rewind tape.
MTOFFL Set device off line (often rewind plus eject).
MTNOP Do nothing except flush the buffers.
......@@ -125,9 +128,8 @@ MTIOCGET Returns some status information.
The current block size and the density code are stored in the field
mt_dsreg (shifts for the subfields are MT_ST_BLKSIZE_SHIFT and
MT_ST_DENSITY_SHIFT).
The write protect bit in mt_gstat is set if the tape is write
protected.
The other fields are empty.
The WR_PROT, BOT, EOF, EOT, EOD, and D_[800,1600,6250]_BPI
status bits reflect the tape status. The other bits are not used.
MISCELLANEOUS COMPILE OPTIONS
......
/* fdomain.c -- Future Domain TMC-16x0 SCSI driver
* Created: Sun May 3 18:53:19 1992 by faith@cs.unc.edu
* Revised: Sat Jul 30 22:06:37 1994 by faith@cs.unc.edu
* Revised: Wed Nov 2 16:37:58 1994 by faith@cs.unc.edu
* Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992, 1993, 1994 Rickard E. Faith
*
* $Id: fdomain.c,v 5.18 1994/07/31 03:09:15 faith Exp $
* $Id: fdomain.c,v 5.20 1994/11/02 21:38:33 root Exp $
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -38,10 +38,20 @@
signature, then the driver may fail to function after the board is
detected.
The following BIOS versions are supported: 2.0, 3.0, 3.2, and 3.4.
The following BIOS versions are supported: 2.0, 3.0, 3.2, 3.4, and 3.5.
The following chips are supported: TMC-1800, TMC-18C50, TMC-18C30.
Reports suggest that the driver will also work with the 36C70 chip.
Please note that the drive ordering that Future Domain implemented in BIOS
versions 3.4 and 3.5 is the opposite of the order (currently) used by the
rest of the SCSI industry. If you have BIOS version 3.4 or 3.5, and have
more then one drive, then the drive ordering will be the reverse of that
which you see under DOS. For example, under DOS SCSI ID 0 will be D: and
SCSI ID 1 will be C: (the boot device). Under Linux, SCSI ID 0 will be
/dev/sda and SCSI ID 1 will be /dev/sdb. The Linux ordering is consistent
with that provided by all the other SCSI drivers for Linux. If you want
this changed, send me patches that are protected by #ifdefs.
If you have a TMC-8xx or TMC-9xx board, then this is not the driver for
your board. Please refer to the Seagate driver for more information and
possible support.
......@@ -120,6 +130,9 @@
patches that support the TMC-3260, a PCI bus card with the 36C70 chip.
The 36C70 chip appears to be "completely compatible" with the 18C30 chip.
Thanks to Eric Kasten (tigger@petroglyph.cl.msu.edu) for providing the
patch for the version 3.5 BIOS.
All of the alpha testers deserve much thanks.
......@@ -133,14 +146,14 @@
devices support parity, then you can probably get the driver to work by
turning this option off. I have no way of testing this, however.
FIFO_COUNT: The host adapter has an 8K cache. When this many 512 byte
blocks are filled by the SCSI device, an interrupt will be raised.
Therefore, this could be as low as 0, or as high as 16. Note, however,
that values which are too high or too low seem to prevent any interrupts
from occuring, and thereby lock up the machine. I have found that 2 is a
good number, but throughput may be increased by changing this value to
values which are close to 2. Please let me know if you try any different
values.
FIFO_COUNT: The host adapter has an 8K cache (host adapters based on the
18C30 chip have a 2k cache). When this many 512 byte blocks are filled by
the SCSI device, an interrupt will be raised. Therefore, this could be as
low as 0, or as high as 16. Note, however, that values which are too high
or too low seem to prevent any interrupts from occuring, and thereby lock
up the machine. I have found that 2 is a good number, but throughput may
be increased by changing this value to values which are close to 2.
Please let me know if you try any different values.
DO_DETECT: This activates some old scan code which was needed before the
high level drivers got fixed. If you are having trouble with the driver,
......@@ -150,11 +163,11 @@
RESELECTION: This is no longer an option, since I gave up trying to
implement it in version 4.x of this driver. It did not improve
performance at all and made the driver unstable (because I never found one
of the two race conditions which were introduced by multiple outstanding
commands). The instability seems a very high price to pay just so that
you don't have to wait for the tape to rewind. When I have time, I will
work on this again. In the interim, if anyone wants to work on the code,
I can give them my latest version.
of the two race conditions which were introduced by the multiple
outstanding command code). The instability seems a very high price to pay
just so that you don't have to wait for the tape to rewind. If you want
this feature implemented, send me patches. I'll be happy to send a copy
of my (broken) driver to anyone who would like to see a copy.
**************************************************************************/
......@@ -169,7 +182,7 @@
#include <linux/string.h>
#include <linux/ioport.h>
#define VERSION "$Revision: 5.18 $"
#define VERSION "$Revision: 5.20 $"
/* START OF USER DEFINABLE OPTIONS */
......@@ -292,7 +305,9 @@ static void *addresses[] = {
(void *)0xc8000,
(void *)0xca000,
(void *)0xce000,
(void *)0xde000 };
(void *)0xde000,
(void *)0xd0000, /* Extra addresses for PCI boards */
};
#define ADDRESS_COUNT (sizeof( addresses ) / sizeof( unsigned ))
static unsigned short ports[] = { 0x140, 0x150, 0x160, 0x170 };
......@@ -341,6 +356,7 @@ struct signature {
{ "FUTURE DOMAIN CORP. (C) 1992 V3.00.004/02/92", 5, 44, 3, 0, 0 },
{ "FUTURE DOMAIN TMC-18XX (C) 1993 V3.203/12/93", 5, 44, 3, 2, 0 },
{ "Future Domain Corp. V1.0008/18/93", 5, 33, 3, 4, 0 },
{ "FUTURE DOMAIN CORP. V3.5008/18/93", 5, 34, 3, 5, 0 },
{ "Future Domain Corp. V1.0008/18/93", 26, 33, 3, 4, 1 },
{ "FUTURE DOMAIN TMC-18XX", 5, 22, -1, -1, 0 },
......@@ -459,11 +475,15 @@ static int fdomain_is_valid_port( int port )
#endif
/* Check for board with lowest bios_base --
this isn't valid for the 18c30, so just
assume we have the right board. */
this isn't valid for the 18c30 or for
boards on the PCI bus, so just assume we
have the right board. */
if (chip != tmc18c30 && addresses[ (options & 0xc0) >> 6 ] != bios_base)
return 0;
if (chip != tmc18c30
&& !PCI_bus
&& addresses[ (options & 0xc0) >> 6 ] != bios_base) return 0;
/* Get the IRQ from the options. */
interrupt_level = ints[ (options & 0x0e) >> 1 ];
......@@ -587,18 +607,15 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
}
} else {
/* The proper way of doing this is to use the PCI BIOS call
(interrupt 0x1a) to determine the device IRQ and interrupt
level. Then the port_base will be in configuration register
0x10 (and configuration register 0x30 will contain the value of
bios_base).
/* The proper way of doing this is to use ask the PCI bus for the
device IRQ and interrupt level.
Until the Linux kernel supports this sort of PCI bus query, we
scan down a bunch of addresses (Future Domain folks say we
should find the address before we get to 0xf800). This works
fine on some systems -- other systems may have to scan more
addresses. If you have to modify this section for your
installation, please send mail to faith@cs.unc.edu. */
scan down a bunch of addresses (Future Domain tech support says
we will probably find the address before we get to 0xf800).
This works fine on some systems -- other systems may have to
scan more addresses. If you have to modify this section for
your installation, please send mail to faith@cs.unc.edu. */
for (i = 0xff00; !flag && i > 0xf000; i -= 8) {
port_base = i;
......@@ -798,6 +815,7 @@ static int fdomain_select( int target )
{
int status;
unsigned long timeout;
static int flag = 0;
outb( 0x82, SCSI_Cntl_port ); /* Bus Enable + Select */
......@@ -806,11 +824,9 @@ static int fdomain_select( int target )
/* Stop arbitration and enable parity */
outb( PARITY_MASK, TMC_Cntl_port );
#if 0
timeout = jiffies + 25; /* 250mS */
#else
timeout = jiffies + 35; /* 350mS -- because of timeouts */
#endif
timeout = jiffies + 35; /* 350mS -- because of timeouts
(was 250mS) */
while (jiffies < timeout) {
status = inb( SCSI_Status_port ); /* Read adapter status */
if (status & 1) { /* Busy asserted */
......@@ -825,7 +841,12 @@ static int fdomain_select( int target )
if (!target) printk( "Selection failed\n" );
#endif
#if ERRORS_ONLY
if (!target) printk( "Future Domain: Selection failed\n" );
if (!target) {
if (chip == tmc18c30 && !flag) /* Skip first failure for 18C30 chips. */
++flag;
else
printk( "Future Domain: Selection failed\n" );
}
#endif
return 1;
}
......
......@@ -157,6 +157,7 @@ static struct blist blacklist[] =
* controller, which causes SCSI code to reset bus.*/
{"QUANTUM","LPS525S","3110"},/* Locks sometimes if polled for lun != 0 */
{"QUANTUM","PD1225S","3110"},/* Locks sometimes if polled for lun != 0 */
{"MEDIAVIS","CDR-H93MV","1.31"}, /* Locks up if polled for lun != 0 */
{NULL, NULL, NULL}};
static int blacklisted(unsigned char * response_data){
......
......@@ -11,7 +11,7 @@
Copyright 1992, 1993, 1994 Kai Makisara
email makisara@vtinsx.ins.vtt.fi or Kai.Makisara@vtt.fi
Last modified: Wed Jun 22 23:37:10 1994 by root@kai.home
Last modified: Tue Oct 25 19:37:33 1994 by root@kai.home
*/
#include <linux/fs.h>
......@@ -415,6 +415,7 @@ scsi_tape_open(struct inode * inode, struct file * filp)
STp->dirty = 0;
STp->rw = ST_IDLE;
if (STp->eof != ST_EOD) /* Save EOD across opens */
STp->eof = ST_NOEOF;
STp->eof_hit = 0;
STp->recover_count = 0;
......@@ -450,6 +451,7 @@ scsi_tape_open(struct inode * inode, struct file * filp)
if (SCpnt->request.dev == dev) sleep_on( &(STp->waiting) );
(STp->mt_status)->mt_fileno = STp->drv_block = 0;
STp->eof = ST_NOEOF;
}
if ((STp->buffer)->last_result_fatal != 0) {
......@@ -601,7 +603,7 @@ scsi_tape_close(struct inode * inode, struct file * filp)
#ifdef DEBUG
if (debugging)
printk("st%d: File length %ld bytes.\n", dev, filp->f_pos);
printk("st%d: File length %ld bytes.\n", dev, (long)(filp->f_pos));
#endif
if (result == 0 || result == (-ENOSPC)) {
......@@ -1053,6 +1055,7 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count)
printk("st%d: Zero returned for first BLANK CHECK after EOF.\n",
dev);
#endif
STp->eof = ST_EOD;
return 0; /* First BLANK_CHECK after EOF */
}
else
......@@ -1098,7 +1101,7 @@ st_read(struct inode * inode, struct file * filp, char * buf, int count)
STp->eof_hit = 1;
SCpnt->request.dev = -1; /* Mark as not busy */
if (total == 0 && STp->eof == ST_FM) {
STp->eof = 0;
STp->eof = ST_NOEOF;
STp->drv_block = 0;
if (STp->moves_after_eof > 1)
STp->moves_after_eof = 0;
......@@ -1253,18 +1256,58 @@ st_int_ioctl(struct inode * inode,struct file * file,
if (blkno >= 0)
blkno -= arg;
break;
case MTFSS:
cmd[0] = SPACE;
cmd[1] = 0x04; /* Space Setmarks */
cmd[2] = (arg >> 16);
cmd[3] = (arg >> 8);
cmd[4] = arg;
#ifdef DEBUG
if (debugging)
printk("st%d: Spacing tape forward %d setmarks.\n", dev,
cmd[2] * 65536 + cmd[3] * 256 + cmd[4]);
#endif
if (arg != 0)
blkno = fileno = (-1);
break;
case MTBSS:
cmd[0] = SPACE;
cmd[1] = 0x04; /* Space Setmarks */
ltmp = (-arg);
cmd[2] = (ltmp >> 16);
cmd[3] = (ltmp >> 8);
cmd[4] = ltmp;
#ifdef DEBUG
if (debugging) {
if (cmd[2] & 0x80)
ltmp = 0xff000000;
ltmp = ltmp | (cmd[2] << 16) | (cmd[3] << 8) | cmd[4];
printk("st%d: Spacing tape backward %ld setmarks.\n", dev, (-ltmp));
}
#endif
if (arg != 0)
blkno = fileno = (-1);
break;
case MTWEOF:
case MTWSM:
if (STp->write_prot)
return (-EACCES);
cmd[0] = WRITE_FILEMARKS;
if (cmd_in == MTWSM)
cmd[1] = 2;
cmd[2] = (arg >> 16);
cmd[3] = (arg >> 8);
cmd[4] = arg;
timeout = ST_TIMEOUT;
#ifdef DEBUG
if (debugging)
if (debugging) {
if (cmd_in == MTWEOF)
printk("st%d: Writing %d filemarks.\n", dev,
cmd[2] * 65536 + cmd[3] * 256 + cmd[4]);
else
printk("st%d: Writing %d setmarks.\n", dev,
cmd[2] * 65536 + cmd[3] * 256 + cmd[4]);
}
#endif
fileno += arg;
blkno = 0;
......@@ -1503,9 +1546,12 @@ st_int_ioctl(struct inode * inode,struct file * file,
else
STp->drv_block = (-1);
}
if (STp->eof == ST_NOEOF &&
(SCpnt->sense_buffer[2] & 0x0f) == BLANK_CHECK)
STp->eof = ST_EOD;
}
return ioctl_result ;
return ioctl_result;
}
......@@ -1576,9 +1622,26 @@ st_ioctl(struct inode * inode,struct file * file,
(STp->mt_status)->mt_blkno -= ((STp->buffer)->buffer_bytes +
STp->block_size - 1) / STp->block_size;
}
(STp->mt_status)->mt_gstat = 0;
if (STp->drv_write_prot)
(STp->mt_status)->mt_gstat |= GMT_WR_PROT(0xffffffff);
if ((STp->mt_status)->mt_blkno == 0) {
if ((STp->mt_status)->mt_fileno == 0)
(STp->mt_status)->mt_gstat |= GMT_BOT(0xffffffff);
else
(STp->mt_status)->mt_gstat |= GMT_EOF(0xffffffff);
}
if (STp->eof == ST_EOM_OK || STp->eof == ST_EOM_ERROR)
(STp->mt_status)->mt_gstat |= GMT_EOT(0xffffffff);
else if (STp->eof == ST_EOD)
(STp->mt_status)->mt_gstat |= GMT_EOD(0xffffffff);
if (STp->density == 1)
(STp->mt_status)->mt_gstat |= GMT_D_800(0xffffffff);
else if (STp->density == 2)
(STp->mt_status)->mt_gstat |= GMT_D_1600(0xffffffff);
else if (STp->density == 3)
(STp->mt_status)->mt_gstat |= GMT_D_6250(0xffffffff);
memcpy_tofs((char *)arg, (char *)(STp->mt_status),
sizeof(struct mtget));
......
......@@ -55,6 +55,7 @@ typedef struct {
#define ST_FM 1
#define ST_EOM_OK 2
#define ST_EOM_ERROR 3
#define ST_EOD 4
/* Values of rw */
#define ST_IDLE 0
......
......@@ -112,7 +112,7 @@ hw_entry hw_table[] =
{B (OPT_SB), B (OPT_PAS), "SBPRO", 1, 0, 1},
{B (OPT_SB) | B (OPT_SBPRO), B (OPT_PAS), "SB16", 1, 0, 1},
{B (OPT_PSS) | B (OPT_SB) | B (OPT_PAS) | B (OPT_GUS), 0, "AUDIO", 1, 0, 1},
{B (OPT_PSS) | B (OPT_SB) | B (OPT_PAS) | B (OPT_GUS) | B (OPT_MSS), 0, "AUDIO", 1, 0, 1},
{B (OPT_MPU401), 0, "MIDI_AUTO", 0, OPT_MIDI, 0},
{B (OPT_PSS) | B (OPT_SB) | B (OPT_PAS) | B (OPT_MPU401) | B (OPT_GUS), 0, "MIDI", 1, 0, 1},
{B (OPT_ADLIB), 0, "YM3812_AUTO", 0, OPT_YM3812, 0},
......
......@@ -43,9 +43,15 @@ static struct fileinfo files[SND_NDEVS];
int
snd_ioctl_return (int *addr, int value)
{
int error;
if (value < 0)
return value;
error = verify_area(VERIFY_WRITE, addr, sizeof(int));
if (error)
return error;
PUT_WORD_TO_USER (addr, 0, value);
return 0;
}
......
......@@ -31,6 +31,7 @@ int block_write(struct inode * inode, struct file * filp, char * buf, int count)
unsigned int dev;
struct buffer_head * bh, *bufferlist[NBUF];
register char * p;
int excess;
write_error = buffercount = 0;
dev = inode->i_rdev;
......@@ -86,8 +87,9 @@ int block_write(struct inode * inode, struct file * filp, char * buf, int count)
blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9) / 2;
if (block + blocks > size) blocks = size - block;
if (blocks > NBUF) blocks=NBUF;
blocks -= (block % blocks_per_cluster);
if(!blocks) blocks = 1;
excess = (block + blocks) % blocks_per_cluster;
if ( blocks > excess )
blocks -= excess;
bhlist[0] = bh;
for(i=1; i<blocks; i++){
if(((i+block) % blocks_per_cluster) == 0) {
......@@ -102,6 +104,7 @@ int block_write(struct inode * inode, struct file * filp, char * buf, int count)
};
ll_rw_block(READ, blocks, bhlist);
for(i=1; i<blocks; i++) brelse(bhlist[i]);
wait_on_buffer(bh);
};
};
......@@ -168,6 +171,7 @@ int block_read(struct inode * inode, struct file * filp, char * buf, int count)
loff_t size;
unsigned int dev;
int read;
int excess;
dev = inode->i_rdev;
blocksize = BLOCK_SIZE;
......@@ -205,7 +209,9 @@ int block_read(struct inode * inode, struct file * filp, char * buf, int count)
if (filp->f_reada) {
if (blocks < read_ahead[MAJOR(dev)] / (blocksize >> 9))
blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9);
blocks -= (block % blocks_per_cluster);
excess = (block + blocks) % blocks_per_cluster;
if ( blocks > excess )
blocks -= excess;
if (rblocks > blocks)
blocks = rblocks;
......
......@@ -50,8 +50,6 @@
asmlinkage int sys_exit(int exit_code);
asmlinkage int sys_brk(unsigned long);
extern void shm_exit (void);
static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
static int load_aout_library(int fd);
static int aout_core_dump(long signr, struct pt_regs * regs);
......@@ -197,6 +195,8 @@ static int aout_core_dump(long signr, struct pt_regs * regs)
goto end_coredump;
if (!inode->i_op || !inode->i_op->default_file_ops)
goto end_coredump;
if (get_write_access(inode))
goto end_coredump;
file.f_mode = 3;
file.f_flags = 0;
file.f_count = 1;
......@@ -206,7 +206,7 @@ static int aout_core_dump(long signr, struct pt_regs * regs)
file.f_op = inode->i_op->default_file_ops;
if (file.f_op->open)
if (file.f_op->open(inode,&file))
goto end_coredump;
goto done_coredump;
if (!file.f_op->write)
goto close_coredump;
has_dumped = 1;
......@@ -273,6 +273,8 @@ static int aout_core_dump(long signr, struct pt_regs * regs)
close_coredump:
if (file.f_op->release)
file.f_op->release(inode,&file);
done_coredump:
put_write_access(inode);
end_coredump:
set_fs(fs);
iput(inode);
......@@ -529,8 +531,6 @@ void flush_old_exec(struct linux_binprm * bprm)
current->comm[i++] = ch;
}
current->comm[i] = '\0';
if (current->shm)
shm_exit();
/* Release all of the old mmap stuff. */
mpnt = current->mm->mmap;
......@@ -636,6 +636,11 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
retval = -EACCES;
goto exec_error2;
}
/* better not execute files which are being written to */
if (bprm.inode->i_wcount > 0) {
retval = -ETXTBSY;
goto exec_error2;
}
memset(bprm.buf,0,sizeof(bprm.buf));
old_fs = get_fs();
set_fs(get_ds());
......@@ -844,17 +849,15 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
goto beyond_if;
}
if (ex.a_text) {
error = do_mmap(file, N_TXTADDR(ex), ex.a_text,
PROT_READ | PROT_EXEC,
MAP_FIXED | MAP_SHARED | MAP_DENYWRITE | MAP_EXECUTABLE,
MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
fd_offset);
if (error != N_TXTADDR(ex)) {
sys_close(fd);
send_sig(SIGSEGV, current, 0);
return -EINVAL;
}
send_sig(SIGKILL, current, 0);
return error;
}
error = do_mmap(file, N_TXTADDR(ex) + ex.a_text, ex.a_data,
......@@ -863,8 +866,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
fd_offset + ex.a_text);
sys_close(fd);
if (error != N_TXTADDR(ex) + ex.a_text) {
send_sig(SIGSEGV, current, 0);
return -EINVAL;
send_sig(SIGKILL, current, 0);
return error;
}
}
beyond_if:
......
......@@ -6,6 +6,12 @@ Changes from version 0.5 to version 0.5a
- The famous readdir() bug has been fixed by Stephen Tweedie.
- Added a revision level in the superblock.
- Full support for O_SYNC flag of the open system call.
- New mount options: `resuid=#uid' and `resgid=#gid'. `resuid' causes
ext2fs to consider user #uid like root for the reserved blocks.
`resgid' acts the same way with group #gid. New fields in the
superblock contain default values for resuid and resgid and can
be modified by tune2fs.
Idea comes from Rene Cougnenc <cougnenc@renux.frmug.fr.net>.
- New mount options: `bsddf' and `minixdf'. `bsddf' causes ext2fs
to remove the blocks used for FS structures from the total block
count in statfs. With `minixdf', ext2fs mimics Minix behavior
......
......@@ -270,7 +270,10 @@ int ext2_new_block (struct super_block * sb, unsigned long goal,
}
lock_super (sb);
es = sb->u.ext2_sb.s_es;
if (es->s_free_blocks_count <= es->s_r_blocks_count && !fsuser()) {
if (es->s_free_blocks_count <= es->s_r_blocks_count &&
(!fsuser() && (sb->u.ext2_sb.s_resuid != current->fsuid) &&
(sb->u.ext2_sb.s_resgid == 0 ||
!in_group_p (sb->u.ext2_sb.s_resgid)))) {
unlock_super (sb);
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