NTFS: Update Documentation/filesystems/ntfs.txt with instructions on how to
use the Device-Mapper driver with NTFS ftdisk/LDM raid. This removes
the linear raid problem with the Software RAID / MD driver when one
or more of the devices has an odd number of sectors.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Mike Miller [Mon, 18 Oct 2004 09:52:20 +0000 (04:52 -0500)]
[PATCH] cciss: fixes for clustering
This patch changes our open specifically for clustering software. We must
allow root to access any volume or device with a LUN ID. We also modified
our revalidate function for this reason.
If a logical is reserved, we must register it with the OS with size=0. Then
the backup system can call BLKRRPART after breaking the reservation to
set the device to the correct size.
We also must register a controller with no logical volumes for the online
utilities to function. This is the way we've done it since the 2.2 kernel.
Which doesn't neccesarily make it right, but we have legacy apps to consider.
Signed off by: Mike Miller <mike.miller@hp.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Ben Dooks [Mon, 18 Oct 2004 23:56:50 +0000 (00:56 +0100)]
[ARM PATCH] 2144/1: S3C2410 - s3c2440 fixes and clock updates
Patch from Ben Dooks
Fixes the following problems and ommisions:
- added variable for base crystal rate
- moved clock variables into clock.c
- fixed bug in identifying s3c2440 cpus
- added initial support for new uart registration
- removed base blocks from include/asm/arch/hardware.h
Ben Dooks [Mon, 18 Oct 2004 23:48:44 +0000 (00:48 +0100)]
[ARM PATCH] 2131/1: Add _iomem to the IO string functions
Patch from Ben Dooks
This patch stops mtd from generating problems of
casting pointers to ints, due to the memcpy_fromio
and related functions all taking `unsigned long`
for their IO addresses.
this also found a real bug, qla2xxx isn't iounmapping at host removal at
all currently - and if the right cpp macro would have been set it'd be
too late.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Oliver Neukum [Mon, 18 Oct 2004 01:22:09 +0000 (18:22 -0700)]
[PATCH] security issue in firmware system
The firmware loader has a security issue. Firmware on some devices can
write to all memory through DMA. Therefore the ability to feed firmware
to the kernel is equivalent to writing to /dev/kmem. CAP_SYS_RAWIO is
needed to protect itself.
[ Editors note: the firmware file is 0644, and owned by root, so this
"security issue" is really only an issue for people who use
capabilities explicitly, rather than the regular Unix permissions.
This patch makes it do the same checks we do for /dev/mem etc. ]
Signed-Off-By: Oliver Neukum <oliver@neukum.name> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Nathan Lynch [Sun, 17 Oct 2004 02:21:08 +0000 (19:21 -0700)]
[PATCH] ppc64: fix smp_startup_cpu for cpu hotplug
This change is needed in order to allow cpus to be onlined after
boot. This used to work but the declaration of
pseries_secondary_smp_init in this file was changed in Ben's big
cleanup patch a while back, so the cpu would start at a bad address.
Nick Piggin [Sun, 17 Oct 2004 02:20:56 +0000 (19:20 -0700)]
[PATCH] kswapd lockup fix
Fix some bugs in the kswapd logic which can cause kswapd lockups.
The balance_pgdat() logic is supposed to cause kswapd to loop across all zones
in the node until each zone either
a) has enough pages free or
b) is deemed to be in an "all pages unreclaimable" state.
In the latter case, we just give the zone a light scan on each balance_pgdat()
scan and wait for the zone to come back to life again.
But the zone->all_unreclaimable logic is broken - if the zone has no pages on
the LRU at all, we perform no scanning of that zone (of course). So the
zone->pages_scanned is not incremented and the expression
if (zone->pages_scanned > zone->present_pages * 2)
zone->all_unreclaimable = 1;
so if the zone has no LRU pages it will still enter the all_unreclaimable
state.
Another problem is that if the zone has no LRU pages we will tell
shrink_slab() that we scanned zero LRU pages. This causes shrink_slab() to
scan zero slab objects, which is obviously wrong. So change shrink_slab() to
perform a decent chunk of slab scanning in this situation.
And put a cond_resched() into the balance_pgdat() outer loop. Probably
unnecessary, but that's what Jeff had in place when he confirmed that this
patch fixed the lockup :(
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Pavel Machek [Sun, 17 Oct 2004 02:20:42 +0000 (19:20 -0700)]
[PATCH] swsusp: fix x86-64 - do not use memory in copy loop
In assembly code, there are some problems with "nosave" section (linker was
doing something stupid, like duplicating the section). We attempted to fix
it, but fix was worse then first problem. This fixes is for good: We no
longer use any memory in the copy loop. (Plus it fixes indentation and
uses meaningful labels.)
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
As Milton noticed, Anton actually broke the logic if the memory isn't
aligned in the first place. Sorry about this mess for such a little
piece of code. This _really_ fixes is it all
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Sat, 16 Oct 2004 08:03:14 +0000 (01:03 -0700)]
[PATCH] ppc64: fix some issues with mem_reserve
I found a couple of issues with reserve_mem:
- If we try and mem_reserve something of zero length, everything
reserved after it would get ignored. This is because early_reserve_mem
sees a zero length as a terminator.
- The code rounded the top down instead of up.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Nowadays, it's possible to build CONFIG_PPC_PMAC without CONFIG_PPC_PSERIES,
in which case, eeh will not be included in the build (and the eeh checks are
turned into no-ops). However, we then "lose" the iomap functions. This patch
moves them to a separate file.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Sat, 16 Oct 2004 08:02:35 +0000 (01:02 -0700)]
[PATCH] ext3 direct io assert fix
Fix bug identified by Badari Pulavarty <pbadari@us.ibm.com>
Local variable `handle' will become stale if ext3_direct_io_get_blocks()
closes off the current transaction and starts a new one. This causes a BUG in
journal_stop().
So reacquire the handle from *current after performing the I/O.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
NTFS: Move the static inline ntfs_init_big_inode() from fs/ntfs/inode.c to
inode.h and make fs/ntfs/inode.c::__ntfs_init_inode() non-static and
add a declaration for it to inode.h. Fix some compilation issues
that resulted due to #includes and header file interdependencies.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
NTFS: Modify fs/ntfs/mft.c::write_mft_record_nolock() and
fs/ntfs/aops.c::ntfs_write_mst_block() to only check the dirty state
of the first buffer in a record and to take this as the ntfs record
dirty state. We cannot look at the dirty state for subsequent
buffers because we might be racing with
fs/ntfs/aops.c::mark_ntfs_record_dirty().
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
NTFS: Modify fs/ntfs/aops.c::mark_ntfs_record_dirty() to no longer take the
ntfs inode as a parameter as this is confusing and misleading and the
ntfs inode is available via NTFS_I(page->mapping->host).
Adapt all callers to this change.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Alan Stern [Fri, 15 Oct 2004 09:20:00 +0000 (04:20 -0500)]
[PATCH] Let LLD specify INQUIRY length
That sounds like a good suggestion. Even better, instead of adding a new
field we can simply use the existing inquiry_length.
This patch changes scsi_probe_lun() to use the value in
sdev->inquiry_length for the first INQUIRY attempt, if that value is
nonzero. Subsequent attempts are based, as before, on the blacklist flags
and the Additional Length field in the INQUIRY data.
The patch also contains a fairly extensive reorganization of the
subroutine. All the code that was duplicated for sending the INQUIRY
command twice has been consolidated. The routine now makes up to three
passes:
In the first pass, the transfer length is the value initially
found in sdev->inquiry_length if that has been set, otherwise
it is the current conservative 36 bytes.
If the first pass succeeds, the routine retrieves the blist flags
for the device and checks the Additional Length field. The blist
flags take precedence over sdev->inquiry_length, which in turn
takes precedence over the Additional Length. If it turns out
there is more data available than we transferred the first time,
a second pass tries to get it.
If the second pass succeeds the INQUIRY data may have changed,
so the blist flags are looked up again and the Additional Length
is checked again. If not, a third pass tries to get the data
back, using the same transfer length as the first pass.
Finally, the value stored in sdev->inquiry_length is set to the amount
actually transferred or the size computed from the Additional Length,
whichever is smaller.
Although the net change in the source file size is small, the new routine
has more comments and less code. Overall I think it's an improvement.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
John Rose [Fri, 15 Oct 2004 05:11:26 +0000 (22:11 -0700)]
[PATCH] PCI Hotplug: rpaphp safe list traversal
Hoping you will accept this fix. The bug can cause a crash upon hotplug
remove. The bug involves unsafe traversal of a list while deleting list
members. The fix uses list_for_each_safe() rather than
list_for_each(). Also threw in an initialization to get rid of a
compiler warning.
Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
James Bottomley [Fri, 15 Oct 2004 04:46:27 +0000 (23:46 -0500)]
SCSI: Fix problems with non-power-of-two sector size discs
We can't support them, but the system should disable them cleanly
and continue when they're detected (at the moment it
dumps a stack trace).
The fix (hack) is to set them to zero size and 512 byte
sectors. This means they're still amenable to ioctls (like
to reformat them with a useful block size) but cannot
be read from or written to.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
NTFS: - Fix two race conditions in fs/ntfs/inode.c::ntfs_put_inode().
- Fix race condition in fs/ntfs/inode.c::ntfs_put_inode() by moving the
index inode bitmap inode release code from there to
fs/ntfs/inode.c::ntfs_clear_big_inode(). (Thanks to Christoph
Hellwig for spotting this.)
- Fix race condition in fs/ntfs/inode.c::ntfs_put_inode() by taking the
inode semaphore around the code thst sets ni->itype.index.bmp_ino to
NULL and reorganize the code to optimize it a bit. (Thanks to
Christoph Hellwig for spotting this.)
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
- Clear the page uptodate flag in fs/ntfs/aops.c::ntfs_write_mst_block()
to ensure noone can see the page whilst the mst fixups are applied.
- Add the helper fs/ntfs/mft.c::ntfs_may_write_mft_record() which
checks if an mft record may be written out safely obtaining any
necessary locks in the process. This is used by
fs/ntfs/aops.c::ntfs_write_mst_block().
- Modify fs/ntfs/aops.c::ntfs_write_mst_block() to also work for
writing mft records and improve its error handling in the process.
Now if any of the records in the page fail to be written out, all
other records will be written out instead of aborting completely.
- Remove ntfs_mft_aops and update all users to use ntfs_mst_aops.
- Modify fs/ntfs/inode.c::ntfs_read_locked_inode() to set the
ntfs_mst_aops for all inodes which are NInoMstProtected() and
ntfs_aops for all other inodes.
- Rename fs/ntfs/mft.c::sync_mft_mirror{,_umount}() to
ntfs_sync_mft_mirror{,_umount}() and change their parameters so they
no longer require an ntfs inode to be present. Update all callers.
- Cleanup the error handling in fs/ntfs/mft.c::ntfs_sync_mft_mirror().
- Clear the page uptodate flag in fs/ntfs/mft.c::ntfs_sync_mft_mirror()
to ensure noone can see the page whilst the mst fixups are applied.
- Remove the no longer needed fs/ntfs/mft.c::ntfs_mft_writepage() and
fs/ntfs/mft.c::try_map_mft_record().
- Fix callers of fs/ntfs/aops.c::mark_ntfs_record_dirty() to call it
with the ntfs inode which contains the page rather than the ntfs
inode the mft record of which is in the page.
Ooops. Yes, I know, I should have split this up into smaller changes...
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Linus Torvalds [Thu, 14 Oct 2004 04:03:12 +0000 (21:03 -0700)]
Take the whole PCI bus range into account when scanning PCI bridges.
A bridge that has been set up by firmware to cover multiple PCI
buses but doesn't actually have anything connected behind some of
them caused us to use the incorrect maxmimum bus number span when
scanning the bridge chip.
Problem reported by Tim Saunders, with Russell King suggesting
the fix.
Linus Torvalds [Thu, 14 Oct 2004 04:00:06 +0000 (21:00 -0700)]
Fix threaded user page write memory ordering
Make sure we order the writes to a newly created page
with the page table update that potentially exposes the
page to another CPU.
This is a no-op on any architecture where getting the
page table spinlock will already do the ordering (notably
x86), but other architectures can care.
Add a memory barrier to the assembly checksum code - the code was copied
straight from the i386 one, and the patch resyncs the code with the
original. I'll check if the original code can be included directly (i.e.
"#include") after 2.6.9.
Without this patch, every 2.6 UML release corrupts the checksum of every
UDP fragmented packet with size >= MTU (verified by various people, we all
agree on this issue; nobody reported "Works fine here"). The corrupted
packets are not accepted, thus blocking any kind of communication with
large-sized UDP packets.
In fact, I've even dissected the UML -> host traffic before and after this
patch with Ethereal - and it always reported an incorrect checksum for
fragmented UDP packets before and always correct after applying the patch.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: use always a separate io thread for UBD
Currently, ubd=sync is different from replacing ubd#= with ubd#s=. This is
against Principle of Least Surprise, so remove this difference.
Also the current ubd=sync behaviour is completely useless: it is to make sure
that when the kernel has synched its I/O to the virtual disk, the host does
not invalidate this with his caching; this causes ReiserFS corruption.
But since actually we call end_request() only after the io_thread has done its
work, we never lie to the block layer. Using O_SYNC as we do when replacing
ubd#= with ubd#s= is enough.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: BlaisorBlade <blaisorblade_spam@yahoo.it>, Chris Wright <chrisw@osdl.org>
Avoid deadlocking onto the request lock in the UBD driver, i.e. don't lock
the queue spinlock when called from the request function.
In detail:
Rename ubd_finish() to __ubd_finish() and remove ubd_io_lock from it. Add
wrapper, ubd_finish(), which grabs lock before calling __ubd_finish(). Update
do_ubd_request to use the lock free __ubd_finish() to avoid deadlock. Also,
apparently prepare_request is called with ubd_io_lock held, so remove locks
there.
Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Makes the UML build system work well even under parallel make (tested, so far,
even with -j50). Please notice that it must be updated for every makefile
change. Or better, every makefile change must use correct dependencies (and
they are easy to miss).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Uml-specific patch (which requires a mainline hook, mailed separately).
This patch avoid the linking kludge which leaves kbuild link vmlinux and then
link it with libc inside linux. This kludge has the big problem of making
kallsyms break, since the kallsyms pass is done on a completely
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: no extraversion in arch/um/Makefile for mainline
Extraversion in arch/um/Makefile is not needed in mainline, but just for
separate patches; also, they should set it in the main Makefile, not elsewhere
(Jeff Garzik has just complained). Also remove the dependency from version.h
on arch/um/Makefile: it was added because arch/um/Makefile could change the
kernel version number.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This forces make to use bash rather than whatever /bin/sh is linked to.
Without this, since there are some bash extensions used in the build and when
/bin/sh isn't bash, then the build fails without a clear error message.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: Set cflags before including arch Makefile
If arch/$(ARCH)/Makefile is included before adding -O2 (and the rest) to
CFLAGS, I must duplicate the addition of it to USER_CFLAGS for UML. So let's
fix this. Also, the below code is useless, since if CONFIG_DEBUG_INFO is y,
then CONFIG_FRAME_POINTER is always y.
Add some updates for API changes in 2.6.8 which were not included in the
original UML patch; these fixes were detected by some warnings, so I probably
missed some more ones.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
James Morris [Wed, 13 Oct 2004 14:28:10 +0000 (07:28 -0700)]
[PATCH] SELinux: fix bugs in mprotect hook
The patch below by Roland McGrath fixes two bugs in the implementation of
the selinux_file_mprotect hook:
It calls selinux_file_mmap, which has two problems. First, the stacked
security module will get both mmap and mprotect callbacks for an
mprotect call, which is wrong. Secondly, the vm_flags value contains
VM_* bits, and these do not match the MAP_* bits of the same name or
function, so it passes bogus flags and causes every mprotect to be
treated as if MAP_SHARED were in use.
The patch shares the common code while not having one function call the
other, and fixes these two bugs.
Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This fixes a bug in SELinux to retain the ptracer SID (if any) across fork.
Otherwise, SELinux will always deny attempts by traced children to exec
domain-changing programs even if the policy would have allowed the tracer
to trace the new domains as well.
Signed-off-by: Stephen Smalley <sds@epoch.ncsc.mil> Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Tim Schmielau [Wed, 13 Oct 2004 14:27:49 +0000 (07:27 -0700)]
[PATCH] Fix reporting of process start times
Derive process start times from the posix_clock_monotonic notion of uptime
instead of "jiffies", consistent with the earlier change to /proc/uptime
itself.
(http://linus.bkbits.net:8080/linux-2.5/cset@3ef4851dGg0fxX58R9Zv8SIq9fzNmQ?na%0Av=index.html|src/.|src/fs|src/fs/proc|related/fs/proc/proc_misc.c)
Process start times are reported to userspace in units of 1/USER_HZ since
boot, thus applications as procps need the value of "uptime" to convert
them into absolute time.
Currently "uptime" is derived from an ntp-corrected time base, but process
start time is derived from the free-running "jiffies" counter. This
results in inaccurate, drifting process start times as seen by the user,
even if the exported number stays constant, because the users notion of
"jiffies" changes in time.
It's John Stultz's patch anyways, which I only messed up a bit, but since
people started trading signed-off lines on lkml:
Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Olaf Kirch [Wed, 13 Oct 2004 14:27:25 +0000 (07:27 -0700)]
[PATCH] auth_domain_lookup fix
This patch makes sure that auth_domain_lookup returns NULL when it doesn't
find a matching entry, rather than the last entry in the hash chain.
Signed-off-by: Olaf Kirch <okir@suse.de> Acked-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Hirokazu Takata [Wed, 13 Oct 2004 14:26:37 +0000 (07:26 -0700)]
[PATCH] m32r: remove obsolete system calls
This patch is for removing obsolete system calls from m32r kernel, such as
old_mmap and old_select.
* arch/m32r/kernel/entry.S:
- Remove an obsolete system call, old_mmap, from the syscall table.
* arch/m32r/kernel/sys_m32r.c:
- Remove obsolete system calls, old_mmap() and old_select().
- do_mmap2() is renamed to sys_mmap2().
* CAUTION (for m32r users):
The new kernel (applied this patch) does not have a backward
compatibility. The new kernel and old library pair does not work.
So, those who want to use the new kernel must use a new version of
glibc (the GNU C library), which uses the "mmap2(_NR_mmap2)" syscall
for __mmap() instead of the "old_mmap(__NR_mmap)".
The new glibc package, libc6_2.3.2.ds1-16.0.3_m32r.deb, is provided
on the following site, please apt-get/download it and upgrade.
Andrew Morton [Wed, 13 Oct 2004 14:26:13 +0000 (07:26 -0700)]
[PATCH] revert writeback threshold changes
The post-2.6.8 recent tweaks to the page writeback thresholding code seems to
be doing the wrong thing for small unmapped_ratios - nathans had a few
problems with it. The problem it was trying to fix is minor and fairly
theoretical anyway, so back it out to the old code.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- Remove the setting of CLOCK_REALTIME and CLOCK_MONOTONIC resolution
according to the interpolator resolution since this causes periodic timer
signals to fail. The clocks will still be high-resolution but the
"resolution" reported reflects the timer intervals possible via
timer_settime (also more conformant to what the Single Unix Specification
says).
- Make the IA64 clock_gettime fastcall fall back on negative clock
numbers instead of returning CLOCK_REALTIME.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>