Re: Linux 2.4.2-ac27

2001-04-02 Thread Alan Cox

> This is consistent throughout all 2.4.x at least. From your comment I've
> learnt SuS v2 requires -ENODEV for the len=0 case. While this would

it needs -ENODEV for all cases where you mmap a file which does not support
mmap operations. A 0 length mmap could return the address, EINVAL and maybe
some other stuff. 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Linux 2.4.2-ac27

2001-03-29 Thread Martin Diehl


(Linus cc'ed - related thread: 243-pre[78]: mmap changes (breaks) /proc)

On Wed, 28 Mar 2001, Alan Cox wrote:

> 2.4.2-ac27
> o Revert mmap change that broke assumptions (and  (Martin Diehl)
>   it seems SuS) 

the reason to suggest keeping the test was not due to len=0 behaviour of
mmap in general as is suggested by your comment. The breakage that I've
seen was due to mmap not returning -ENODEV for files from /proc despite
the lack of valid f_op->mmap (because the test was moved behind the len==0
check). The point is sed(1) first tries to mmap(2) the file and falls back
to read(2) in case of -ENODEV (and probably other errors too). This is
important for /proc since most files there are stat'ed size=0 but return
stuff when reading. Not getting error for mmap len=0 file makes sed assume
EOF. Anyway, reverting it was not addressed to cases where f_op->mmap is
valid but request is to mmap len=0 - we still return the startaddr 
parameter in that case:

$ touch nullfile
$ strace sed 's/./X/' nullfile
open("nullfile", O_RDONLY|O_LARGEFILE)  = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 0, PROT_READ, MAP_PRIVATE, 4, 0) = 0

This is consistent throughout all 2.4.x at least. From your comment I've
learnt SuS v2 requires -ENODEV for the len=0 case. While this would
resolve the /proc issue as well there might be some chance to brake code
which expects mmap(len=0) to succeed.
BTW, man-pages (1.31) say, mmap(2) returns -EINVAL if called with bad
start/length/offset values - but makes no claims whether len=0 would be
valid or not.

In case we want to follow what you've said about SuS, the right thing
might simply go along

--- linux-243-pre8/mm/mmap.cWed Mar 28 13:14:19 2001
+++ linux-243p8-md/mm/mmap.cThu Mar 29 09:49:34 2001
@@ -204,8 +204,12 @@
int correct_wcount = 0;
int error;
 
+   /* We need to error mmaps of 0 length. The apps rely on this and
+  SuS v2 says that we return -ENODEV in this case without mentioning
+  returning 0 for 0 length mmap */
+
if ((len = PAGE_ALIGN(len)) == 0)
-   return addr;
+   return -ENODEV;
 
if (len > TASK_SIZE || addr > TASK_SIZE-len)
return -EINVAL;

I really have no idea about what, if any, code might rely on old
beahviour. Some commonly used tools may get confused with stuff from
/var/lock/subsys tree for example. So probably it's better not to field
this change before 2.5 to be able to identify such things in time.
In this case we could add some clarification to your comment, saying that
returning error on len=0 is a future thing, leave the current len=0
semantics untouched, keep the f_op->mmap test at the very beginning (and
drop the moved one a few lines below).

Regards
Martin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Linux 2.4.2-ac27

2001-03-28 Thread Martin Diehl


(Linus cc'ed - related thread: 243-pre[78]: mmap changes (breaks) /proc)

On Wed, 28 Mar 2001, Alan Cox wrote:

> 2.4.2-ac27
> o Revert mmap change that broke assumptions (and  (Martin Diehl)
>   it seems SuS) 

the reason to suggest keeping the test was not due to len=0 behaviour of
mmap in general as is suggested by your comment. The breakage that I've
seen was due to mmap not returning -ENODEV for files from /proc despite
the lack of valid f_op->mmap (because the test was moved behind the len==0
check). The point is sed(1) first tries to mmap(2) the file and falls back
to read(2) in case of -ENODEV (and probably other errors too). This is
important for /proc since most files there are stat'ed size=0 but return
stuff when reading. Not getting error for mmap len=0 file makes sed behave
like at EOF. Anyway, reverting it was not addressed to cases where
f_op->mmap is valid but request is to mmap len=0 - we still return the 
startaddr parameter in that case:

$ touch nullfile
$ strace sed 's/./X/' nullfile
open("nullfile", O_RDONLY|O_LARGEFILE)  = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 0, PROT_READ, MAP_PRIVATE, 4, 0) = 0

