2003-05-14 10:13:19

by Andrew Morton

[permalink] [raw]
Subject: 2.6 must-fix list, v3


Quite a lot of changes here. Mostly additions, but some things have been
crossed off.

Also at ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/must-fix

--- notes/must-fix-1.txt 12 May 2003 22:53:08 -0000 1.10
+++ notes/must-fix-1.txt 14 May 2003 02:33:30 -0000 1.17
@@ -11,7 +11,21 @@

- Other problems: aviro, dipankar, Alan have details.

+ - somebody will have to document the tty driver and ldisc API

+drivers/char/rtc/
+-----------------
+
+- rmk: I think we need a generic RTC driver (which is backed by real RTCs).
+ Integrator-based stuff has a 32-bit 1Hz counter RTC with alarm, as has the
+ SA11xx, and probably PXA. There's another implementation for the RiscPC
+ and ARM26 stuff. I'd rather not see 4 implementations of the RTC userspace
+ API, but one common implementation so that stuff gets done in a consistent
+ way.
+
+ We postponed this at the beginning of 2.4 until 2.5 happened. We're now
+ at 2.5, and I'm about to add at least one more (the Integrator
+ implementation.) This isn't sane imo.

drivers/block/
--------------
@@ -58,7 +72,62 @@
seems to be some cases that don't work too well. Don't really have a
handle on those :/

