Martin Dalecki [Mon, 18 Feb 2002 01:05:04 +0000 (17:05 -0800)]
[PATCH] Re: IDE cleanup for 2.5.4-pre3
The end_request() function familiy (not the global one, but the IDE
specific ones), did bear a permuted parameter ordering. After fixing
this it turned out that at all places the huk parameter wasn't the
hwgroup, but just the drive in question itself. I have changed this to
be more sane, which allowed to remove many unneccessary code
duplication, or rather obfuscation, in between the __ide_end_request()
and ide_end_request() functions. This simplification is actually the
"spreading" part of the game.
Andrew Morton [Mon, 18 Feb 2002 01:01:56 +0000 (17:01 -0800)]
[PATCH] ENOSPC correctness
A forward-port. This is the code which prevents ENOSPC
errors from exposing stale data within filesystems.
- in generic_file_write(), if prepare_write() fails, truncate
the file to drop any part-added blocks.
- in __block_write_full_page(), if we hit an error, push
whatever buffers we _have_ mapped into the file out to disk.
- in __block_prepare_write(), if we hit an error, zero out
any blocks which we did manage to map into the file. This
is because the caller won't be doing any writing to those
blocks due to the error.
Andrew Morton [Mon, 18 Feb 2002 01:01:52 +0000 (17:01 -0800)]
[PATCH] msync correctness
A forward port. At present, msync() does not report errors
from EIO or ENOSPC. fsync() has the same bug for mapped pages
against the affected fd.
The patch correctly propagates these errors back up from
writepage so that fsync and msync correctly report errors.
It's fairly important - msync is the only way we have
of reporting ENOSPC against sparse mappings.
Of course, you can still silently lose your data if it's kswapd who
gets ENOSPC during writepage. I have 3/4 of a patch for that. It
records the data loss so that a later msync() will report the bad
news.
This patch also adds an implementation of msync(MS_ASYNC), because
it was easy.
Andrew Morton [Mon, 18 Feb 2002 01:01:48 +0000 (17:01 -0800)]
[PATCH] IS_SYNC diretory handling
A forward-port. ext2, minix and sysv aren't handling directories
correctly when IS_SYNC is in place. They call waitfor_one_page(),
but forgot to start the I/O.
The patch also moves waitfor_one_page and writeout_one_page
into fs/buffer.c, so mm/filemap.c now does not mention buffer_head
at all.
Andrew Morton [Mon, 18 Feb 2002 00:44:37 +0000 (16:44 -0800)]
[PATCH] BUG register preservation
Here's the x86 BUG() implementation we discussed the other day.
I also have the rework of the header files which avoids
instantiation of strings in headers and saves 100-200k.
However that is only needed for gcc 2.X. I assume that
by the time 2.6 is in use, gcc-3.x will be the preferred
compiler.
move nfsd_init into an initcall with other module
startup. This means that "initialized" isn't needed for
any of the files that use it, as the bits are always initialised if
in use.
1/ add an "owner" field to the nfsd_linkage structure
2/ grab a reference to that module before calling the syscall
3/ Remove the reference counting from inside the module
4/ Always allow nfsd module to be called, even if compile with
CONFIG_NFSD == N
( but not if CONFIG_MODULES also == N)
1/ changes to sys_fsync had not also been made to nfsd_sync.
Now nfsd_sync calls filemap_fdatasync and filemap_fdatawait.
2/ change nfsd_readdir to use vfs_readdir instead of i_op->readdir
Neil Brown [Mon, 18 Feb 2002 00:40:02 +0000 (16:40 -0800)]
[PATCH] PATCH 3/7: knfsd cleanups - incorrect use of inode_change_ok
Get nfsd_setattr to not put too much weight on inode_change_ok
nfsd_currently calls inode_change_ok and does not try setattr if this fails.
However this is wrong. If a filesystem defines it's own i_op->setattr, then
it might use a completely different mechanisim for determining what is ok.
nfsd shouldn't assume...
We still use inode_change_ok when normalising NFSv2 "touch" requests, but
only in passing.
the fh_to_dentry routines should never return NULL.
The caller expects an ERR_PTR or a valid (possibly negative)
dentry. fat did the wrong thing and so could oops.
Neil Brown [Mon, 18 Feb 2002 00:39:53 +0000 (16:39 -0800)]
[PATCH] PATCH 1/7: knfsd cleanups - big fixes
Fix bugs recently introduced into kNFSd
When searching a list.h list, we cannot export
to find NULL at the end. Instead we return a pointer
when found, or NULL if nothing found. Same bug, 4 times.
The seq_file improvements to /proc/fs/nfs/exports got the counting
wrong so that some clients would get reported twice, always the last.
Alexander Viro [Mon, 18 Feb 2002 00:35:06 +0000 (16:35 -0800)]
[PATCH] dnotify race fix
A bunch of places dereferences ->d_parent->d_inode with no
protection whatsoever (e.g. on return from read()). It's an
SMP race on all boxen and pretty wide UP race if we have dnotify
set on parent (race between read() and rename() and similar beasts).
Patch below is the first one in a series of ->d_parent-related
fixes. It adds a helper (dnotify_parent(dentry, event)) and converts
places that did inode_dir_notify(dentry->d_parent->d_inode,...) to it.
Please, apply. Notice that problem exists in 2.4 and unlike 2.5
there we can't switch to saner API (basically, reporting file events on
file, not on a parent directory).
Some of the further fixes depend on Pat's and Greg's (driverfs and usbdevfs
resp.) patches, so getting them merged would make life easier. And yes,
some of further chunks (e.g. smbfs ->revalidate() and friends) will also
have to go into 2.4 - they are independent from any threading projects ;-/
J. A. Magallon [Thu, 14 Feb 2002 09:33:14 +0000 (01:33 -0800)]
[PATCH] pid allocator bugfix
This patch fixes a bug in the Linux process ID allocator. It isn't quite
SMP safe since it references "last_pid" after releasing the lock protecting
it. This can result in two processes getting assigned the same process ID.
Nathan Scott [Wed, 13 Feb 2002 13:45:51 +0000 (05:45 -0800)]
[PATCH] xattr updates (minor, 4/4)
This final patch is a simple documentation fixup patch filling
in the blanks for the extended attribute interfaces; and fixes
a typo in the same spot: "permission".
Nathan Scott [Wed, 13 Feb 2002 13:45:45 +0000 (05:45 -0800)]
[PATCH] xattr updates (minor, 3/4)
This next incremental patch tidies up the data types passed back
from the `list' and `get' extended attribute syscalls - these now
match the design (ie. using ssize_t) rather than simply using long
or int everywhere; also now use const types in the VFS interface,
where appropriate.
Nathan Scott [Wed, 13 Feb 2002 13:45:40 +0000 (05:45 -0800)]
[PATCH] xattr updates (minor, 2/4)
This incremental patch fixes copying out of an extended attribute
value or name list. Previously we copied out the entire buffer
passed in from userspace, now we only copy out the size which the
underlying filesystem tells us to (ie. we will no longer include
potentialy-initialised data as well).
Nathan Scott [Wed, 13 Feb 2002 13:45:35 +0000 (05:45 -0800)]
[PATCH] xattr updates (minor, 1/4)
This first patch fixes the copying in of extended attribute
names from userspace in the extended attribute syscalls (a
problem found when using electric fence on the user tools).
Alexander Viro [Wed, 13 Feb 2002 04:31:09 +0000 (20:31 -0800)]
[PATCH] SMP-safe ext2/namei.c
BKL held around ->i_nlink changes in ext2/namei.c. That makes
namei.c SMP-safe (dir.c already is). BKL dropped around ext2_free_inode() -
it's already SMP-safe (the only place that needed BKL was DQUOT_FREE_INODE()
and it got BKL in the previous patch).
Alexander Viro [Wed, 13 Feb 2002 04:31:05 +0000 (20:31 -0800)]
[PATCH] BKL shifted into ->create()
BKL shifted into ->create(). lock_kernel()/unlock_kernel() added
in dquot_{alloc,free}_inode() - that makes {ext2,minix,sysv,ufs}_read_inode()
SMP-safe.
Alexander Viro [Wed, 13 Feb 2002 04:31:00 +0000 (20:31 -0800)]
[PATCH] ext2/inode.c cleanup.
ext2_read_inode() and ext2_update_inode() share large chunk
of code - getting a buffer_head with raw inode in it.
Moved into a helper function (ext2_get_inode()), the rest
of ext2_{read,update}_inode() slightly cleaned up.
Andi Kleen [Wed, 13 Feb 2002 04:17:35 +0000 (20:17 -0800)]
[PATCH] x86_64 merge: arch + asm
This adds the x86_64 arch and asm directories and a Documentation/x86_64.
It took a bit longer because I first had to make preemption and thread_info
work and also found some other bugs while doing this. The port has been
tested for a long time on UP.
I'm not sure what I should describe. A lot is based on i386 with
a lot of cleanups. I wrote a paper about it for last year's OLS that describes
most of the changes (ftp://ftp.firstfloor.org/pub/ak/x86_64.ps.gz). It is
a bit outdated now, but should give a good overview.
It currently has a completely cut'n'pasted from others+hacked 32bit
emulation. I hope to clean that up in the future by merging the generic
core of this with other 64bit archs.
Paul Mackerras [Wed, 13 Feb 2002 04:27:37 +0000 (20:27 -0800)]
[PATCH] flush_icache_user_range (v2.5.4)
The patch below changes access_process_vm to use a new architecture
hook, flush_icache_user_range, instead of flush_icache_page, and adds
a definition of flush_icache_user_range which does the same thing as
flush_icache_page for all architectures except PPC. (The PPC update
that is in Linus' BK tree already includes a suitable definition of
flush_icache_user_range.)
The reason for doing this is that when flush_icache_page is called
from do_no_page or do_swap_page, I want to be able to do the flush
conditionally, based on the state of the page. In contrast,
access_process_vm needs to do the flush unconditionally since it has
just modified the page. In the access_process_vm case it is useful to
have the information about the user address and length that have been
modified since then we can just flush the affected cache lines rather
than the whole page.
This patch should make it easy to improve performance on alpha, since
there (as I understand it) the icache flush is not needed at all in
do_no_page or do_swap_page, but is needed in access_process_vm. All
that is needed is to make flush_icache_page a noop on alpha. The
patch below doesn't do this, I'll let the alpha maintainers push that
change if they want.
This one-liner fixes an error case in Menuconfig when awk fails.
Written by Andrew Church (achurch@achurch.org).
Reviewed and tested by Michael Elizabeth Chastain (mec@shout.net).
Ingo Molnar [Wed, 13 Feb 2002 15:01:58 +0000 (16:01 +0100)]
- make the preempt-enable test cheaper - only test for the (very rare) TIF_NEED_RESCHED
condition, we test the preemption count in preempt_schedule(). This reduces the icache
footprint and the overhead of preemption.
- plus optimize the irq-path preemption check a bit.
Ingo Molnar [Wed, 13 Feb 2002 14:32:22 +0000 (15:32 +0100)]
this is a fragile piece of the ptrace code, the code relies on a single wakeup coming from the parent.
This fix is necessery after the preempt_schedule() cleanups, it unbreaks 'strace strace ...'.
Ingo Molnar [Wed, 13 Feb 2002 03:45:03 +0000 (04:45 +0100)]
do not unlock irqs before calling schedule() - besides being a small exit() speedup, this also
fixes a preemption race that was introduced by my removal of PREEMPT_ACTIVE.
Ingo Molnar [Tue, 12 Feb 2002 19:57:41 +0000 (20:57 +0100)]
a cleanup and a bugfix in the preemptive kernel:
- the PREEMPT_ACTIVE trick is not needed
- schedule() should check for need_resched, we might miss a
reschedule otherwise.
the cleanup also fixes the bug. The only reason why i kept
preempt_schedule() was to fix up p->state to TASK_RUNNING,
to make it possible to preempt from places that mark the
task TASK_UNINTERRUPTIBLE before adding the task to a waitqueue,
and thus a preemption in that small window could cause the
task to be removed from the runqueue erroneously.
Martin Diehl [Tue, 12 Feb 2002 14:55:33 +0000 (06:55 -0800)]
[PATCH] usb_set_interface: correct toggle reset
this is a patch to prevent usb_set_interface() from erroneously resetting
the toggles for all endpoints instead of only the affected ones from the
requested interface/altsetting. I've also added some missing parentheses
to related macros in usb.h as I prefered not to take special care for
nasty side-effects ;-)
Patch below was created against 2.4.18-pre9 (with some lines of offset it
applies to 2.5.4-pre5 as well).
Tested in multi-interface configuration to provide evidence it:
* correctly identifies the affected endpoints and resets the toggles
* doesn't touch endpoints from other interfaces
* provides correct handling of shared EP0
* solves an issue I had with 2.4.18-pre9 where setting one interface
occasionally caused transfers on other interface to hang due to lost
toggle synchronisation
Despite being a pure bugfix, well localized and (IMHO) pretty obviously
correct wrt. USB-spec, I'd like to suggest including this in early
2.4.19-pre. Just in case some existing driver would somehow workaround
the currently wrong behavior and might break with this fix. And it's
not very urgent right now, as we are probably close to 2.4.18-rc1.
Jeff Garzik [Mon, 11 Feb 2002 20:43:07 +0000 (15:43 -0500)]
Cleanup and fixes to sleeping/scheduling in the olympic token ring
net driver. Also included are a couple of minor error reporting
updates and the proper detection for cardbus removal.
Contributor:
Mike Phillips
Linux Token Ring Project
Jeff Garzik [Mon, 11 Feb 2002 20:36:17 +0000 (15:36 -0500)]
Merge changes from yellowfin GigE net driver version LK1.1.6:
* Only print warning on truly "oversized" packets
* Fix theoretical bug on gigabit cards - return to 1.1.3 behavior