This is consistent throughout all 2.4.x at least. From your comment I've
learnt SuS v2 requires -ENODEV for the len=0 case. While this would
resolve the /proc issue as well there might be some chance to brake code
which expects mmap(len=0) to succeed.
BTW, man-pages (1.31) say, mmap(2) returns -EINVAL if called with bad
start/length/offset values - but makes no claims whether len=0 would be
valid or not.

In case we want to follow what you've said about SuS, the right thing
might simply go along

--- linux-243-pre8/mm/mmap.cWed Mar 28 13:14:19 2001
+++ linux-243p8-md/mm/mmap.cThu Mar 29 09:49:34 2001
@@ -204,8 +204,12 @@
int correct_wcount = 0;
int error;
 
+   /* We need to error mmaps of 0 length. The apps rely on this and
+  SuS v2 says that we return -ENODEV in this case without mentioning
+  returning 0 for 0 length mmap */
+
if ((len = PAGE_ALIGN(len)) == 0)
-   return addr;
+   return -ENODEV;
 
if (len > TASK_SIZE || addr > TASK_SIZE-len)
return -EINVAL;

I really have no idea about what, if any, code might rely on old
beahviour. Some commonly used tools may get confused with stuff from
/var/lock/subsys tree for example. So probably it's better not to field
this change before 2.5 to be able to identify such things in time.
In this case we could add some clarification to your comment, saying that
returning error on len=0 is a future thing, leave the current len=0
semantics untouched, keep the f_op->mmap test at the very beginning (and
drop the moved one a few lines below).

Regards
Martin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Linux-2.4.2-ac27 - read on /proc/bus/pci/devices never finishes after rmmod aic7xxx

2001-03-28 Thread Jeffrey Hundstad

I don't mean to walk on folks but I did make a patch that brings the ac27
version from aic7xxx-6.1.5 to aic7xxx-6.1.8.  I've compiled it and inserted it
and removed it without any of the hanging problems I encountered before.  But
the tests stopped there, no guarantees from me, I wish I could ;-)  Please
ignore this if you get something better.  I included Mr. Gibbs changelog (for
the changes from 6.1.5 to 6.1.8 his log is QUITE detailed.)

Thanks to everyone!

--
Jeffrey Hundstad


Alan Cox wrote:

> > What version of the aic7xxx driver is embedded in 2.4.2-ac27?  This
> > particular issue was fixed just after 6.1.5 was released.
>
> The last patch you sent to me + small other fixups for aicdb.h. I dont have
> time to chase after peoples drivers. If you want a newer aic7xxx in -ac just
> mail me a diff to update to it

 CHANGELOG-6.1.5-6.1.8.gz
 linux-2.4.2-ac27-aic7xxx-6.1.5-6.1.8.patch.gz


Re: Linux-2.4.2-ac27 - read on /proc/bus/pci/devices never finishes after rmmod aic7xxx

2001-03-28 Thread Justin T. Gibbs

>> What version of the aic7xxx driver is embedded in 2.4.2-ac27?  This
>> particular issue was fixed just after 6.1.5 was released.
>
>The last patch you sent to me + small other fixups for aicdb.h. I dont have
>time to chase after peoples drivers. If you want a newer aic7xxx in -ac just
>mail me a diff to update to it

I don't recall ever sending you diffs for the driver.  My guess is that
6.1.5 got integrated into -ac from Linus' tree.