-- IDE tcq. Either kill it or fix it. Not a "big todo", as such.
+drivers/input/
+--------------
+
+- rmk: unconverted keyboard/mouse drivers (there's a deadline of 2.6.0
+ currently on these remaining in my/Linus' tree.)
+
+- synaptic touchpad support
+
+drivers/misc/
+-------------
+
+- rmk: UCB1[23]00 drivers, currently sitting in drivers/misc in the ARM
+ tree. (touchscreen, audio, gpio, type device.)
+
+drivers/net/
+------------
+
+- rmk: network drivers. ARM people like to add tonnes of #ifdefs into
+ these to customise them to their hardware platform (eg, chip access
+ methods, addresses, etc.) I cope with this by not integrating them into my
+ tree. The result is that many ARM platforms can't be built from even my
+ tree without extra patches. This isn't sane, and has bred a culture of
+ network drivers not being submitted. I don't see this changing for 2.6
+ though.
+
+drivers/net/irda/
+-----------------
+
+- dongle drivers need to be converted to sir-dev
+
+- irport need to be converted to sir-kthread
+
+- new drivers (irtty-sir/smsc-ircc2/donauboe) need more testing
+
+- rmk: Refuse IrDA initialisation if sizeof(structures) is incorrect (I'm
+ not sure if we still need this; I think gcc 2.95.3 on ARM shows this
+ problem though.)
+
+drivers/pci/
+------------
+
+- alan: Some cardbus crashes the system
+
+- alan: Hotplug locking is hosed
+
+drivers/pcmcia/
+---------------
+
+- alan: Most drivers crash the system on eject randomly with timer bugs. I
+ think after RMK's stuff is in most of the pcmcia/cardbus ones go except the
+ locking disaster.
+
+drivers/pld/
+------------
+
+- rmk: EPXA (ARM platform) PLD hotswap drivers (drivers/pld)

drivers/video/
--------------
@@ -70,6 +139,8 @@

- hch: large parts of the locking are hosed or not existant

+ (Mike Anderson, Patrick Mansfield, Badari Pulavarty)
+
- shost->my_devices isn't locked down at all

- the host list ist locked but not refcounted, mess can happen when the
@@ -84,32 +155,38 @@

- there's some global variables incremented without any locks

+- Convert am53c974, dpt_i2o, initio and pci2220i to DMA-mapping

- (Mike Anderson, Patrick Mansfield, Badari Pulavarty)
+- Make inia100, cpqfc, pci2000 and dc390t compile

- - large parts of the locking are hosed or non existent
+- Convert

- -- shost->my_devices isn't locked at all
+ wd33c99 based: a2091 a3000 gpv11 mvme174 sgiwd93 53c7xx based:
+ amiga7xxx bvme6000 mvme16x initio am53c974 pci2000 pci2220i qla1280
+ sym53c8xx dc390t

- -- host list locked but not refcounted
+ To new error handling

- -- lots of members of struct scsi_host/scsi_device/ scsi_cmd with
- very unclear locking
+ I think the sym53c8xx could probably be pulled out of the tree because
+ the sym_2 replaces it. I'm also looking at converting the qla1280.

- -- lots of volatile abuse in scsi code
+ It also might be possible to shift the 53c7xx based drivers over to
+ 53c700 which does the new EH stuff, but I don't have the hardware to check
+ such a shift.

- -- global variables incremented without locks.
+ For the non-compiling stuff, I've probably missed a few that just aren't
+ compilable on my platforms, so any updates would be welcome. Also, are
+ some of our non-compiling or unconverted drivers obsolete?

-fs/
----
-
-- NFS client gets an OOM deadlock.
+drivers/usb/gadget/
+-------------------

- - Some fixes exist in -mm. Seem to mostly work.
+- rmk: SA11xx USB client/gadget code (David B has been doing some work on
+ this, and keeps trying to prod me, but unfortunately I haven't had the time
+ to look at his work, sorry David.)

-- NFS client runs very slowly consuming 100% CPU under heavy writeout.
-
- - Unsubtle fix exists in -mm. (Looks like it's fixed anyway).
+fs/
+---

- ext3 data=journal mode is bust.

@@ -119,13 +196,6 @@

- Easy fix is to only allow the feature for S_ISBLK files.

-- davej: NFS seems to have a really bad time for some people. (Including
- myself on one testbox). The common factor seems to be a high spec client
- torturing an underpowered NFS server with lots of IO. (fsx/fsstress etc
- show this up). Lots of "NFS server cheating" messages get dumped, and a
- whole lot of bogus packets start appearing. They look severely corrupted,
- (they even crashed ethereal once 8-)
-
- hch: devfs: there's a fundamental lookup vs devfsd race that's only
fixable by introducing a lookup vs devfs deadlock. I can't see how this is
fixable without getting rid of the current devfsd design. Mandrake seems
@@ -147,7 +217,9 @@

- Alan: 32bit uid support is *still* broken for process accounting.

- (Test case?)
+ Create a 32bit uid, turn accounting on. Shock horror it doesn't work
+ because the field is 16bit. We need an acct structure flag day for 2.6
+ IMHO

mm/
---
@@ -175,8 +247,13 @@

- Per-cpu support inside modules (have patch, in testing).

-- driver class code is getting redone. I have this now working, and will
- send it out in a few days.
+- shemminger: The module remove rework that Rusty and Dave are working on
+ needs to be fixed before 2.6. Right now, it is impossible to write a
+ protocol or network device that can be safely unloaded when it is a module.
+
+ See:
+ http://pizda.ninka.net/~davem/modules.html
+

net/
----
@@ -219,7 +296,6 @@
Someone has to get a good log in order for us to effectively debug this.


-
net/*/netfilter/
----------------

@@ -231,6 +307,19 @@

- Module relationship bogosity fix (trivial, have patch).

+sound/
+------
+
+- rmk: several OSS drivers for SA11xx-based hardware in need of
+ ALSA-ification and L3 bus support code for these.
+
+- rmk: linux/sound/drivers/mpu401/mpu401.c and
+ linux/sound/drivers/virmidi.c complained about 'errno' at some time in the
+ past, need to confirm whether this is still a problem.
+
+- rmk: need to complete ALSA-ification of the WaveArtist driver for both
+ NetWinder and other stuff (there's some fairly fundamental differences in
+ the way the mixer needs to be handled for the NetWinder.)

global
------
@@ -255,8 +344,6 @@
- Framework for selecting IO schedulers. This is the main one really.
Once this is in place we can drop in new schedulers any old time, no risk.

-- Dynamic disk request allocation. Patch exists.
-
- Runtime-selectable disk scheduler framework.

- Anticipatory scheduler. Working OK now, still has problems with seeky
@@ -309,6 +396,10 @@
path_walk()/open_namei(). I'm still working on the latter (Peter has
already completed the lookup with intent stuff).

+- rmk: update acorn partition parsing code - making all acorn schemes
+ appear in check.c so we don't have to duplicate the scanning of multiple
+ types, and adding support for eesox partitions.
+

kernel/
-------
@@ -329,6 +420,16 @@

- kexec. Seems to work, is in -mm.

+- rmk: modules / /proc/kcore / vmalloc This needs sorting and testing to
+ ensure that stuff like gdb vmlinux /proc/kcore works as expected. I
+ believe this is the only show stopper preventing any ARM platform being
+ built in Linus' kernel.
+
+- rmk: lib/inflate.c must not use static variables (causes these to be
+ referenced via GOTOFF relocations in PIC decompressor. We have a PIC
+ decompressor to avoid having to hard code a per platform zImage link
+ address into the makefiles.)
+
mm/
---

@@ -372,14 +473,6 @@
This is low priority, because technically it creates suboptimal behavior
rather than mis-operation.

-- IPV4 output engine changes for IPSEC need to be moved over to IPV6.
-
- IPV6 ipsec works but gravely suboptimally in some cases. It is also for
- this reason that the zerocopy UDP stuff isn't functional on the ipv6 side.
-
- The USAGI project (http://www.linux-ipv6.org) is working with Alexey on this
- work.
-
net/*/netfilter/
----------------

@@ -474,15 +567,12 @@
drivers
=======

-- Alan: PCI random reordering from 2.4 to 2.5 isnt understood yet (might be
- fixed now?)
-
- Alan: We have multiple drivers walking the pci device lists and also
using things like pci_find_device in unsafe ways with no refcounting. I
think we have to make pci_find_device etc refcount somewhere and add
pci_device_put as was done with networking.

-- Lots of network drivers don't even build
+- Some network drivers don't even build

- Alan: PCI hotplug is unsafe (locking is totally screwed)

@@ -499,17 +589,16 @@
"network card doesn't recieve packets" booting with 'acpi=off noapic' fixes
it.

+ alan: VIA APIC stuff is one bit of this, there are also some other
+ reports that were caused by ACPI not setting level v edge trigger some
+ times
+
- davej: There's also another nasty 'doesnt boot' bug which quite a few
people (myself included) are seeing on some boxes (especially laptops).

drivers/block/
--------------

-- Alan: Partition handling is hosed for DM users. (I have some partly
- debugged patches in the -ac tree, but Andries objects to them and I think
- his user knows magic options hack is unacceptable too. Mostly this is
- figuring out the right answer)
-
- Floppy is almost unusably buggy still

drivers/char/
@@ -519,6 +608,8 @@
thankfully). "The badness I know about is almost entirely IRQ mishandling.
DRI failing to mask PCI irqs on exit paths."

+ (might be fixed due to DRI updates?)
+
- Various suspect things in AGP.

drivers/ide/
@@ -528,18 +619,25 @@

- IDE requires bio walking

+ "Bartlomiej has IDE multisector working" (does that mean it's fixed?)
+
+
- IDE PIO has occasional unexplained PIO disk eating reports

- IDE has multiple zillions of races/hangs in 2.5 still

-- IDE eats disks with HPT372N on 2.5.x
-
- IDE scsi needs rewriting

- IDE needs significant reworking to handle Simplex right

- IDE hotplug handling for 2.5 is completely broken still

+- IDE tcq. Either kill it or fix it. Not a "big todo", as such.
+
+- There are lots of other IDE bugs that wont go away until the taskfile
+ stuff is included, the locking bugs that allow any user to hang the IDE
+ layer in 2.5, and some other updates are forward ported. (esp. HPT372N).
+
drivers/isdn/
-------------

@@ -561,9 +659,6 @@
Alternatively, we could re-introduce the fallback to driver ioctl parsing
for these if not enough drivers get updated.

-- fixup the usb-serial core and drivers to provide support for this
- patch.
-
drivers/net/
------------

@@ -583,12 +678,24 @@

- 2.5.x won't boot on some 440GX

-- 2.5.x doesn't handle VIA APIC right yet - dont know why
+ alan: Problem understood now, feasible fix in 2.4/2.4-ac. (440GX has two
+ IRQ routers, we use the $PIR table with the PIIX, but the 440GX doesnt use
+ the PIIX for its IRQ routing). Fall back to BIOS for 440GX works and Intel
+ concurs.
+
+- 2.5.x doesn't handle VIA APIC right yet.
+
+ 1. We must write the PCI_INTERRUPT_LINE
+
+ 2. We have quirk handlers that seem to trash it.

- ACPI needs the relax patches merging to work on lots of laptops

- ECC driver questions are not yet sorted (DaveJ is working on this)

+- PC9800 is not fully merged - most of this I think is 2.7 stuff but a few
+ bits might be 2.6 candidate
+
arch/x86_64/
------------

@@ -596,19 +703,37 @@

- time handling is broken. Need to move up 2.4 time.c code.

-- memory corruption with IOMMU pci_free_consistent - often causes crashes
- at shutdown. This is rather mysterious, the code is basically identical to
- 2.4 which works fine. Can only be seen on systems with >4GB of memory or
- with iommu=force
-
- Another report of a crash at shutdown on Simics with no iommu when all
memory was used. Could be related to the one above.

-- change_page_attr corrupts memory/crashes. Breaks some AGP users.
-
- NMI watchdog seems to tick too fast

- some fixes from 2.4 still need to be merged

- not very well tested. probably more bugs lurking.
+
+- 32bit vsyscalls seem to be broken
+
+- 32bit elf coredumps are broken
+
+- need to coredump 64bit vsyscall code with dwarf2
+
+- move 64bit signal trampolines into vsyscall code and add dwarf2 for it.
+
+- describe kernel assembly with dwarf2 annotations for kgdb (currently
+ waiting on some binutils changes for this)
+
+arch/arm/
+---------
+
+- rmk: missing raw keyboard translation tables for all ARM machines.
+ Haven't even looked into this at all. This could be messy since there
+ isn't an ARM architecture standard. I'm presently hoping that it won't be
+ an issue. If it does, I guess we'll see drivers/char/keyboard.c explode.
+
+arch/others/
+------------
+
+- SH3/SH3-64 need resyncing, as do some other ports. No impact on
+ mainstream platforms hopefully.




2003-05-14 10:14:13

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3


The full list:


Must-fix bugs
=============

drivers/char/
-------------

- TTY locking is broken.

- see FIXME in do_tty_hangup(). This causes ppp BUGs in local_bh_enable()

- Other problems: aviro, dipankar, Alan have details.

- somebody will have to document the tty driver and ldisc API

drivers/char/rtc/
-----------------

- rmk: I think we need a generic RTC driver (which is backed by real RTCs).
Integrator-based stuff has a 32-bit 1Hz counter RTC with alarm, as has the
SA11xx, and probably PXA. There's another implementation for the RiscPC
and ARM26 stuff. I'd rather not see 4 implementations of the RTC userspace
API, but one common implementation so that stuff gets done in a consistent
way.

We postponed this at the beginning of 2.4 until 2.5 happened. We're now
at 2.5, and I'm about to add at least one more (the Integrator
implementation.) This isn't sane imo.

drivers/block/
--------------

- RAID0 dies on strangely aligned BIOs

- Need to hoist BIO-split code out of device mapper, use that.

(neilb)

1/ RAID5 should work fine. It accepts any sort of bio and always
submits a 1-page bio to the underlying device, and if my
understanding is correct, every device must be able to handle a
single page bio, no matter what the alignment (which is why raid0
has a problem - it doesn't).

2/ RAID1 works pretty well. The only improvement needed is to define
a merge_bvec_fn function which passes the question down to lower
layers. This should be easy except for the small fact that it is
impossible :-) There is no enforced pairing between calls to
merge_bvec_fn and submit_bh, so it is possible that a hot spare
with different restrictions could get swapped in between the one
and the other and could confuse things. I suspect that can be
worked around somehow though...

Someone sent me a patch that is sorely needed - it allows you
to simply call blk_queue_stack() (or somethink like that), and it will
get your stacked limits set appropriately.

3/ I just realised that raid0 is easier than I had previously
thought. We don't need the completely functional bio splitting
that dm has. We only need to be able to split a bio that has just
one page as the use of merge_bvec_fn will ensure that we never get
a larger bio that we cannot handle. And splitting a bio with only
one page is a lot easier. I now have code in my tree that
implements this quite cleanly and will probably post a patch
during the week.

- ideraid hasn't been ported to 2.5 at all yet.

- CD burning. There are still a few quirks to solve wrt SG_IO and ide-cd.

Jens: The basic hang has been solved (double fault in ide-cd), there still
seems to be some cases that don't work too well. Don't really have a
handle on those :/

drivers/input/
--------------

- rmk: unconverted keyboard/mouse drivers (there's a deadline of 2.6.0
currently on these remaining in my/Linus' tree.)

- synaptic touchpad support

drivers/misc/
-------------

- rmk: UCB1[23]00 drivers, currently sitting in drivers/misc in the ARM
tree. (touchscreen, audio, gpio, type device.)

drivers/net/
------------

- rmk: network drivers. ARM people like to add tonnes of #ifdefs into
these to customise them to their hardware platform (eg, chip access
methods, addresses, etc.) I cope with this by not integrating them into my
tree. The result is that many ARM platforms can't be built from even my
tree without extra patches. This isn't sane, and has bred a culture of
network drivers not being submitted. I don't see this changing for 2.6
though.

drivers/net/irda/
-----------------

- dongle drivers need to be converted to sir-dev

- irport need to be converted to sir-kthread

- new drivers (irtty-sir/smsc-ircc2/donauboe) need more testing

- rmk: Refuse IrDA initialisation if sizeof(structures) is incorrect (I'm
not sure if we still need this; I think gcc 2.95.3 on ARM shows this
problem though.)

drivers/pci/
------------

- alan: Some cardbus crashes the system

- alan: Hotplug locking is hosed

drivers/pcmcia/
---------------

- alan: Most drivers crash the system on eject randomly with timer bugs. I
think after RMK's stuff is in most of the pcmcia/cardbus ones go except the
locking disaster.

drivers/pld/
------------

- rmk: EPXA (ARM platform) PLD hotswap drivers (drivers/pld)

drivers/video/
--------------

- Lots of drivers don't compile, others do but don't work.

drivers/scsi/
-------------

- hch: large parts of the locking are hosed or not existant

(Mike Anderson, Patrick Mansfield, Badari Pulavarty)

- shost->my_devices isn't locked down at all

- the host list ist locked but not refcounted, mess can happen when the
spinlock is dropped

- there are lots of members of struct Scsi_Host/scsi_device/scsi_cmnd
with very unclear locking, many of them probably want to become
atomic_t's or bitmaps (for the 1bit bitfields).

- there's lots of volatile abuse in the scsi code that needs to be
thought about.

- there's some global variables incremented without any locks

- Convert am53c974, dpt_i2o, initio and pci2220i to DMA-mapping

- Make inia100, cpqfc, pci2000 and dc390t compile

- Convert

wd33c99 based: a2091 a3000 gpv11 mvme174 sgiwd93 53c7xx based:
amiga7xxx bvme6000 mvme16x initio am53c974 pci2000 pci2220i qla1280
sym53c8xx dc390t

To new error handling

I think the sym53c8xx could probably be pulled out of the tree because
the sym_2 replaces it. I'm also looking at converting the qla1280.

It also might be possible to shift the 53c7xx based drivers over to
53c700 which does the new EH stuff, but I don't have the hardware to check
such a shift.

For the non-compiling stuff, I've probably missed a few that just aren't
compilable on my platforms, so any updates would be welcome. Also, are
some of our non-compiling or unconverted drivers obsolete?

drivers/usb/gadget/
-------------------

- rmk: SA11xx USB client/gadget code (David B has been doing some work on
this, and keeps trying to prod me, but unfortunately I haven't had the time
to look at his work, sorry David.)

fs/
---

- ext3 data=journal mode is bust.

- ext3/htree doesn't play right with NFS server. 90% fixed in -mm.

- AIO/direct-IO writes can race with truncate and wreck filesystems.

- Easy fix is to only allow the feature for S_ISBLK files.

- hch: devfs: there's a fundamental lookup vs devfsd race that's only
fixable by introducing a lookup vs devfs deadlock. I can't see how this is
fixable without getting rid of the current devfsd design. Mandrake seems
to have a workaround for this so this is at least not triggered so easily,
but that's not what I'd consider a fix..

kernel/
-------

- O(1) scheduler starvation, poor behaviour seems unresolved.

Jens: "I've been running 2.5.67-mm3 on my workstation for two days, and
it still doesn't feel as good as 2.4. It's not a disaster like some
revisisons ago, but it still has occasional CPU "stalls" where it feels
like a process waits for half a second of so for CPU time. That's is very
noticable."

Also see Mike Galbraith's work.

- Alan: 32bit uid support is *still* broken for process accounting.

Create a 32bit uid, turn accounting on. Shock horror it doesn't work
because the field is 16bit. We need an acct structure flag day for 2.6
IMHO

mm/
---

- Overcommit accounting gets wrong answers

- underestimates reclaimable slab, gives bogus failures when
dcache&icache are large.

- gets confused by reclaimable-but-not-freed truncated ext3 pages.
Lame fix exists in -mm.

- Proper user level no overcommit also requires a root margin adding

modules
-------

(Rusty)

- The .modinfo patch needs to go in. It's trivial, but it's the major
missing functionality vs. 2.4. Keeps bouncing off Linus.

- __module_get(): "I know I have a refcount already and I don't care
if they're doing rmmod --wait, gimme.". Keeps bouncing off Linus.

- Per-cpu support inside modules (have patch, in testing).

- shemminger: The module remove rework that Rusty and Dave are working on
needs to be fixed before 2.6. Right now, it is impossible to write a
protocol or network device that can be safely unloaded when it is a module.

See:
http://pizda.ninka.net/~davem/modules.html


net/
----

(davem)

- UDP apps can in theory deadlock, because the ip_append_data path can end
up sleeping while the socket lock is held.

It is OK to sleep with the socket held held, normally. But in this case
the sleep happens while waiting for socket memory/space to become
available, if another context needs to take the socket lock to free up the
space we could hang.

I sent a rough patch on how to fix this to Alexey, and he is analyzing
the situation. I expect a final fix from him next week or so.

- Semantics for IPSEC during operations such as TCP connect suck currently.

When we first try to connect to a destination, we may need to ask the
IPSEC key management daemon to resolve the IPSEC routes for us. For the
purposes of what the kernel needs to do, you can think of it like ARP. We
can't send the packet out properly until we resolve the path.

What happens now for IPSEC is basically this:

O_NONBLOCK: returns -EAGAIN over and over until route is resolved

!O_NONBLOCK: Sleeps until route is resolved

These semantics are total crap. The solution, which Alexey is working
on, is to allow incomplete routes to exist. These "incomplete" routes
merely put the packet onto a "resolution queue", and once the key manager
does it's thing we finish the output of the packet. This is precisely how
ARP works.

I don't know when Alexey will be done with this.

- There are those mysterious TCP hangs of established state sockets.
Someone has to get a good log in order for us to effectively debug this.


net/*/netfilter/
----------------

(Rusty)

- Handle non-linear skbs everywhere. This is going in via Dave now.

- Rework conntrack hashing.

- Module relationship bogosity fix (trivial, have patch).

sound/
------

- rmk: several OSS drivers for SA11xx-based hardware in need of
ALSA-ification and L3 bus support code for these.

- rmk: linux/sound/drivers/mpu401/mpu401.c and
linux/sound/drivers/virmidi.c complained about 'errno' at some time in the
past, need to confirm whether this is still a problem.

- rmk: need to complete ALSA-ification of the WaveArtist driver for both
NetWinder and other stuff (there's some fairly fundamental differences in
the way the mixer needs to be handled for the NetWinder.)

global
------

- Lots of 2.4 fixes including some security are not in 2.5

- There are about 60 or 70 security related checks that need doing
(copy_user etc) from Stanford tools

- A couple of hundred real looking bugzilla bugs




Not-ready features and speedups
===============================


drivers/block/
--------------

- Framework for selecting IO schedulers. This is the main one really.
Once this is in place we can drop in new schedulers any old time, no risk.

- Runtime-selectable disk scheduler framework.

- Anticipatory scheduler. Working OK now, still has problems with seeky
OLTP-style loads.

- CFQ scheduler. Seems to work but Jens planning significant rework.

- The feral.com qlogic driver: needs work.


fs/
---

- reiserfs_file_write() speedup. There are concerns that some applications
do the wrong thing with large stat.st_blksize.

- ext3 lock_kernel() removal: that part works OK and is mergeable. But
we'll also need to make lock_journal() a spinlock, and that's deep surgery.

- 32bit quota needs a lot more testing but may work now

- Integrate Chris Mason's 2.4 reiserfs ordered data and data journaling
patches. They make reiserfs a lot safer.

- (Trond:) Yes: I'm still working on an atomic "open()", i.e. one
where we short-circuit the usual VFS path_walk() + lookup() +
permission() + create() + .... bullsh*t...

I have several reasons for wanting to do this (all of
them related to NFS of course, but much of the reasoning applies
to *all* networked file systems).

1) The above sequence is simply not atomic on *any* networked
filesystem.

2) It introduces a sh*tload of completely unnecessary RPC calls (why
do a 'permission' RPC call when the server is in *any* case going to
tell you whether or not this operations is allowed. Why do a
'lookup()' when the 'create()' call can be made to tell you whether or
not a file already exists).

3) It is incompatible with some operations: the current create()
doesn't pass an 'EXCLUSIVE' flag down to the filesystems.

4) (NFS specific?) open() has very different cache consistency
requirements when compared to most other VFS operations.

I'd very much like for something like Peter Braam's 'lookup with
intent' or (better yet) for a proper dentry->open() to be integrated with
path_walk()/open_namei(). I'm still working on the latter (Peter has
already completed the lookup with intent stuff).

- rmk: update acorn partition parsing code - making all acorn schemes
appear in check.c so we don't have to duplicate the scanning of multiple
types, and adding support for eesox partitions.


kernel/
-------

(Rusty)

- Zippel's Reference count simplification. Tricky code, but cuts about 120
lines from module.c. Patch exists, needs stressing.

- /proc/kallsyms. What most people really wanted from /proc/ksyms. Patch
exists.

- Fix module-failed-init races by starting module "disabled". Patch
exists, requires some subsystems (ie. add_partition) to explicitly say
"make module live now". Without patch we are no worse off than 2.4 etc.

- Integrate userspace irq balancing daemon.

- kexec. Seems to work, is in -mm.

- rmk: modules / /proc/kcore / vmalloc This needs sorting and testing to
ensure that stuff like gdb vmlinux /proc/kcore works as expected. I
believe this is the only show stopper preventing any ARM platform being
built in Linus' kernel.

- rmk: lib/inflate.c must not use static variables (causes these to be
referenced via GOTOFF relocations in PIC decompressor. We have a PIC
decompressor to avoid having to hard code a per platform zImage link
address into the makefiles.)

mm/
---

- objrmap: concerns over page reclaim performance at high sharing levels,
and interoperation with nonlinear mappings is hairy.

- Readd and make /proc/sys/vm/freepages writable again so that boxes can be
tuned for heavy interrupt load.

net/
----

(davem)

- Real serious use of IPSEC is hampered by lack of MPLS support. MPLS is a
switching technology that works by switching based upon fixed length labels
prepended to packets. Many people use this and IPSEC to implement VPNs
over public networks, it is also used for things like traffic engineering.

A good reference site is:

http://www.mplsrc.com/

Anyways, an existing (crappy) implementation exists. I've almost
completed a rewrite, I should have something in the tree next week.

- Sometimes we generate IP fragments when it truly isn't necessary.

The way IP fragmentation is specified, each fragment must be modulo 8
bytes in length. So suppose the device has an MTU that is not 0 modulo 8,
ethernet even classifies in this way. 1500 == (8 * 187) + 4

Our IP fragmenting engine can fragment on packets that are sized within
the last modulo 8 bytes of the MTU. This happens in obscure cases, but it
does happen.

I've proposed a fix to Alexey, whereby very late in the output path we
check the packet, if we fragmented but the data length would fit into the
MTU we unfragment the packet.

This is low priority, because technically it creates suboptimal behavior
rather than mis-operation.

net/*/netfilter/
----------------

- Lots of misc. cleanups, which are happening slowly.

- davem: Netfilter needs to stop linearizing packets as much as possible.

Zerocopy output packets are basically undone by netfilter becuase all of
it assumed it was working with linear socket buffers.

Rusty is fixing this piece by piece. He is nearly done with this work.

power management
----------------

(Pat) There is some preliminary work at bk://ldm.bkbits.net/linux-2.5-power,
though I'm currently in the process of reworking it.

It includes:

- New device power management core code, both for individual devices,
and for global state transitions.

- A generic user interface for triggering system power state transitions.

- Arch-independent code for performing state transitions, that calls
platform-specific methods along the way.

- A better suspend-to-disk mechanism than swsusp.

There are various other details to be worked out, which are the real fun
part. And of course, driver support, but that is something that can happen
at any time.

(Alan)

- PCI locking

- Frame buffer restore codepaths (that requires some deep PCI magic)

- XFree86 hooks

- AGP restoration

- DRI restoration

- IDE suspend/resume without races (Ben is looking at this a little)

- How to deal with devices that babble (some stuff we have to global IRQ
off to save, and global IRQ on -after- we recover with APM)

- Pat's swsusp rework?

- Pat: There are already CPU device structures; MTRRs should be a
dynamically registered interface of CPUs, which implies there needs
to be some other glue to know that there are MTRRs that need to be
saved/restored.

arch/i386/
----------

- Andi: i386 sub architectures for common boxes (in particular bigsmp and
summit) need to be runtime probed options, not compile time. Vendors
cannot ship an own kernel rpm for all these cases. (patch is in -mm, works
OK).

- Also PC9800 merge needs finishing to the point we want for 2.6 (not all).

- ES7000 wants merging (now we are all happy with it). That shouldn't be a
big problem.

global
------

- 64-bit dev_t. Seems almost ready, but it's not really known how much
work is still to do. Patches exist in -mm but with the recent rise of the
neo-viro I'm not sure where things are at.

- We need a kernel side API for reporting error events to userspace (could
be async to 2.6 itself)

(Prototype core based on netlink exists)

- Kai: Introduce a sane, easy and standard way to build external modules

- Kai: Allow separate src/objdir





drivers
=======

- Alan: We have multiple drivers walking the pci device lists and also
using things like pci_find_device in unsafe ways with no refcounting. I
think we have to make pci_find_device etc refcount somewhere and add
pci_device_put as was done with networking.

- Some network drivers don't even build

- Alan: PCI hotplug is unsafe (locking is totally screwed)

- Ditto cardbus

- Alan: Cardbus/PCMCIA requires all Russell's stuff is merged to do
multiheader right and so on

drivers/acpi/
-------------

- davej: ACPI has a number of failures right now. There are a number of
entries in bugzilla which could all be the same bug. It manifests as a
"network card doesn't recieve packets" booting with 'acpi=off noapic' fixes
it.

alan: VIA APIC stuff is one bit of this, there are also some other
reports that were caused by ACPI not setting level v edge trigger some
times

- davej: There's also another nasty 'doesnt boot' bug which quite a few
people (myself included) are seeing on some boxes (especially laptops).

drivers/block/
--------------

- Floppy is almost unusably buggy still

drivers/char/
-------------

- Alan: Multiple serious bugs in the DRI drivers (most now with patches
thankfully). "The badness I know about is almost entirely IRQ mishandling.
DRI failing to mask PCI irqs on exit paths."

(might be fixed due to DRI updates?)

- Various suspect things in AGP.

drivers/ide/
------------

(Alan)

- IDE requires bio walking

"Bartlomiej has IDE multisector working" (does that mean it's fixed?)


- IDE PIO has occasional unexplained PIO disk eating reports

- IDE has multiple zillions of races/hangs in 2.5 still

- IDE scsi needs rewriting

- IDE needs significant reworking to handle Simplex right

- IDE hotplug handling for 2.5 is completely broken still

- IDE tcq. Either kill it or fix it. Not a "big todo", as such.

- There are lots of other IDE bugs that wont go away until the taskfile
stuff is included, the locking bugs that allow any user to hang the IDE
layer in 2.5, and some other updates are forward ported. (esp. HPT372N).

drivers/isdn/
-------------

(Kai, rmk)

- isdn_tty locking is completely broken (cli() and friends)

- fix lots of remaining bugs in the isdn link layer / hisax protocol layer
/ hisax subdrivers, so that at least 99% of the users have a usable ISDN
subsystem

- fix other drivers

- lots more cleanups, adaption to recent APIs etc

- fixup tty-based ISDN drivers which provide TIOCM* ioctls (see my recent
3-set patch for serial stuff)

Alternatively, we could re-introduce the fallback to driver ioctl parsing
for these if not enough drivers get updated.

drivers/net/
------------

- davej: Either Wireless network drivers or PCMCIA broke somewhen. A
configuration that worked fine under 2.4 doesn't receive any packets. Need
to look into this more to make sure I don't have any misconfiguration that
just 'happened to work' under 2.4


drivers/scsi/
-------------

- Half of SCSI doesn't compile

arch/i386/
----------

- 2.5.x won't boot on some 440GX

alan: Problem understood now, feasible fix in 2.4/2.4-ac. (440GX has two
IRQ routers, we use the $PIR table with the PIIX, but the 440GX doesnt use
the PIIX for its IRQ routing). Fall back to BIOS for 440GX works and Intel
concurs.

- 2.5.x doesn't handle VIA APIC right yet.

1. We must write the PCI_INTERRUPT_LINE

2. We have quirk handlers that seem to trash it.

- ACPI needs the relax patches merging to work on lots of laptops

- ECC driver questions are not yet sorted (DaveJ is working on this)

- PC9800 is not fully merged - most of this I think is 2.7 stuff but a few
bits might be 2.6 candidate

arch/x86_64/
------------

(Andi)

- time handling is broken. Need to move up 2.4 time.c code.

- Another report of a crash at shutdown on Simics with no iommu when all
memory was used. Could be related to the one above.

- NMI watchdog seems to tick too fast

- some fixes from 2.4 still need to be merged

- not very well tested. probably more bugs lurking.

- 32bit vsyscalls seem to be broken

- 32bit elf coredumps are broken

- need to coredump 64bit vsyscall code with dwarf2

- move 64bit signal trampolines into vsyscall code and add dwarf2 for it.

- describe kernel assembly with dwarf2 annotations for kgdb (currently
waiting on some binutils changes for this)

arch/arm/
---------

- rmk: missing raw keyboard translation tables for all ARM machines.
Haven't even looked into this at all. This could be messy since there
isn't an ARM architecture standard. I'm presently hoping that it won't be
an issue. If it does, I guess we'll see drivers/char/keyboard.c explode.

arch/others/
------------

- SH3/SH3-64 need resyncing, as do some other ports. No impact on
mainstream platforms hopefully.


2003-05-14 10:16:13

by Jens Axboe

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3

On Wed, May 14 2003, Andrew Morton wrote:
>
> Quite a lot of changes here. Mostly additions, but some things have been
> crossed off.
>
> -- IDE tcq. Either kill it or fix it. Not a "big todo", as such.

ide tcq should be fixed now

--
Jens Axboe

2003-05-14 16:28:18

by Tom Rini

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3

On Wed, May 14, 2003 at 03:27:12AM -0700, Andrew Morton wrote:

> +drivers/char/rtc/
> +-----------------
> +
> +- rmk: I think we need a generic RTC driver (which is backed by real RTCs).
> + Integrator-based stuff has a 32-bit 1Hz counter RTC with alarm, as has the
> + SA11xx, and probably PXA. There's another implementation for the RiscPC
> + and ARM26 stuff. I'd rather not see 4 implementations of the RTC userspace
> + API, but one common implementation so that stuff gets done in a consistent
> + way.
> +
> + We postponed this at the beginning of 2.4 until 2.5 happened. We're now
> + at 2.5, and I'm about to add at least one more (the Integrator
> + implementation.) This isn't sane imo.

I know Geert asked, but what's wrong with the current generic RTC
driver (drivers/char/genrtc.c), and why couldn't the additional features be
added to it, ala the battery bits that went in semi-recently?

--
Tom Rini
http://gate.crashing.org/~trini/

2003-05-14 16:43:44

by Greg KH

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3

On Wed, May 14, 2003 at 03:27:12AM -0700, Andrew Morton wrote:
>
> Quite a lot of changes here. Mostly additions, but some things have been
> crossed off.
>
> Also at ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/must-fix

Here's a patch against must-fix-3.txt that consolodates the 4 different
places people are complaining about a lack of PCI device locking, and
put the bugzilla bug number for it.

As soon as I finish this OLS paper, I'm going to work on finally fixing
this...

thanks,

greg k-h

--- must-fix-3.txt.original Wed May 14 09:46:43 2003
+++ must-fix-3.txt Wed May 14 09:52:47 2003
@@ -115,7 +115,11 @@

- alan: Some cardbus crashes the system

-- alan: Hotplug locking is hosed
+- We have multiple drivers walking the pci device lists and also using
+ things like pci_find_device in unsafe ways with no refcounting. I think
+ we have to make pci_find_device etc refcount somewhere and add
+ pci_device_put as was done with networking.
+ http://bugzilla.kernel.org/show_bug.cgi?id=709

drivers/pcmcia/
---------------
@@ -567,17 +571,8 @@
drivers
=======

-- Alan: We have multiple drivers walking the pci device lists and also
- using things like pci_find_device in unsafe ways with no refcounting. I
- think we have to make pci_find_device etc refcount somewhere and add
- pci_device_put as was done with networking.
-
- Some network drivers don't even build

-- Alan: PCI hotplug is unsafe (locking is totally screwed)
-
-- Ditto cardbus
-
- Alan: Cardbus/PCMCIA requires all Russell's stuff is merged to do
multiheader right and so on

2003-05-14 16:57:19

by Matt Mackall

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3

On Wed, May 14, 2003 at 03:27:12AM -0700, Andrew Morton wrote:
>
> Quite a lot of changes here. Mostly additions, but some things have been
> crossed off.

Has handling of async write errors fallen off your radar? Should I
start pushing that again?

--
Matt Mackall : http://www.selenic.com : of or relating to the moon

2003-05-14 17:31:28

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3

Matt Mackall <[email protected]> wrote:
>
> On Wed, May 14, 2003 at 03:27:12AM -0700, Andrew Morton wrote:
> >
> > Quite a lot of changes here. Mostly additions, but some things have been
> > crossed off.
>
> Has handling of async write errors fallen off your radar? Should I
> start pushing that again?
>

No, I haven't forgotten. If you want to rediff the patches sometime that'd
be appreciated, thanks.

2003-05-14 20:59:37

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3

Andrew Morton wrote :
>
> Quite a lot of changes here. Mostly additions, but some things have been
> crossed off.
>
> Also at ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/must-fix

I don't like making todo list for other people, because it's
up to them to decide, but here is my wishlist for 2.6.X in term of
Wireless stuff.
I hope those concerned will react and send you their real todo
list.

o get latest orinoco changes from David. Linus seems timely in
picking David's changes, so I'm not worried about this one.

o get the latest airo.c fixes from CVS. This will hopefully
fix problems people have reported on the LKML.

o get HostAP driver in the kernel. No consolidation of the
802.11 management across driver can happen until this one is in (which
is probably 2.7.X material). I think Jouni is mostly ready but didn't
find time for it.

o get more wireless drivers into the kernel. The most
"integrable" drivers at this point seem the NWN driver, Pavel's
Spectrum driver and the Atmel driver.

o The last two drivers mentioned above are held up by firmware
issues (see flamewar on LKML a few days ago). So maybe fixing those
firmware issues should be a requirement for 2.6.X, because we can
expect more wireless devices to need firmware upload at startup coming
to market.
As this firmware business seems to me not a wireless specific
issue (see for example drivers/scsi/qlogicfc_asm.c or
drivers/atm/atmsar11.data), I would prefer a generic solution to that
problem, either saying it's OK to put firmware in the kernel (with
proper licensing) or providing working technical solutions.
My personal position is that I don't want to hold wireless
drivers in higher standard than other drivers in the kernel, and I
don't want to leave those drivers in the black hole where they
currently are.

Have fun...

Jean

2003-05-14 21:54:07

by Jeff Garzik

[permalink] [raw]
Subject: airo and firmware upload (was Re: 2.6 must-fix list, v3)

Jean Tourrilhes wrote:
> o get the latest airo.c fixes from CVS. This will hopefully
> fix problems people have reported on the LKML.

please beg Javier to split up his patch. He sends me a _huge_ patch
with tons of changes each time. If I object to one thing, we spin in
another huge-patch loop... :/

Sending me 20, 50, 100 patches to the same file is ok. Even encouraged.


> o get HostAP driver in the kernel. No consolidation of the
> 802.11 management across driver can happen until this one is in (which
> is probably 2.7.X material). I think Jouni is mostly ready but didn't
> find time for it.

yeah, there are many requests for this one


> o The last two drivers mentioned above are held up by firmware
> issues (see flamewar on LKML a few days ago). So maybe fixing those
> firmware issues should be a requirement for 2.6.X, because we can
> expect more wireless devices to need firmware upload at startup coming
> to market.

> As this firmware business seems to me not a wireless specific
> issue (see for example drivers/scsi/qlogicfc_asm.c or
> drivers/atm/atmsar11.data), I would prefer a generic solution to that
> problem, either saying it's OK to put firmware in the kernel (with
> proper licensing) or providing working technical solutions.


