Paul Mackerras [Wed, 6 Nov 2002 13:07:55 +0000 (05:07 -0800)]
[PATCH] Update powermac IDE driver
This updates the powermac IDE driver in 2.5 so it uses the 2.5 kernel
interfaces and types rather than the 2.4 ones. It also makes it use
blk_rq_map_sg rather than its own code to set up scatter/gather lists in
pmac_ide_build_sglist, and makes it use ide_lock instead of
io_request_lock.
Paul Mackerras [Wed, 6 Nov 2002 13:07:50 +0000 (05:07 -0800)]
[PATCH] Update macserial driver
This updates the macserial driver in 2.5 so it compiles and works. The
main changes are to use schedule_work instead of task queues and BHs.
The patch also removes the wait_key method.
I know we need to change macserial to use the new serial
infrastructure. I'm posting this patch in case it is useful to anyone
trying to compile up a kernel for a powermac at the moment.
Neil Brown [Wed, 6 Nov 2002 13:00:53 +0000 (05:00 -0800)]
[PATCH] kNFSd: Make sure svc_process releases response even on error.
If a rpc operation indicates that response should
be dropped (e.g. kmalloc failure) we must still
call pc_release to release anything it may have allocated.
Neil Brown [Wed, 6 Nov 2002 13:00:40 +0000 (05:00 -0800)]
[PATCH] kNFSd: Make sure final xdr_buf.len is correct on server reply
rq_res->len was not always updated properly.
It is only needed in the sendto routine, so we calculate
it just before that is called, and don't bother
updating it anywhere else.
Neil Brown [Wed, 6 Nov 2002 13:00:35 +0000 (05:00 -0800)]
[PATCH] kNFSd: Support zero-copy read for NFSD
From Hirokazu Takahashi <taka@valinux.co.jp>
This patch changes read and readdir in nfsd.
read:
If the file supports readpage, we use it to collect pages out of the page
cache and to attache them directly to the outgoing nfs reply.
The reduces the number of copies by one, and if the filesystem/device
driver didn't copy the data, and if the network card can support not copying
the data, then you get zero-copy reads.
readdir:
A separate page is used for stoing the readdir response so that a fill
PAGE_SIZE bytes of reply can be supported.
Neil Brown [Wed, 6 Nov 2002 13:00:28 +0000 (05:00 -0800)]
[PATCH] kNFSd: Use ->sendpage to send nfsd (and lockd) replies.
From Hirokazu Takahashi <taka@valinux.co.jp>
As all rpc server replies are now in well defined pages,
we can use ->sendpage to send these replies, and so
make use for zero-copy transmit on network cards that
support it.
Neil Brown [Wed, 6 Nov 2002 13:00:21 +0000 (05:00 -0800)]
[PATCH] md: Fix another two bug in raid5
A partial block write over a block on a failed device
would need to pre-read that block, which means pre-read all
blocks in stripe and generate that block. But the generate-block
code never checked for this possibility, so it wouldn't happen.
Neil Brown [Wed, 6 Nov 2002 13:00:15 +0000 (05:00 -0800)]
[PATCH] md: Fix bug in raid5
When analysing a stripe in handle_stripe we set bits
R5_Wantread or R5_Wantwrite
to indicate if a read or write is needed. We don't actually schedule the
IO immediately as this is done under a spinlock (sh->lock) and
generic_make_request can block. Instead we check these bits after
the lock has been lifted and then schedule the IO.
But once the lock has been lifted we aren't safe against multiple
access, and it is possible that the IO will be scheduled never, or twice.
So, we use test_and_clear to check and potentially schedule the IO.
This wasn't a problem in 2.4 because the equivalent information was
stored on the stack instead of in the stripe.
We also make sure bi_io_vec[0] has correct values as a previous
call to generic_make_request may have changed them.
The patch attached reorders the mempool_free before the barrier is released
and merges resume_device() into put_buf(), (they are only used together).
Otherwise I have kept the locking and wakeups identical to the existing code.
(maybe this could be streamlined)
3. BUG() at close_sync() if (waitqueue_active(&conf->wait_resume).
This occurs with and without the patch for (2).
I think this is a false BUG(). From what I understand of the device barrier
code, there is nothing wrong with make_request() waiting on wait_resume when
this test is made. Therefore I have removed it (the wait_idle test is still
correct).
4. raid1 tries to start a resync if there is only one working drive,
which is pretty pointless, and noisy. We notice that special case and
avoid the resync.
Neil Brown [Wed, 6 Nov 2002 13:00:03 +0000 (05:00 -0800)]
[PATCH] md: Misc little raid fixes
Roughly in order of patch:
1/ xor.h is never needed in md.c
2/ set sb_loaded when we 'sync' mddev to rdev as well as when we load
sb into rdev from disk.
2/ due to lifetime changes, active count can be 2 when we stop array
3/ due to lifetime changes, we need to explicitly clear the ->pers when we
stop an array
4/ autostart can only work for 0.90.0 superblocks.
None others would be silly enough to store device numbers for
all devices in the superblock...
5/ we had lost the setting of 'sb' when auto-starting an array.
6/ Code currently calls export_rdev(start_rdev) when
IS_ERR(start_rdev), which causes an oops.
7/ /proc/mdstat contents error:
code does not take into account that delayed
resyncs can wait with curr_resync = 1 or 2.
8/ There is a premature "return NOTIFY_DONE", that possibly was in
for debugging once...
Eric Sandeen [Wed, 6 Nov 2002 22:18:46 +0000 (23:18 +0100)]
[XFS] Be more careful about quota state changes on ro-devices
We can't allow quota state changes on a read-only device,
this would kick of a failing transaction & shut down the fs.
Previously the test was quota/no quota but we need to disallow
any change wrt user and/or group quota state.
Stephen Lord [Wed, 6 Nov 2002 22:17:04 +0000 (23:17 +0100)]
[XFS] break out the allocator specific parts of the xfs I/O path into
a separate file, xfs_iomap.c out of xfs_lrw.c. Remove some parts
of the code which were not doing anything for us. This is step
one in some major reorgs of this code.
Stephen Lord [Wed, 6 Nov 2002 22:01:45 +0000 (23:01 +0100)]
[XFS] Contributed fix from ASANO Masahiro <masano@tnes.nec.co.jp>. In calculating
the layout of a log record for a buffer, the linux code deals with buffers
which are not contiguous in memory - this only applies to an inode buffer.
This adds one more fragmentation case to the code, and a line was missing
from this. The end result would be the logging of too much data if this
was not the last component of the buffer.
The code was definitely wrong, but I think the chances of hitting this were
pretty slim, and the resulting error would only matter if there was a
crash shortly afterward.
Nathan Scott [Wed, 6 Nov 2002 21:31:29 +0000 (22:31 +0100)]
[XFS] Fix a couple of issues on the error path when dealing with external
devices (log/realtime). path_init was missing the LOOKUP_POSITIVE
flag, so it would fail to tell us if the file doesn't exist, there
was a spot where we were returning the wrong signedness for the code,
and when mount is failing, we can call into xfs_blkdev_put with a
NULL pointer depending on which devices were initialised and which
weren't.
Eric Sandeen [Wed, 6 Nov 2002 21:17:17 +0000 (22:17 +0100)]
[XFS] Avoid creating attrs for acls which can be stored in
the standard permission bits, and remove existing attrs
if acls are reduced to standard permissions.
Nathan Scott [Wed, 6 Nov 2002 21:04:40 +0000 (22:04 +0100)]
[XFS] Fix xfs_da_node_split handling of dir/attr buffers for filesystems built
with a directory block size larger than the filesystem (and hence attr)
blocksize. This does not affect filesystems built with default mkfs.xfs
parameters, and only hits when a large number of attributes are set on
an inode.
Nathan Scott [Wed, 6 Nov 2002 20:46:00 +0000 (21:46 +0100)]
[XFS] Minor header reorg to get xfs_lrw.h back into line with the other linux
headers. Allows us to not repeat the xfs_stratcb declaration in several
places. Also rename linvfs_set_inode_ops to xfs_set_inodeops since its
an auxillary routine not a linvfs method.
Nathan Scott [Wed, 6 Nov 2002 20:43:33 +0000 (21:43 +0100)]
[XFS] Fix the handling of the realtime device on the mount path - this was broken
a few weeks ago with the rework of the target device pointer between the
xfs_mount and pb_target structures.
Russell King [Wed, 6 Nov 2002 22:43:13 +0000 (22:43 +0000)]
[MTD] Avoid bad pointer dereferences in mtd partition cmd line parsing
In response to RMK's message to ipaq@handhelds.org
(http://www.handhelds.org/pipermail/ipaq/2002-November/016028.html),
checking the return value from memparse() before using the output
pointers when parsing mtd partition specs.
My ext3 port of the Orlov allocator was buggy; the block group
descriptor counts for free inodes and directories were getting
doubly decremented / incremented. This patch fixes this, as well
as simplifying the code.
The algorithm for finding the block group descriptor blocks for the
future on-line resizable ext2/3 format change got out of sync with
what was actually shipped in e2fsprogs 1.30. (And what is in e2fsprogs
1.30 is better since it avoids a free block fragmentation at the
beginning of the block group.) This change is safe, since no one is
actually using the new meta_bg block group layout just yet.
This fixes an ext3 htree bug pointed out by Christopher Li; if
adding the new name to the directory causes a split, this can cause
the directory entry containing the old name to move to another
block, and then the removal of the old name will fail.
On Wed, Nov 06, 2002 at 01:50:00PM -0500, J.E.J. Bottomley wrote:
> I'm OK with that, since the drivers can be audited as they're moved over to
> slave attach. It also works for drivers that use older hardware (like the
> 53c700) which don't call adjust_queue_depth from slave attach, but slightly
> later on when they've really verified the device will accept tags. In this
> case, I don't want the mid layer to call adjust_queue_depth for me even if I
> leave slave_attach with only one command allocated.
OK, here it is again, as discussed, plus it calls scsi_release_commandblocks
on slave_attach failure.
Russell King [Wed, 6 Nov 2002 10:10:19 +0000 (10:10 +0000)]
[ARM] Fix Acorn RISCPC mouse input driver
- Always pass a dev_id when allocating a shared interrupt
- Correct Y axis direction
- Correct order of mouse buttons
- Correct polarity of mouse buttons
- Rename CONFIG_MOUSE_ACORN to CONFIG_MOUSE_RISCPC
This patch fixes queue depth setting of scsi devices.
This is done by pairing shost->slave_attach() calls with
a scsi_build_commandblocks in the new scsi_slave_attach.
This is a patch aginst linux-scsi.bkbits.net/scsi-for-linus-2.5 after
applying the last posted hch version of the "Eliminate scsi_host_tmpl_list"
patch, it still applies with offset to the current scsi-for-linus-2.5.
It also:
Will properly call shost->slave_attach after a scsi_unregister_device()
followed by a scsi_register_device() - as could happen if you were able to
rmmod all upper level drivers and then insmod any of them back (only
possible when not booted on scsi).
Checks for scsi_build_commandblocks() allocation failures.
Sets queue depth even if shost->slave_attach() does not call
scsi_adjust_queue_depth.
Removes the use of revoke (no drivers are setting it, it was only
call via the proc scsi remove-single-device interface).
There are at least two problems with sysfs and scsi (one in sysfs, one in
scsi, I'll try and post more soon ...) so I could not completey test rmmod
of an adapter or upper level driver without leading to an oops or shutdown
hang.
Russell King [Tue, 5 Nov 2002 17:12:52 +0000 (17:12 +0000)]
[ARM] Fixes for 2.5.46
- Add LDFLAGS_BLOB definitions
- Tweak kernel_thread for better code
- Fix vmlinux-armv.lds.in to prevent ld complaining about the
architecture private flags.
(I'm not certain that the last item isn't a hole in some bug fix in
ld - this fix appears to work with every binutils I've found thus
far. However, if this suspected bug gets fixed, we're going to have
to rethink how we combine binary objects into ELF objects.)
Russell King [Tue, 5 Nov 2002 16:47:22 +0000 (16:47 +0000)]
[ARM] Make ARM SCSI drivers build
2.5.46 appears to require drivers/scsi/scsi.h to be included before
drivers/scsi/hosts.h. Make this happen in the Acorn SCSI drivers.
Trond Myklebust [Tue, 5 Nov 2002 12:49:33 +0000 (04:49 -0800)]
[PATCH] Convert NFS client to use ->readpages()
- Add the library function read_cache_pages(), which is used in a
similar fashion to the single page 'read_cache_page()'. It hides
the details of the LRU cache etc. from a filesystem that wants to
to populate an address space with a list of pages.
- Fix NFS so that readahead uses the ->readpages() interface. Means
that we can immediately schedule an RPC call in order to complete
the I/O, rather than relying on somebody later triggering it by
calling lock_page() (and hence sync_page()). The sync_page()
method is race-prone, since the waiting page may try to call it
before we've finished initializing the 'struct nfs_page'.
- Clear out nfs_sync_page(), the nfs_inode->read list, and
friends. When the I/O completion gets scheduled in ->readpage(),
->readpages(), they have no reason to exist.
Ingo Molnar [Tue, 5 Nov 2002 12:25:29 +0000 (04:25 -0800)]
[PATCH] thread-aware coredumps, 2.5.43-C3
This is the second iteration of thread-aware coredumps.
Changes:
- Ulrich Drepper has reviewed the data structures and checked actual
coredumps via readelf - everything looks fine and according to the spec.
- a serious bug has been fixed in the thread-state dumping code - it was
still based on the 2.4 assumption that the task struct points to the
kernel stack - it's task->thread_info in 2.5. This bug caused bogus
register info to be filled in for threads.
- properly wait for all threads that share the same MM to serialize with
the coredumping thread. This is CLONE_VM based, not tied to
CLONE_THREAD and/or signal semantics, ie. old-style (or different-style)
threaded apps will be properly stopped as well.
The locking might look a bit complex, but i wanted to keep the
__exit_mm() overhead as low as possible. It's not quite trivial to get
these bits right, because 'sharing the MM' is detached from signals
semantics, so we cannot rely on broadcast-kill catching all threads. So
zap_threads() iterates through every thread and zaps those which were
left out. (There's a minimal race left in where a newly forked child
might escape the attention of zap_threads() - this race is fixed by the
OOM fixes in the mmap-speedup patch.)
- fill_psinfo() is now called with the thread group leader, for the
coredump to get 'process' state.
- initialize the elf_thread_status structure with zeroes.
the IA64 ELF bits are not included, yet, to reduce complexity of the
patch. The patch has been tested on x86 UP and SMP.
David Hinds [Tue, 5 Nov 2002 12:09:50 +0000 (04:09 -0800)]
[PATCH] PATCH: PCMCIA updates for 2.5, #4
drivers/ide/legacy/ide-cs.c:
o Added MODULE_{AUTHOR,DESCRIPTION}, fixed MODULE_LICENSE
o Added support for (Panasonic) KME KXLC005 cards
o Better errno for failed module initialization
drivers/parport/parport_cs.c
o Fixed it so it actually works
o Removed cruft for old kernels
o Better errno for failed module initialization
David Hinds [Tue, 5 Nov 2002 12:09:46 +0000 (04:09 -0800)]
[PATCH] PATCH: more PCMCIA fixes for 2.5
include/pcmcia/ciscode.h
o added product ID's for a few more cards
drivers/net/pcmcia/fmvj18x_cs.c
o Added MODULE_DESCRIPTION
o Added support for RATOC cards
o Added support for Nextcom NC5310B cards
o Added support for SSi 78Q8370 chipset
o Added support for TDK GN3410 multifunction cards
o Better errno for failed module initialization
o Cleaned up whitespace
drivers/net/pcmcia/smc91c92_cs.c
o Added full duplex support for smc91c100 based cards
o Better errno for failed module initialization
o Synced up naming of stuff to match pcmcia-cs version
o Cleaned up whitespace
drivers/pcmcia/cardbus.c
drivers/pcmcia/cistpl.c
drivers/pcmcia/cs_internal.c
o Fixed card identification bug triggered by invoking certain PCMCIA
tools when cardmgr is not running.
Jeff Garzik [Tue, 5 Nov 2002 16:02:34 +0000 (11:02 -0500)]
Remove performance barrier in i810_rng char driver.
In order to conserve CPU, the read(2) syscall would schedule_timeout
unconditionally. This also crippled speed, and was a bad design
decision. This cset merges the updated read(2) logic of the sister
driver amd768_rng from Alan, which schedules only when it needs to.
On my test system, by one microbenmark, read(2) output jumped
from 0.08 kbit/s to "what Intel expects" of 20 kbit/s.
End users may notice a significant decrease in idle time after
this change (and a correspondingly large increase in /dev/hwrng user
speed), if /dev/hwrng is used to its maximum capacity.