Up to now, I haven't been tracking -ac kernels.  I started sending
diffs to Linus based on the pre series kernels.  No-one has requested
patch sets against -ac kernels, but if I need to support this branch,
I'll start generating them and passing them your way.

Chasing after all of the kernel versions can be time consuming for
driver developers too. ;-)

--
Justin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Linux-2.4.2-ac27 - read on /proc/bus/pci/devices never finishes after rmmod aic7xxx

2001-03-28 Thread Alan Cox

> What version of the aic7xxx driver is embedded in 2.4.2-ac27?  This
> particular issue was fixed just after 6.1.5 was released.

The last patch you sent to me + small other fixups for aicdb.h. I dont have
time to chase after peoples drivers. If you want a newer aic7xxx in -ac just
mail me a diff to update to it

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Linux-2.4.2-ac27 - read on /proc/bus/pci/devices never finishes after rmmod aic7xxx

2001-03-28 Thread Justin T. Gibbs

>aic7xxx_osm.h:#define AIC7XXX_DRIVER_VERSION  "6.1.5"

Pick up the latest from here:

http://people.FreeBSD.org/~gibbs/linux/

--
Justin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Linux-2.4.2-ac27 - read on /proc/bus/pci/devices never finishes after rmmod aic7xxx

2001-03-28 Thread Jeffrey Hundstad

aic7xxx_osm.h:#define AIC7XXX_DRIVER_VERSION  "6.1.5"


"Justin T. Gibbs" wrote:

> >Hello,
> >
> >I'm using Linux-2.4.2-ac27 SMP compiled with gcc version 2.95.2 2220
> >(Debian GNU/Linux).
>
> What version of the aic7xxx driver is embedded in 2.4.2-ac27?  This
> particular issue was fixed just after 6.1.5 was released.
>
> --
> Justin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Linux-2.4.2-ac27 - read on /proc/bus/pci/devices never finishes after rmmod aic7xxx

2001-03-28 Thread Justin T. Gibbs

>Hello,
>
>I'm using Linux-2.4.2-ac27 SMP compiled with gcc version 2.95.2 2220
>(Debian GNU/Linux).

What version of the aic7xxx driver is embedded in 2.4.2-ac27?  This
particular issue was fixed just after 6.1.5 was released.

--
Justin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Linux-2.4.2-ac27 - read on /proc/bus/pci/devices never finishes after rmmod aic7xxx

2001-03-28 Thread Jeffrey Hundstad

Hello,

I'm using Linux-2.4.2-ac27 SMP compiled with gcc version 2.95.2 2220
(Debian GNU/Linux).

After an "insmod aic7xxx" "cat /proc/bus/pci/devices" works just fine.
After an "rmmod aic7xxx" "cat /proc/bus/pci/devices" fails to produce
any output and never finishes.  Top show the process in R state taking
as much CPU as it can get.

Killing the process doesn't do anything, rebooting is the only way to
get rid of it.  This problem does not happen with aic7xxx_old.

Strace shows a "read" on the fd of /proc/bus/pci/devices that never
finishes.

My aic7xxx devices as reported by "lspci -vvv":

00:12.0 SCSI storage controller: Adaptec AIC-7881U (rev 01)
Subsystem: Adaptec: Unknown device 7881
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
ParErr- Stepping- SERR+ FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
SERR- http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Linux 2.4.2-ac27

2001-03-28 Thread Alan Cox


ftp://ftp.kernel.org/pub/linux/kernel/people/alan/2.4/

Intermediate diffs are available from

http://www.bzimage.org

(Note that the cmsfs port to 2.4 is a work in progress)