We need firmware upload, and, firmware _should_ be uploaded from userspace.

All someone needs to do is actually write the code for their driver to
receive firmware from userspace, and the rest is easy. A working
technical solution is obvious, it just needs interested parties to
implement.

We can upload firmware from initrd, if no boot device is available at
the time.

Jeff



2003-05-14 23:19:49

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, May 14, 2003 at 06:06:36PM -0400, Jeff Garzik wrote:
> Jean Tourrilhes wrote:
> > o get the latest airo.c fixes from CVS. This will hopefully
> >fix problems people have reported on the LKML.
>
> please beg Javier to split up his patch. He sends me a _huge_ patch
> with tons of changes each time. If I object to one thing, we spin in
> another huge-patch loop... :/
>
> Sending me 20, 50, 100 patches to the same file is ok. Even encouraged.

Javier is cc'ed.
While we are on the subject : a few months ago, Javier added
support for MIC to the airo driver. It's basically crypto based on
AES. You refused to include that part in the kernel because crypto was
not accepted in the kernel.
Fast forward : today we have crypto in the 2.5.X kernel. Does
this mean that you would have no objection accepting a patch from
Javier including the crypto part ?

> > o get HostAP driver in the kernel. No consolidation of the
> >802.11 management across driver can happen until this one is in (which
> >is probably 2.7.X material). I think Jouni is mostly ready but didn't
> >find time for it.
>
> yeah, there are many requests for this one

By the way, the HostAP driver include crypto (currently only
RC4 for WEP). Same question, I hope you would not refuse the crypto
part of HostAP (which is mandatory because most PrismII firmwares are
broken and can't do basic WEP properly).

> > o The last two drivers mentioned above are held up by firmware
> >issues (see flamewar on LKML a few days ago). So maybe fixing those
> >firmware issues should be a requirement for 2.6.X, because we can
> >expect more wireless devices to need firmware upload at startup coming
> >to market.
>
> > As this firmware business seems to me not a wireless specific
> >issue (see for example drivers/scsi/qlogicfc_asm.c or
> >drivers/atm/atmsar11.data), I would prefer a generic solution to that
> >problem, either saying it's OK to put firmware in the kernel (with
> >proper licensing) or providing working technical solutions.
>
>
> We need firmware upload, and, firmware _should_ be uploaded from userspace.

Ok, so I ask it this way : currently the kernel include some
drivers containing some binary firmwares blobs which are linked
directly into the kernel/module (including networking). Does this mean
that you are going to remove those driver from the kernel ASAP ? Or
does this mean that the rule above only apply to wireless drivers ?
Let's be logical and coherent here...

> All someone needs to do is actually write the code for their driver to
> receive firmware from userspace, and the rest is easy. A working
> technical solution is obvious, it just needs interested parties to
> implement.
>
> We can upload firmware from initrd, if no boot device is available at
> the time.

Currently, it looks like every driver will use its own method,
which I guess is ok.

> Jeff

Thanks !

Jean

2003-05-14 23:30:33

by Dave Jones

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, May 14, 2003 at 04:32:35PM -0700, Jean Tourrilhes wrote:

> While we are on the subject : a few months ago, Javier added
> support for MIC to the airo driver. It's basically crypto based on
> AES. You refused to include that part in the kernel because crypto was
> not accepted in the kernel.
> Fast forward : today we have crypto in the 2.5.X kernel. Does
> this mean that you would have no objection accepting a patch from
> Javier including the crypto part ?

Sounds like it would be better to get it using the in-kernel crypto
stuff rather than reimplementing its own routines. Same for the HostAP
driver.

Dave

2003-05-14 23:30:13

by Andrew Morton

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

Jean Tourrilhes <[email protected]> wrote:
>
> firmwares blobs

well for the purposes of tracking 2.6 activities I'll separate this issue
of firmware access policy out from drivers/net/wireless/.

yeah, it would be nice if the core kernel provided a "give me my firmware"
API or something.

2003-05-14 23:40:58

by Jeff Garzik

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

Dave Jones wrote:
> On Wed, May 14, 2003 at 04:32:35PM -0700, Jean Tourrilhes wrote:
>
> > While we are on the subject : a few months ago, Javier added
> > support for MIC to the airo driver. It's basically crypto based on
> > AES. You refused to include that part in the kernel because crypto was
> > not accepted in the kernel.
> > Fast forward : today we have crypto in the 2.5.X kernel. Does
> > this mean that you would have no objection accepting a patch from
> > Javier including the crypto part ?
>
> Sounds like it would be better to get it using the in-kernel crypto
> stuff rather than reimplementing its own routines. Same for the HostAP
> driver.


Correct.

_I_ didn't refuse the crypto, Linus did. But that was a positive step,
that kicked off inclusion of crypto into the kernel.

airo and HostAP do indeed need to use CryptoAPI not reimplement their
own crypto, though...

Jeff



2003-05-15 00:46:58

by Jouni Malinen

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, May 14, 2003 at 07:53:31PM -0400, Jeff Garzik wrote:

> airo and HostAP do indeed need to use CryptoAPI not reimplement their
> own crypto, though...

Host AP driver has a dynamic crypto implementation that allows one to
load new algorithms as a separate kernel modules. One of such modules
was an interface to use CryptoAPI. However, I don't think there is a
public release of it.