2.4.2-ac27
o   Rely on BIOS to setup apic bits on OSB4 (me)
o   Disable events when unloading cardbus yenta (me)
| Fixes shared irq unload hang
o   Fix x86 IPI replay problems (Stephen Tweedie)
o   Add ALS100 gameport support (Vojtech Pavlik)
o   Fix wrong path in comment in vesafb (Andres Salomon)
o   Allow slab caches to force alignment always (Ingo Molnar)
and thus fix PAE+ slab poisoning
o   Fix problems in faulting raw I/O pages  (Stephen Tweedie)
o   Fix rawio error handling for raw I/O(Stephen Tweedie)
| + other oddments
o   Change default max printer ports to 8   (Tim Waugh)
o   Parport soft control state fixes(Tim Waugh)
o   Fix cpu info compile(Constantine Gavrilov)
o   Set warning levels on reiserfs warn etc (Paul Mundt)
o   Fix duplicate IOVIRT debug config help  (Steven Cole)
o   Revert mmap change that broke assumptions (and  (Martin Diehl)
it seems SuS) 
o   Clean up fpu emu warnings on gcc 3.0cvs a bit   (me)

2.4.2-ac26
o   Fix es1370 build bug(me)
o   Fix sbpcd compile warnings  (me)
o   Update usbnet driver(Oleg Drokin)
o   Update Alpha to pre8 vm changes (Ivan Kokshaysky)
o   Fix radeonfb config selections  (Chris Lawrence)
o   Fix vmalloc mismerge(Various)
o   Fix n_r3964 console panic   (Andrew Morton)
o   Update ibm camera drivers
o   Support 701b toshoboe fir
o   New xircom_cb driver(Arjan van de Ven, Jeff Garzik,
 Don Becker, Doug Ledford)
o   Fix procfs mount point for binfmt_misc  (Al Viro)
o   Update hpt366 ide blacklist
o   Further ide blacklist updates
o   Smooth vm balancing (Marcelo Tosatti)
o   Fix irda assert (Arjan van de Ven)
o   Keep contrack cache sizes sane  (Ben LaHaise)
o   Fix possible file truncate/write race   (Ben LaHaise)
o   Make bootmem panic sanely on out of memory  (Ben LaHaise)
o   Fix unload crash in pci_socket  (me)
o   Revert previous wrong bootmem change(Ben LaHaise)

2.4.2-ac25
o   Handle PCI/ISA simple MP tables via ELCR(John William)
o   Fix get_sb_single   (Al Viro)
o   Update es1370, es1371,esssolo   (Thomas Sailer,
 Tjeerd Mulder,
 Nathanial Daw)
o   Update orinoco_cs   (Jean Tourilhes)
o   Fix races found in the new kbd/console code (Andrew Morton)
o   Remove dead timer.h docs(Tim Wright)
o   Update ppc to new generic mm changes(Paul Mackerras)
o   Clean up mdacon (Paul Gortmaker)
o   Remove duplicate configure.help texts   (Steven Cole)
o   Fix symbol export for shm_file_open (Keith Owens)
o   First batch of pointer reference bug fixes  (Andrew Morton)
from Stanford report
o   Fix de4x5 oops on Alpha XP1000  (George France)
o   Chipsfb update  (Paul Mackerras)
o   Fix higmem block_prepare_write crash(Stephen Tweedie)
o   Bring PAE36 back up to date, handle x86 errata  (Ingo Molnar)
o   Fix ov511 crash if opened while loading (Pete Zaitcev)
o   Merge Linus 2.4.3pre8
o   Update Advansys scsi driver (Bob Frey)

2.4.2-ac24
o   Fix build bug with tsc in ac23  (me)
o   Update contact info for Phil Blundell   (Phil Blundell)
o   Update mm locking comments/rss locking  (Andrew Morton)
o   Update toshiba SMM driver   (Jonathan Buzzard)
o   Update old adaptec driver to 5.2.4  (Doug Ledford)
o   CS46xx updates  (Tom Woller)
o   Quieten input layer printks a bit   (me)
o   Turn off APIC_DEBUG by default to cut noise down(me)
o   Add Orinoco PCMCIA wireless support (David Gibson)
o   Go back to 2.4.3pre6 tulip  (Jeff Garzik)
o   Fix double accounting of cpu time bug   (Kevin Buhr)
o   Drop ppp patch  (me)

2.4.2-ac23