Do you think WEP should be implemented as a CryptoAPI algorithm? It is a
combination of CRC-32 and RC4 and the crypto module in Host AP does
these together in one pass of the packet payload to minimize host CPU
load. I'm not keen on using RC4 separately with CryptoAPI (I don't think
it is even included yet) if that means making the WEP encryption use
more CPU.. However, I could consider taking CryptoAPI into use it would
support WEP as an algorithm (i.e., I could consider porting the current
Host AP WEP code to CryptoAPI).

Since I'm not that interested in maintaining multiple source trees of
the driver, own WEP implementation is going to remain in the Host AP
driver for 2.2 and 2.4 kernels. Anyway, this could probably be
automatically stripped from the code if backward compatibility in
drivers must be removed from 2.5/2.6 kernel tree.

--
Jouni Malinen PGP id EFC895FA

2003-05-15 00:42:29

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Thu, May 15, 2003 at 12:43:59AM +0100, Dave Jones wrote:
> On Wed, May 14, 2003 at 04:32:35PM -0700, Jean Tourrilhes wrote:
>
> > While we are on the subject : a few months ago, Javier added
> > support for MIC to the airo driver. It's basically crypto based on
> > AES. You refused to include that part in the kernel because crypto was
> > not accepted in the kernel.
> > Fast forward : today we have crypto in the 2.5.X kernel. Does
> > this mean that you would have no objection accepting a patch from
> > Javier including the crypto part ?
>
> Sounds like it would be better to get it using the in-kernel crypto
> stuff rather than reimplementing its own routines. Same for the HostAP
> driver.
>
> Dave

For HostAP, the kernel crypto doesn't include any RC4 support,
so it can't use kernel crypto as it is.
For airo, crypto was added before kernel crypto was available
in the kernel, and I don't know how easy it will be to refactor the
code.
I just wanted to know the position of Jeff on this issue. I'll
let the technical decision to the respective authors.

Thanks...

Jean

2003-05-15 00:52:33

by David Gibson

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, May 14, 2003 at 04:38:26PM -0700, Andrew Morton wrote:
> Jean Tourrilhes <[email protected]> wrote:
> >
> > firmwares blobs
>
> well for the purposes of tracking 2.6 activities I'll separate this issue
> of firmware access policy out from drivers/net/wireless/.
>
> yeah, it would be nice if the core kernel provided a "give me my firmware"
> API or something.

Well, Manuel Estrada (also author of the orinoco USB patches) has
proposed one on lkml. Doesn't look like people were happy with that
version, but I think he's still working on revising it based on
feedback.

--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson

2003-05-15 00:49:48

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, May 14, 2003 at 07:53:31PM -0400, Jeff Garzik wrote:
> Dave Jones wrote:
> >On Wed, May 14, 2003 at 04:32:35PM -0700, Jean Tourrilhes wrote:
> >
> > > While we are on the subject : a few months ago, Javier added
> > > support for MIC to the airo driver. It's basically crypto based on
> > > AES. You refused to include that part in the kernel because crypto was
> > > not accepted in the kernel.
> > > Fast forward : today we have crypto in the 2.5.X kernel. Does
> > > this mean that you would have no objection accepting a patch from
> > > Javier including the crypto part ?
> >
> >Sounds like it would be better to get it using the in-kernel crypto
> >stuff rather than reimplementing its own routines. Same for the HostAP
> >driver.
>
>
> Correct.
>
> _I_ didn't refuse the crypto, Linus did. But that was a positive step,
> that kicked off inclusion of crypto into the kernel.
>
> airo and HostAP do indeed need to use CryptoAPI not reimplement their
> own crypto, though...
>
> Jeff

Ok, this point is clarified as well. I'll communicate
downstream.
Thanks.

Jean

2003-05-15 02:07:49

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, May 14, 2003 at 05:59:04PM -0700, Jouni Malinen wrote:
> On Wed, May 14, 2003 at 07:53:31PM -0400, Jeff Garzik wrote:
>
> > airo and HostAP do indeed need to use CryptoAPI not reimplement their
> > own crypto, though...
>
> Host AP driver has a dynamic crypto implementation that allows one to
> load new algorithms as a separate kernel modules. One of such modules
> was an interface to use CryptoAPI. However, I don't think there is a
> public release of it.
>
> Do you think WEP should be implemented as a CryptoAPI algorithm? It is a
> combination of CRC-32 and RC4 and the crypto module in Host AP does
> these together in one pass of the packet payload to minimize host CPU
> load. I'm not keen on using RC4 separately with CryptoAPI (I don't think
> it is even included yet) if that means making the WEP encryption use
> more CPU.. However, I could consider taking CryptoAPI into use it would
> support WEP as an algorithm (i.e., I could consider porting the current
> Host AP WEP code to CryptoAPI).

There is no RC4 currently in the crypto API (guess why), and I
believe that most wireless driver would be interested in the RC4+CRC,
so I would advocate for doing "WEP".

> Since I'm not that interested in maintaining multiple source trees of
> the driver, own WEP implementation is going to remain in the Host AP
> driver for 2.2 and 2.4 kernels. Anyway, this could probably be
> automatically stripped from the code if backward compatibility in
> drivers must be removed from 2.5/2.6 kernel tree.

If you define the WEP in the kernel crypto, it could even be
the exact same file.

> Jouni Malinen

Thanks...

Jean

2003-05-15 04:09:12

by Jouni Malinen

[permalink] [raw]
Subject: Re: CryptoAPI and WEP/stream ciphers (was: airo and firmware upload)

On Wed, May 14, 2003 at 07:53:31PM -0400, Jeff Garzik wrote:

> airo and HostAP do indeed need to use CryptoAPI not reimplement their
> own crypto, though...

I tried to change my WEP implementation to use CryptoAPI, but that ended
up in problems.. If I understood correctly, current CryptoAPI supports
only block ciphers(?). However, WEP uses RC4 as a stream cipher. This
does not seem to fit the cipher definition in CryptoAPI. One might be
able to implement it as an compression algorithm (encrypt as decompress,
since it adds IV and ICV; and decrypt as compress). However, this
certainly does not sound very reasonable.. Another alternative would be
to add support for stream ciphers into CryptoAPI.

Do you think that it would still be required to get rid of the own WEP
implementation in the Host AP driver before including it into the kernel
tree? Would this mean that someone would first need to add support for
stream ciphers into CryptoAPI? Any change of that happening for Linux
2.6.x?

And one more question before using more time with WEP implementation..
Is someone already working with stream cipher support for CryptoAPI?

--
Jouni Malinen PGP id EFC895FA

2003-05-15 05:52:39

by James Morris

[permalink] [raw]
Subject: Re: CryptoAPI and WEP/stream ciphers (was: airo and firmware upload)

On Wed, 14 May 2003, Jouni Malinen wrote:

> I tried to change my WEP implementation to use CryptoAPI, but that ended
> up in problems.. If I understood correctly, current CryptoAPI supports
> only block ciphers(?).

Block ciphers and digests.

> certainly does not sound very reasonable.. Another alternative would be
> to add support for stream ciphers into CryptoAPI.

Yes, it would be good to have API support for stream encryption in
general, e.g. also for OFB and Counter Mode.

> Do you think that it would still be required to get rid of the own WEP
> implementation in the Host AP driver before including it into the kernel
> tree? Would this mean that someone would first need to add support for
> stream ciphers into CryptoAPI? Any change of that happening for Linux
> 2.6.x?

I'd like to see it go in if the code is available.

> And one more question before using more time with WEP implementation..
> Is someone already working with stream cipher support for CryptoAPI?

Not that I know of.


- James
--
James Morris
<[email protected]>

2003-05-15 06:04:00

by James Morris

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, 14 May 2003, Jean Tourrilhes wrote:

> There is no RC4 currently in the crypto API (guess why), and I

If you mean because of IP issues, that's not the reason. As far as I
know, we can use 'arcfour', which is compatible.

Arcfour is also needed potentially for MPPE support (check for recent
thread).

- James
--
James Morris
<[email protected]>


2003-05-15 07:00:16

by Greg KH

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Wed, May 14, 2003 at 04:32:35PM -0700, Jean Tourrilhes wrote:
> Ok, so I ask it this way : currently the kernel include some
> drivers containing some binary firmwares blobs which are linked
> directly into the kernel/module (including networking). Does this mean
> that you are going to remove those driver from the kernel ASAP ? Or
> does this mean that the rule above only apply to wireless drivers ?
> Let's be logical and coherent here...

I've stated this for _years_ now, I'm very glad to take patches to move
the firmware blobs out of the usb drivers that currently have them, and
move it to userspace, if people send me those patches. For all the
whining on debian-legal about them over the _years_, no one has sent me
such a patch.

Ok, yes, I did get the start of some patches in the early 2.4 series, I
said I would accept them in 2.5 as it was too radical of a change to
take during a stable kernel series (the developer agreed with me.) They
were never resubmitted to me during the entire 2.5 development time.

thanks,

greg k-h

2003-05-15 17:12:06

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Thu, May 15, 2003 at 12:13:18AM -0700, Greg KH wrote:
> On Wed, May 14, 2003 at 04:32:35PM -0700, Jean Tourrilhes wrote:
> > Ok, so I ask it this way : currently the kernel include some
> > drivers containing some binary firmwares blobs which are linked
> > directly into the kernel/module (including networking). Does this mean
> > that you are going to remove those driver from the kernel ASAP ? Or
> > does this mean that the rule above only apply to wireless drivers ?
> > Let's be logical and coherent here...
>
> I've stated this for _years_ now, I'm very glad to take patches to move
> the firmware blobs out of the usb drivers that currently have them, and
> move it to userspace, if people send me those patches. For all the
> whining on debian-legal about them over the _years_, no one has sent me
> such a patch.
>
> Ok, yes, I did get the start of some patches in the early 2.4 series, I
> said I would accept them in 2.5 as it was too radical of a change to
> take during a stable kernel series (the developer agreed with me.) They
> were never resubmitted to me during the entire 2.5 development time.
>
> thanks,
>
> greg k-h

At this point, we must get something ASAP in the kernel,
otherwise the various drivers waiting for it will just implement their
own proprietary solutions and be done with it. And it doesn't need to
be perfect at this stage, as long as it can evolve in the right
direction.
Manuel Estrada sent me a proposal for that. As it seems it's
the only one we have on the table right now, I will spend some time
looking at it and convincing other wireless driver authors to adopt
it. I hope you will help us getting that integrated and adopted.
Thanks...

Jean

2003-05-15 17:32:09

by Greg KH

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Thu, May 15, 2003 at 10:24:46AM -0700, Jean Tourrilhes wrote:
> Manuel Estrada sent me a proposal for that.

I provided some feedback to him that I think will make his proposal work
for almost everyone. Hopefully he has the time to implement it :)

thanks,

greg k-h

2003-05-15 19:42:37

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Thu, May 15, 2003 at 10:46:48AM -0700, Greg KH wrote:
> On Thu, May 15, 2003 at 10:24:46AM -0700, Jean Tourrilhes wrote:
> > Manuel Estrada sent me a proposal for that.
>
> I provided some feedback to him that I think will make his proposal work
> for almost everyone. Hopefully he has the time to implement it :)
>
> thanks,
>
> greg k-h

I read that thread and I don't agree with some of your
unrealistic requirements.
As long as kernel 2.6.X is not standard in most major
distributions (including Debian), whatever scheme we decide on must be
easy to implement on 2.4.X. Let be realistic : all of us still
continue to update 2.4.X on a regular basis. Those 3 drivers are ready
today (one of them has been waiting on this issue for already 6
months), and I want them in 2.4.X not long after they go in 2.5.X.
Therefore, unless you plan to port sysfs to 2.4.X real soon,
the scheme can't depend exclusively on sysfs. I would even say,
because sysfs change on a weekly basis, it might even be wise to take
a two phase approach, with sysfs used only in the second phase and
based on the feedback and the results from the first phase (I
personally don't believe we will get it perfect at the first try). The
hotplug facility is flexible enough to migrate to sysfs smoothly.
I'm pragmatic : I prefer to have something imperfect now
rather than something perfect later. I think Manuel's solution is a
good stepping stone to where we want to go. If you make it too
difficult, this will never happen (and each driver will use a
proprietary solution or be kept in a black hole).

So, my question for you is :
o how do you plan to make it work with 2.4.X.

Have fun...

Jean

2003-05-15 19:55:41

by Greg KH

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Thu, May 15, 2003 at 12:55:16PM -0700, Jean Tourrilhes wrote:
> On Thu, May 15, 2003 at 10:46:48AM -0700, Greg KH wrote:
> > On Thu, May 15, 2003 at 10:24:46AM -0700, Jean Tourrilhes wrote:
> > > Manuel Estrada sent me a proposal for that.
> >
> > I provided some feedback to him that I think will make his proposal work
> > for almost everyone. Hopefully he has the time to implement it :)
> >
> > thanks,
> >
> > greg k-h
>
> I read that thread and I don't agree with some of your
> unrealistic requirements.

If you think that having a common firmware interface for any kind of
device for 2.5 is unrealistic, then this is going to be a very short
discussion.

<2.4 is here for a long time ramble snipped>

> So, my question for you is :
> o how do you plan to make it work with 2.4.X.

In short, I don't care how you do it for 2.4.x. Do it like the
bluetooth usb drivers do it, that's a good place to start with. Or do
it like the usb drivers that do firmware download from userspace, that's
also a good way to do this for 2.4. So for 2.4 you have a lot of
different options on how to do this, _because_ we don't have the
goodness of sysfs and the driver model there.

For 2.5 do it the way I proposed, that way _all_ devices in the kernel
have a single way to have firmware downloaded to them, which will result
in peace and harmony for many years to come, during which we will gaze
thoughtfully back on the anarchistic ways of 2.4 and laugh at how
foolish we were then.

thanks,

greg k-h

2003-05-16 07:18:31

by Manuel Estrada Sainz

[permalink] [raw]
Subject: Re: airo and firmware upload (was Re: 2.6 must-fix list, v3)

On Thu, May 15, 2003 at 11:04:59AM +1000, David Gibson wrote:
> On Wed, May 14, 2003 at 04:38:26PM -0700, Andrew Morton wrote:
> > Jean Tourrilhes <[email protected]> wrote:
> > >
> > > firmwares blobs
> >
> > well for the purposes of tracking 2.6 activities I'll separate this issue
> > of firmware access policy out from drivers/net/wireless/.
> >
> > yeah, it would be nice if the core kernel provided a "give me my firmware"
> > API or something.
>
> Well, Manuel Estrada (also author of the orinoco USB patches) has
> proposed one on lkml. Doesn't look like people were happy with that
> version, but I think he's still working on revising it based on
> feedback.

Yep, I posted it yesterday. Please provide feedback so I can get it
"right (TM)" and it gets in the kernel for all to enjoy.

Thanks

Manuel
--
--- Manuel Estrada Sainz <[email protected]>
<[email protected]>
<[email protected]>
------------------------ <[email protected]> -------------------
Let us have the serenity to accept the things we cannot change, courage to
change the things we can, and wisdom to know the difference.

2003-05-17 16:47:48

by Pavel Machek

[permalink] [raw]
Subject: Re: 2.6 must-fix list, v3

Hi!

> > Quite a lot of changes here. Mostly additions, but some things have been
> > crossed off.
> >
> > Also at ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/must-fix
>
> I don't like making todo list for other people, because it's
> up to them to decide, but here is my wishlist for 2.6.X in term of
> Wireless stuff.
> I hope those concerned will react and send you their real todo
> list.
>
> o get latest orinoco changes from David. Linus seems timely in
> picking David's changes, so I'm not worried about this one.
>
> o get the latest airo.c fixes from CVS. This will hopefully
> fix problems people have reported on the LKML.
>
> o get HostAP driver in the kernel. No consolidation of the
> 802.11 management across driver can happen until this one is in (which
> is probably 2.7.X material). I think Jouni is mostly ready but didn't
> find time for it.
>
> o get more wireless drivers into the kernel. The most
> "integrable" drivers at this point seem the NWN driver, Pavel's
> Spectrum driver and the Atmel driver.

Is that Pavel Roskin or is there another Pavel around here?

Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

2003-05-29 19:29:32

by Matt Mackall

[permalink] [raw]
Subject: [PATCH] write errors [1/3] async-write-errors

On Wed, May 14, 2003 at 10:44:55AM -0700, Andrew Morton wrote:
> Matt Mackall <[email protected]> wrote:
> >
> > On Wed, May 14, 2003 at 03:27:12AM -0700, Andrew Morton wrote:
> > >
> > > Quite a lot of changes here. Mostly additions, but some things have been
> > > crossed off.
> >
> > Has handling of async write errors fallen off your radar? Should I
> > start pushing that again?
> >
>
> No, I haven't forgotten. If you want to rediff the patches sometime that'd
> be appreciated, thanks.

Ok, rediffed and tested against 2.5.70-mm2. 1 of 3.


Record async write errors and report at subsequent fsync/fdatasync.

diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/buffer.c patched/fs/buffer.c
--- orig/fs/buffer.c 2003-05-21 11:03:25.000000000 -0500
+++ patched/fs/buffer.c 2003-05-21 12:44:43.000000000 -0500
@@ -180,15 +180,29 @@
* Default synchronous end-of-IO handler.. Just mark it up-to-date and
* unlock the buffer. This is what ll_rw_block uses too.
*/
-void end_buffer_io_sync(struct buffer_head *bh, int uptodate)
+void end_buffer_read_sync(struct buffer_head *bh, int uptodate)
{
if (uptodate) {
set_buffer_uptodate(bh);
} else {
- /*
- * This happens, due to failed READA attempts.
- * buffer_io_error(bh);
- */
+ /* This happens, due to failed READA attempts. */
+ clear_buffer_uptodate(bh);
+ }
+ unlock_buffer(bh);
+ put_bh(bh);
+}
+
+void end_buffer_write_sync(struct buffer_head *bh, int uptodate)
+{
+ char b[BDEVNAME_SIZE];
+
+ if (uptodate) {
+ set_buffer_uptodate(bh);
+ } else {
+ buffer_io_error(bh);
+ printk(KERN_WARNING "lost page write due to I/O error on %s\n",
+ bdevname(bh->b_bdev, b));
+ set_buffer_write_io_error(bh);
clear_buffer_uptodate(bh);
}
unlock_buffer(bh);
@@ -556,6 +570,7 @@
*/
void end_buffer_async_write(struct buffer_head *bh, int uptodate)
{
+ char b[BDEVNAME_SIZE];
static spinlock_t page_uptodate_lock = SPIN_LOCK_UNLOCKED;
unsigned long flags;
struct buffer_head *tmp;
@@ -568,6 +583,9 @@
set_buffer_uptodate(bh);
} else {
buffer_io_error(bh);
+ printk(KERN_WARNING "lost page write due to I/O error on %s\n",
+ bdevname(bh->b_bdev, b));
+ page->mapping->error = -EIO;
clear_buffer_uptodate(bh);
SetPageError(page);
}
@@ -1300,7 +1318,7 @@
if (buffer_dirty(bh))
buffer_error();
get_bh(bh);
- bh->b_end_io = end_buffer_io_sync;
+ bh->b_end_io = end_buffer_read_sync;
submit_bh(READ, bh);
if (-EIOCBRETRY == wait_on_buffer_wq(bh, wait))
return ERR_PTR(-EIOCBRETRY);
@@ -2661,8 +2679,10 @@
buffer_error();
if (rw == READ && buffer_dirty(bh))
buffer_error();
-
- set_buffer_req(bh);
+
+ /* Only clear out a write error when rewriting */
+ if (test_set_buffer_req(bh) && rw == WRITE)
+ clear_buffer_write_io_error(bh);

/*
* from here on down, it's all bio -- do the initial mapping,
@@ -2722,13 +2742,14 @@
continue;

get_bh(bh);
- bh->b_end_io = end_buffer_io_sync;
if (rw == WRITE) {
+ bh->b_end_io = end_buffer_write_sync;
if (test_clear_buffer_dirty(bh)) {
submit_bh(WRITE, bh);
continue;
}
} else {
+ bh->b_end_io = end_buffer_read_sync;
if (!buffer_uptodate(bh)) {
submit_bh(rw, bh);
continue;
@@ -2749,7 +2770,7 @@
lock_buffer(bh);
if (test_clear_buffer_dirty(bh)) {
get_bh(bh);
- bh->b_end_io = end_buffer_io_sync;
+ bh->b_end_io = end_buffer_write_sync;
submit_bh(WRITE, bh);
wait_on_buffer(bh);
} else {
@@ -2808,6 +2829,8 @@
bh = head;
do {
check_ttfb_buffer(page, bh);
+ if (buffer_write_io_error(bh))
+ page->mapping->error = -EIO;
if (buffer_busy(bh))
goto failed;
if (!buffer_uptodate(bh) && !buffer_req(bh))
diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/inode.c patched/fs/inode.c
--- orig/fs/inode.c 2003-05-21 11:03:26.000000000 -0500
+++ patched/fs/inode.c 2003-05-21 12:37:26.000000000 -0500
@@ -144,6 +144,7 @@
mapping->dirtied_when = 0;
mapping->assoc_mapping = NULL;
mapping->backing_dev_info = &default_backing_dev_info;
+ mapping->error = 0;
if (sb->s_bdev)
mapping->backing_dev_info = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
memset(&inode->u, 0, sizeof(inode->u));
diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/mpage.c patched/fs/mpage.c
--- orig/fs/mpage.c 2003-04-19 21:48:55.000000000 -0500
+++ patched/fs/mpage.c 2003-05-21 12:37:26.000000000 -0500
@@ -388,6 +388,7 @@
mpage_writepage(struct bio *bio, struct page *page, get_block_t get_block,
sector_t *last_block_in_bio, int *ret, struct writeback_control *wbc)
{
+ struct address_space *mapping = page->mapping;
struct inode *inode = page->mapping->host;
const unsigned blkbits = inode->i_blkbits;
unsigned long end_index;
@@ -562,6 +563,17 @@
if (bio)
bio = mpage_bio_submit(WRITE, bio);
*ret = page->mapping->a_ops->writepage(page, wbc);
+ if (*ret < 0) {
+ /*
+ * lock the page to keep truncate away
+ * then check that it is still on the
+ * mapping.
+ */
+ lock_page(page);
+ if (page->mapping == mapping)
+ mapping->error = *ret;
+ unlock_page(page);
+ }
out:
return bio;
}
@@ -665,6 +677,17 @@
test_clear_page_dirty(page)) {
if (writepage) {
ret = (*writepage)(page, wbc);
+ if (ret < 0) {
+ /*
+ * lock the page to keep truncate away
+ * then check that it is still on the
+ * mapping.
+ */
+ lock_page(page);
+ if (page->mapping == mapping)
+ mapping->error = ret;
+ unlock_page(page);
+ }
} else {
bio = mpage_writepage(bio, page, get_block,
&last_block_in_bio, &ret, wbc);
diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/ntfs/compress.c patched/fs/ntfs/compress.c
--- orig/fs/ntfs/compress.c 2003-05-12 14:34:30.000000000 -0500
+++ patched/fs/ntfs/compress.c 2003-05-21 12:37:26.000000000 -0500
@@ -643,7 +643,7 @@
continue;
}
atomic_inc(&tbh->b_count);
- tbh->b_end_io = end_buffer_io_sync;
+ tbh->b_end_io = end_buffer_read_sync;
submit_bh(READ, tbh);
}

diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/open.c patched/fs/open.c
--- orig/fs/open.c 2003-05-21 11:03:26.000000000 -0500
+++ patched/fs/open.c 2003-05-21 12:37:26.000000000 -0500
@@ -842,21 +842,38 @@
*/
int filp_close(struct file *filp, fl_owner_t id)
{
- int retval;
+ struct address_space *mapping = filp->f_dentry->d_inode->i_mapping;
+ int retval = 0, err;
+
+ /* Report and clear outstanding errors */
+ err = filp->f_error;
+ if (err) {
+ filp->f_error = 0;
+ retval = err;
+ }
+
+ err = mapping->error;
+ if (err && !retval) {
+ mapping->error = 0;
+ retval = err;
+ }

if (!file_count(filp)) {
printk(KERN_ERR "VFS: Close: file count is 0\n");
- return 0;
+ return retval;
}
- retval = 0;
+
if (filp->f_op && filp->f_op->flush) {
lock_kernel();
- retval = filp->f_op->flush(filp);
+ err = filp->f_op->flush(filp);
unlock_kernel();
+ if (err && !retval)
+ retval = err;
}
dnotify_flush(filp, id);
locks_remove_posix(filp, id);
fput(filp);
+
return retval;
}

diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/include/linux/buffer_head.h patched/include/linux/buffer_head.h
--- orig/include/linux/buffer_head.h 2003-05-21 11:03:28.000000000 -0500
+++ patched/include/linux/buffer_head.h 2003-05-21 12:42:06.000000000 -0500
@@ -24,8 +24,9 @@
BH_Async_Read, /* Is under end_buffer_async_read I/O */
BH_Async_Write, /* Is under end_buffer_async_write I/O */
BH_Delay, /* Buffer is not yet allocated on disk */
-
BH_Boundary, /* Block is followed by a discontiguity */
+ BH_Write_EIO, /* I/O error on write */
+
BH_PrivateStart,/* not a state bit, but the first bit available
* for private allocation by other entities
*/
@@ -109,12 +110,14 @@
BUFFER_FNS(Lock, locked)
TAS_BUFFER_FNS(Lock, locked)
BUFFER_FNS(Req, req)
+TAS_BUFFER_FNS(Req, req)
BUFFER_FNS(Mapped, mapped)
BUFFER_FNS(New, new)
BUFFER_FNS(Async_Read, async_read)
BUFFER_FNS(Async_Write, async_write)
-BUFFER_FNS(Delay, delay);
+BUFFER_FNS(Delay, delay)
BUFFER_FNS(Boundary, boundary)
+BUFFER_FNS(Write_EIO,write_io_error)

#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
#define touch_buffer(bh) mark_page_accessed(bh->b_page)
@@ -139,7 +142,8 @@
int try_to_free_buffers(struct page *);
void create_empty_buffers(struct page *, unsigned long,
unsigned long b_state);
-void end_buffer_io_sync(struct buffer_head *bh, int uptodate);
+void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
+void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
void end_buffer_async_write(struct buffer_head *bh, int uptodate);

/* Things to do with buffers at mapping->private_list */
diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/include/linux/fs.h patched/include/linux/fs.h
--- orig/include/linux/fs.h 2003-05-21 11:03:29.000000000 -0500
+++ patched/include/linux/fs.h 2003-05-21 12:37:27.000000000 -0500
@@ -329,6 +329,7 @@
spinlock_t private_lock; /* for use by the address_space */
struct list_head private_list; /* ditto */
struct address_space *assoc_mapping; /* ditto */
+ int error; /* write error for fsync */
};

struct block_device {
diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/kernel/ksyms.c patched/kernel/ksyms.c
--- orig/kernel/ksyms.c 2003-05-21 11:03:33.000000000 -0500
+++ patched/kernel/ksyms.c 2003-05-21 12:42:26.000000000 -0500
@@ -175,7 +175,8 @@
EXPORT_SYMBOL(d_lookup);
EXPORT_SYMBOL(d_path);
EXPORT_SYMBOL(mark_buffer_dirty);
-EXPORT_SYMBOL(end_buffer_io_sync);
+EXPORT_SYMBOL(end_buffer_read_sync);
+EXPORT_SYMBOL(end_buffer_write_sync);
EXPORT_SYMBOL(end_buffer_async_write);
EXPORT_SYMBOL(__mark_inode_dirty);
EXPORT_SYMBOL(get_empty_filp);
diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/mm/filemap.c patched/mm/filemap.c
--- orig/mm/filemap.c 2003-05-21 11:03:33.000000000 -0500
+++ patched/mm/filemap.c 2003-05-21 12:41:34.000000000 -0500
@@ -199,6 +199,14 @@
spin_lock(&mapping->page_lock);
}
spin_unlock(&mapping->page_lock);
+
+ /* Check for outstanding write errors */
+ if (mapping->error)
+ {
+ ret = mapping->error;
+ mapping->error = 0;
+ }
+
return ret;
}

diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/mm/vmscan.c patched/mm/vmscan.c
--- orig/mm/vmscan.c 2003-05-21 11:03:33.000000000 -0500
+++ patched/mm/vmscan.c 2003-05-21 12:37:27.000000000 -0500
@@ -340,6 +340,20 @@
SetPageReclaim(page);
res = mapping->a_ops->writepage(page, &wbc);

+ if (res < 0) {
+ /*
+ * lock the page to keep truncate away
+ * then check that it is still on the
+ * mapping.
+ */
+ lock_page(page);
+ if (page->mapping == mapping)
+ mapping->error = res;
+ unlock_page(page);
+ }
+ if (res < 0) {
+ mapping->error = res;
+ }
if (res == WRITEPAGE_ACTIVATE) {
ClearPageReclaim(page);
goto activate_locked;


--
Matt Mackall : http://www.selenic.com : of or relating to the moon

2003-05-29 19:31:17

by Matt Mackall

[permalink] [raw]
Subject: [PATCH] write errors [2/3] flags

Combine mapping->error and ->gfp_mask into ->flags

diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/drivers/block/loop.c patched/drivers/block/loop.c
--- orig/drivers/block/loop.c 2003-05-29 12:49:24.000000000 -0500
+++ patched/drivers/block/loop.c 2003-05-29 12:52:28.000000000 -0500
@@ -714,8 +714,8 @@
fput(file);
goto out_putf;
}
- lo->old_gfp_mask = inode->i_mapping->gfp_mask;
- inode->i_mapping->gfp_mask = GFP_NOIO;
+ lo->old_gfp_mask = mapping_gfp_mask(inode->i_mapping);
+ mapping_set_gfp_mask(inode->i_mapping, GFP_NOIO);

set_blocksize(bdev, lo_blocksize);

@@ -823,7 +823,7 @@
memset(lo->lo_name, 0, LO_NAME_SIZE);
invalidate_bdev(bdev, 0);
set_capacity(disks[lo->lo_number], 0);
- filp->f_dentry->d_inode->i_mapping->gfp_mask = gfp;
+ mapping_set_gfp_mask(filp->f_dentry->d_inode->i_mapping, gfp);
lo->lo_state = Lo_unbound;
fput(filp);
/* This is safe: open() is still holding a reference. */
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/block_dev.c patched/fs/block_dev.c
--- orig/fs/block_dev.c 2003-05-29 12:49:42.000000000 -0500
+++ patched/fs/block_dev.c 2003-05-29 12:52:28.000000000 -0500
@@ -318,7 +318,7 @@
inode->i_rdev = kdev;
inode->i_bdev = new_bdev;
inode->i_data.a_ops = &def_blk_aops;
- inode->i_data.gfp_mask = GFP_USER;
+ mapping_set_gfp_mask(&inode->i_data, GFP_USER);
inode->i_data.backing_dev_info = &default_backing_dev_info;
spin_lock(&bdev_lock);
bdev = bdfind(dev, head);
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/buffer.c patched/fs/buffer.c
--- orig/fs/buffer.c 2003-05-29 12:52:33.000000000 -0500
+++ patched/fs/buffer.c 2003-05-29 12:52:28.000000000 -0500
@@ -600,7 +600,7 @@
buffer_io_error(bh);
printk(KERN_WARNING "lost page write due to I/O error on %s\n",
bdevname(bh->b_bdev, b));
- page->mapping->error = -EIO;
+ set_bit(AS_EIO, &page->mapping->flags);
clear_buffer_uptodate(bh);
SetPageError(page);
}
@@ -2846,7 +2846,7 @@
do {
check_ttfb_buffer(page, bh);
if (buffer_write_io_error(bh))
- page->mapping->error = -EIO;
+ set_bit(AS_EIO, &page->mapping->flags);
if (buffer_busy(bh))
goto failed;
if (!buffer_uptodate(bh) && !buffer_req(bh))
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/inode.c patched/fs/inode.c
--- orig/fs/inode.c 2003-05-29 12:52:33.000000000 -0500
+++ patched/fs/inode.c 2003-05-29 12:53:07.000000000 -0500
@@ -18,6 +18,7 @@
#include <linux/hash.h>
#include <linux/swap.h>
#include <linux/security.h>
+#include <linux/pagemap.h>
#include <linux/cdev.h>

/*
@@ -142,11 +143,11 @@

mapping->a_ops = &empty_aops;
mapping->host = inode;
- mapping->gfp_mask = GFP_HIGHUSER;
+ mapping->flags = 0;
+ mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
mapping->dirtied_when = 0;
mapping->assoc_mapping = NULL;
mapping->backing_dev_info = &default_backing_dev_info;
- mapping->error = 0;
if (sb->s_bdev)
mapping->backing_dev_info = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
memset(&inode->u, 0, sizeof(inode->u));
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/jfs/inode.c patched/fs/jfs/inode.c
--- orig/fs/jfs/inode.c 2003-04-19 21:48:46.000000000 -0500
+++ patched/fs/jfs/inode.c 2003-05-29 12:52:28.000000000 -0500
@@ -20,6 +20,7 @@
#include <linux/fs.h>
#include <linux/mpage.h>
#include <linux/buffer_head.h>
+#include <linux/pagemap.h>
#include "jfs_incore.h"
#include "jfs_filsys.h"
#include "jfs_imap.h"
@@ -57,7 +58,7 @@
inode->i_op = &jfs_dir_inode_operations;
inode->i_fop = &jfs_dir_operations;
inode->i_mapping->a_ops = &jfs_aops;
- inode->i_mapping->gfp_mask = GFP_NOFS;
+ mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
} else if (S_ISLNK(inode->i_mode)) {
if (inode->i_size >= IDATASIZE) {
inode->i_op = &page_symlink_inode_operations;
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/jfs/jfs_imap.c patched/fs/jfs/jfs_imap.c
--- orig/fs/jfs/jfs_imap.c 2003-04-19 21:48:53.000000000 -0500
+++ patched/fs/jfs/jfs_imap.c 2003-05-29 12:52:28.000000000 -0500
@@ -43,6 +43,7 @@

#include <linux/fs.h>
#include <linux/buffer_head.h>
+#include <linux/pagemap.h>

#include "jfs_incore.h"
#include "jfs_filsys.h"
@@ -504,7 +505,7 @@
}

ip->i_mapping->a_ops = &jfs_aops;
- ip->i_mapping->gfp_mask = GFP_NOFS;
+ mapping_set_gfp_mask(ip->i_mapping, GFP_NOFS);

if ((inum == FILESYSTEM_I) && (JFS_IP(ip)->ipimap == sbi->ipaimap)) {
sbi->gengen = le32_to_cpu(dp->di_gengen);
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/jfs/namei.c patched/fs/jfs/namei.c
--- orig/fs/jfs/namei.c 2003-04-19 21:50:35.000000000 -0500
+++ patched/fs/jfs/namei.c 2003-05-29 12:52:28.000000000 -0500
@@ -257,7 +257,7 @@
ip->i_op = &jfs_dir_inode_operations;
ip->i_fop = &jfs_dir_operations;
ip->i_mapping->a_ops = &jfs_aops;
- ip->i_mapping->gfp_mask = GFP_NOFS;
+ mapping_set_gfp_mask(ip->i_mapping, GFP_NOFS);

insert_inode_hash(ip);
mark_inode_dirty(ip);
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/mpage.c patched/fs/mpage.c
--- orig/fs/mpage.c 2003-05-29 12:52:33.000000000 -0500
+++ patched/fs/mpage.c 2003-05-29 12:52:28.000000000 -0500
@@ -570,8 +570,12 @@
* mapping.
*/
lock_page(page);
- if (page->mapping == mapping)
- mapping->error = *ret;
+ if (page->mapping == mapping) {
+ if (*ret == -EIO)
+ set_bit(AS_EIO, &mapping->flags);
+ else if (*ret == -ENOSPC)
+ set_bit(AS_ENOSPC, &mapping->flags);
+ }
unlock_page(page);
}
out:
@@ -684,8 +688,12 @@
* mapping.
*/
lock_page(page);
- if (page->mapping == mapping)
- mapping->error = ret;
+ if (page->mapping == mapping) {
+ if (ret == -EIO)
+ set_bit(AS_EIO, &mapping->flags);
+ else if (ret == -ENOSPC)
+ set_bit(AS_ENOSPC, &mapping->flags);
+ }
unlock_page(page);
}
} else {
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/open.c patched/fs/open.c
--- orig/fs/open.c 2003-05-29 12:52:33.000000000 -0500
+++ patched/fs/open.c 2003-05-29 12:52:28.000000000 -0500
@@ -20,6 +20,7 @@
#include <linux/mount.h>
#include <linux/vfs.h>
#include <asm/uaccess.h>
+#include <linux/pagemap.h>

#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))

@@ -852,11 +853,10 @@
retval = err;
}

- err = mapping->error;
- if (err && !retval) {
- mapping->error = 0;
- retval = err;
- }
+ if (test_and_clear_bit(AS_ENOSPC, &mapping->flags))
+ retval = -ENOSPC;
+ if (test_and_clear_bit(AS_EIO, &mapping->flags))
+ retval = -EIO;

if (!file_count(filp)) {
printk(KERN_ERR "VFS: Close: file count is 0\n");
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/include/linux/fs.h patched/include/linux/fs.h
--- orig/include/linux/fs.h 2003-05-29 12:52:33.000000000 -0500
+++ patched/include/linux/fs.h 2003-05-29 12:52:28.000000000 -0500
@@ -324,12 +324,11 @@
struct list_head i_mmap_shared; /* list of shared mappings */
struct semaphore i_shared_sem; /* protect both above lists */
unsigned long dirtied_when; /* jiffies of first page dirtying */
- int gfp_mask; /* how to allocate the pages */
+ unsigned long flags; /* error bits/gfp mask */
struct backing_dev_info *backing_dev_info; /* device readahead, etc */
spinlock_t private_lock; /* for use by the address_space */
struct list_head private_list; /* ditto */
struct address_space *assoc_mapping; /* ditto */
- int error; /* write error for fsync */
};

struct block_device {
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/include/linux/gfp.h patched/include/linux/gfp.h
--- orig/include/linux/gfp.h 2003-05-12 14:34:35.000000000 -0500
+++ patched/include/linux/gfp.h 2003-05-29 12:52:28.000000000 -0500
@@ -33,6 +33,9 @@
#define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */
#define __GFP_NO_GROW 0x2000 /* Slab internal usage */

+#define __GFP_BITS_SHIFT 16 /* Room for 16 __GFP_FOO bits */
+#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
+
#define GFP_ATOMIC (__GFP_HIGH)
#define GFP_NOIO (__GFP_WAIT)
#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/include/linux/pagemap.h patched/include/linux/pagemap.h
--- orig/include/linux/pagemap.h 2003-05-29 12:52:33.000000000 -0500
+++ patched/include/linux/pagemap.h 2003-05-29 12:52:28.000000000 -0500
@@ -8,7 +8,30 @@
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/highmem.h>
+#include <linux/pagemap.h>
#include <asm/uaccess.h>
+#include <linux/gfp.h>
+
+/*
+ * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page
+ * allocation mode flags.
+ */
+#define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */
+#define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */
+
+static inline int mapping_gfp_mask(struct address_space * mapping)
+{
+ return mapping->flags & __GFP_BITS_MASK;
+}
+
+/*
+ * This is non-atomic. Only to be used before the mapping is activated.
+ * Probably needs a barrier...
+ */
+static inline void mapping_set_gfp_mask(struct address_space *m, int mask)
+{
+ m->flags = (m->flags & ~__GFP_BITS_MASK) | mask;
+}

/*
* The page cache can done in larger chunks than
@@ -29,12 +52,12 @@

static inline struct page *page_cache_alloc(struct address_space *x)
{
- return alloc_pages(x->gfp_mask, 0);
+ return alloc_pages(mapping_gfp_mask(x), 0);
}

static inline struct page *page_cache_alloc_cold(struct address_space *x)
{
- return alloc_pages(x->gfp_mask|__GFP_COLD, 0);
+ return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0);
}

typedef int filler_t(void *, struct page *);
@@ -56,7 +79,7 @@
*/
static inline struct page *grab_cache_page(struct address_space *mapping, unsigned long index)
{
- return find_or_create_page(mapping, index, mapping->gfp_mask);
+ return find_or_create_page(mapping, index, mapping_gfp_mask(mapping));
}

extern struct page * grab_cache_page_nowait(struct address_space *mapping,
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/mm/filemap.c patched/mm/filemap.c
--- orig/mm/filemap.c 2003-05-29 12:52:33.000000000 -0500
+++ patched/mm/filemap.c 2003-05-29 12:52:28.000000000 -0500
@@ -201,11 +201,10 @@
spin_unlock(&mapping->page_lock);

/* Check for outstanding write errors */
- if (mapping->error)
- {
- ret = mapping->error;
- mapping->error = 0;
- }
+ if (test_and_clear_bit(AS_ENOSPC, &mapping->flags))
+ ret = -ENOSPC;
+ if (test_and_clear_bit(AS_EIO, &mapping->flags))
+ ret = -EIO;

return ret;
}
@@ -591,7 +590,7 @@
page_cache_release(page);
return NULL;
}
- gfp_mask = mapping->gfp_mask & ~__GFP_FS;
+ gfp_mask = mapping_gfp_mask(mapping) & ~__GFP_FS;
page = alloc_pages(gfp_mask, 0);
if (page && add_to_page_cache_lru(page, mapping, index, gfp_mask)) {
page_cache_release(page);
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/mm/shmem.c patched/mm/shmem.c
--- orig/mm/shmem.c 2003-05-29 12:49:55.000000000 -0500
+++ patched/mm/shmem.c 2003-05-29 12:52:28.000000000 -0500
@@ -318,7 +318,7 @@
spin_unlock(&sbinfo->stat_lock);

spin_unlock(&info->lock);
- page = shmem_dir_alloc(inode->i_mapping->gfp_mask);
+ page = shmem_dir_alloc(mapping_gfp_mask(inode->i_mapping));
if (page) {
clear_highpage(page);
page->nr_swapped = 0;
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/mm/vmscan.c patched/mm/vmscan.c
--- orig/mm/vmscan.c 2003-05-29 12:52:34.000000000 -0500
+++ patched/mm/vmscan.c 2003-05-29 12:52:28.000000000 -0500
@@ -347,13 +347,14 @@
* mapping.
*/
lock_page(page);
- if (page->mapping == mapping)
- mapping->error = res;
+ if (page->mapping == mapping) {
+ if (res == -EIO)
+ set_bit(AS_EIO, &mapping->flags);
+ else if (res == -ENOSPC)
+ set_bit(AS_ENOSPC, &mapping->flags);
+ }
unlock_page(page);
}
- if (res < 0) {
- mapping->error = res;
- }
if (res == WRITEPAGE_ACTIVATE) {
ClearPageReclaim(page);
goto activate_locked;


--
Matt Mackall : http://www.selenic.com : of or relating to the moon

2003-05-29 19:32:33

by Matt Mackall

[permalink] [raw]
Subject: [PATCH] write errors [3/3] fs-writepage-truncate

Get rid of newly exposed (and meaningless) EIO errors from truncate
races in filesystems

diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/buffer.c patched/fs/buffer.c
--- orig/fs/buffer.c 2003-05-21 13:26:41.000000000 -0500
+++ patched/fs/buffer.c 2003-05-21 13:26:41.000000000 -0500
@@ -2625,7 +2625,7 @@
*/
block_invalidatepage(page, 0);
unlock_page(page);
- return -EIO;
+ return 0; /* don't care */
}

/*
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/cifs/file.c patched/fs/cifs/file.c
--- orig/fs/cifs/file.c 2003-05-12 14:34:30.000000000 -0500
+++ patched/fs/cifs/file.c 2003-05-21 13:26:41.000000000 -0500
@@ -433,12 +433,18 @@
write_data = kmap(page);
write_data += from;

- if((to > PAGE_CACHE_SIZE) || (from > to) || (offset > mapping->host->i_size)) {
+ if((to > PAGE_CACHE_SIZE) || (from > to)) {
kunmap(page);
FreeXid(xid);
return -EIO;
}

+ /* racing with truncate? */
+ if(offset > mapping->host->i_size) {
+ FreeXid(xid);
+ return 0; /* don't care */
+ }
+
/* check to make sure that we are not extending the file */
if(mapping->host->i_size - offset < (loff_t)to)
to = (unsigned)(mapping->host->i_size - offset);
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/nfs/write.c patched/fs/nfs/write.c
--- orig/fs/nfs/write.c 2003-05-21 12:54:32.000000000 -0500
+++ patched/fs/nfs/write.c 2003-05-21 13:30:39.000000000 -0500
@@ -241,7 +241,7 @@
offset = inode->i_size & (PAGE_CACHE_SIZE-1);

/* OK, are we completely out? */
- err = -EIO;
+ err = 0; /* potential race with truncate - ignore */
if (page->index >= end_index+1 || !offset)
goto out;
do_it:
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/ntfs/aops.c patched/fs/ntfs/aops.c
--- orig/fs/ntfs/aops.c 2003-05-12 14:34:30.000000000 -0500
+++ patched/fs/ntfs/aops.c 2003-05-21 13:26:41.000000000 -0500
@@ -811,8 +811,8 @@
if (unlikely(page->index >= (vi->i_size + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT)) {
unlock_page(page);
- ntfs_debug("Write outside i_size. Returning i/o error.");
- return -EIO;
+ ntfs_debug("Write outside i_size - truncated?");
+ return 0;
}

ni = NTFS_I(vi);
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/reiserfs/inode.c patched/fs/reiserfs/inode.c
--- orig/fs/reiserfs/inode.c 2003-05-21 12:54:32.000000000 -0500
+++ patched/fs/reiserfs/inode.c 2003-05-21 13:26:41.000000000 -0500
@@ -2048,8 +2048,8 @@
last_offset = inode->i_size & (PAGE_CACHE_SIZE - 1) ;
/* no file contents in this page */
if (page->index >= end_index + 1 || !last_offset) {
- error = -EIO ;
- goto fail ;
+ error = 0 ;
+ goto done ;
}
kaddr = kmap_atomic(page, KM_USER0);
memset(kaddr + last_offset, 0, PAGE_CACHE_SIZE-last_offset) ;
diff -urN -x genksyms -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/smbfs/file.c patched/fs/smbfs/file.c
--- orig/fs/smbfs/file.c 2003-04-19 21:50:45.000000000 -0500
+++ patched/fs/smbfs/file.c 2003-05-21 13:26:41.000000000 -0500
@@ -193,7 +193,7 @@
offset = inode->i_size & (PAGE_CACHE_SIZE-1);
/* OK, are we completely out? */
if (page->index >= end_index+1 || !offset)
- return -EIO;
+ return 0; /* truncated - don't care */
do_it:
page_cache_get(page);
err = smb_writepage_sync(inode, page, 0, offset);

--
Matt Mackall : http://www.selenic.com : of or relating to the moon