Nick Piggin [Thu, 2 Oct 2003 00:53:23 +0000 (17:53 -0700)]
[PATCH] remove io context refcounting debug
This removes the remains of some debugging stuff which was never really
enabled properly - it never reported memory leaks. Its not useful for
anyone but me.
A proper solution involves counting all requests in flight and all
threads but we'll probably put that just into mm.
Alexander Viro [Thu, 2 Oct 2003 00:38:22 +0000 (17:38 -0700)]
[PATCH] Improve sget() performance
sget() is pessimistic and assumes it won't find a superblock - and as a
result it always pre-allocates a new one before even searching for an
existing entry. If it finds an existing one, it free's the extra one it
just allocated.
Especially with /proc usage it usually _does_ find an existing
superblock, so this is all extra work. It should allocate a new one
only if it couldn't find an old one (and re-search).
Alexander Viro [Wed, 1 Oct 2003 18:11:57 +0000 (11:11 -0700)]
[PATCH] Better UDF oops fix
Rather than not kfree'ing the UDF data in the case of a bad inode (which
still _may_ have had the UDF data already allocated to it), make sure to
initialize the pointer to NULL properly when we're done with it.
here's a new patch that attempts to disable BLK_DEV_FD on platforms which
don't support it. The patch also attempts to remove the duplication of the
logic in compat_ioctl.h.
Andrew Morton [Wed, 1 Oct 2003 17:59:18 +0000 (10:59 -0700)]
[PATCH] /proc/PID/auxv file and NT_AUXV core note
From: Roland McGrath <roland@redhat.com>
gdb really needs some way to know the AT_SYSINFO_EHDR value for a process
being debugged or for the dead process described by a core file. Without
this value, it can't find the information necessary to show backtraces of
threads waiting in system calls. There are any number of ways this
information could be made available. Here is one solution that provides
more debugging information in a clean and general fashion.
I've added access to the AT_* values passed to a process for third parties
to examine for debugging purposes. The same data passed on the stack at
startup is made available in /proc/PID/auxv and is written in an NT_AUXV
note in core dumps. (Both of these are consistent with what Solaris does
using the same names.)
Here are two different patches that implement the same thing differently.
The first patch uses a ref-counted data structure to copy the aux vector
and shares among forked mm's until they exec and get a new one. The second
patch avoids the complexity of that data structure by simply expanding the
mm_struct with space to hold a copy of the data. Both patches work
correctly; I have examined the new /proc/PID/auxv file and core dumps.
I hope you will consider including one of these patches, or at least some
way of getting at this information from the debugger. I am certainly open
to other suggestions on implementing this feature, and to suggestions on
alternative interfaces for getting the AT_SYSINFO_EHDR value cleanly.
Andrew Morton [Wed, 1 Oct 2003 17:58:55 +0000 (10:58 -0700)]
[PATCH] scripts/pnmtologo.c warning fixes
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
this patch makes some ints to unsigned ints. They are only used as loop
counters and compared to unsigned ints. GCC 3.3 doesn't like this. They
will never be negative anyway, so we could easily shut him up.
Andrew Morton [Wed, 1 Oct 2003 17:58:48 +0000 (10:58 -0700)]
[PATCH] Pass nameidata to security_inode_permission hook
From: Stephen Smalley <sds@epoch.ncsc.mil>
This patch changes the security_inode_permission hook to also take a
nameidata parameter in addition to the existing inode and mask parameters.
A nameidata is already passed (although sometimes NULL) to
fs/namei.c:permission(), and the patch changes exec_permission_lite() to
also take a nameidata parameter so that it can pass it along to the
security hook.
The patch includes corresponding changes to the SELinux module to use the
nameidata information when it is available; this allows SELinux to include
pathname information in audit messages when a nameidata structure was
supplied.
Andrew Morton [Wed, 1 Oct 2003 17:58:39 +0000 (10:58 -0700)]
[PATCH] Fix bug in SELinux convert_context
From: Stephen Smalley <sds@epoch.ncsc.mil>
This patch fixes a bug introduced by earlier code cleanups in the SELinux
convert_context code that manifests upon a policy reload that removes
previously valid security attributes. Thanks to Magosanyi Arpad for
reporting the bug.
Andrew Morton [Wed, 1 Oct 2003 17:58:24 +0000 (10:58 -0700)]
[PATCH] check permission in ->open for /proc/sys/
From: Christoph Hellwig <hch@lst.de>
It's the only abuse of proc_iops left (except the totally b0rked comx
driver). The patch is from Al, I just forward-ported it from 2.4.
Background: struct proc_dir_entry has a struct inode_operations *proc_iops
member, it's from Linux's stoneage and used internally by procfs to assign
either the link or directory inode ops.
Unfortunately some drivers started to abuse it do do bad things like create
on lookup (that's the comx thingy which relies on unexported symbols and thus
is broken for modular builds since mid-2.3) or various ->permission tricks
(all gone by now).
After this patch is gone I have another one that kills proc_iops and just
uses a normal conditional inside procfs to assign the right one directly.
Andrew Morton [Wed, 1 Oct 2003 17:58:08 +0000 (10:58 -0700)]
[PATCH] table-driven filesystems option parsing
From: "Randy.Dunlap" <rddunlap@osdl.org>, Will Dyson <will_dyson@pobox.com>, me
Add generic filesystem options parser (infrastructure) and use it to parse
mount options in several filesystems (adfs, affs, autofs, autofs4, ext2,
ext3, fat, hfs, hpfs, isofs, jfs, procfs, udf, and ufs).
It saves between 128 and 512 bytes per filesystem.
Andrew Morton [Wed, 1 Oct 2003 17:57:58 +0000 (10:57 -0700)]
[PATCH] memory writeback/invalidation fixes
From: "David S. Miller" <davem@redhat.com>
This attempts to take care of 2 of the MM todos I had on
my backlog:
1) Zap the stupid flush_cache_all() thing with more meaningful
interfaces.
2) Resolve the ptrace user page access issues, first stage.
The "first stage" mentioned for #2 is simply creating the
user page accesor interfaces. The next stage needs to be
mucking with get_user_pages() so that we can control when
the flush_dcache_page() occurs. Then we:
1) For every platform where flush_dcache_page() is a non-nop
add a call to the beginning of copy_{from,to}_user_page().
2) Make access_process_vm() set the "no dcache flush" bit in
it's call to get_user_pages().
The idea also was that we'd consolidate the write etc. boolean
args passed to get_user_pages() into flag bits too.
But at least with the below, we can delete that reminder FIXME
comment from kernel/ptrace.c, the platforms have the necessary
tools and just need to make use of it :)
As a bonus I noticed that VMALLOC_VMADDR() did absolutely nothing.
After all of this I only have 1 real TODO left, and that's dealing
with the SMP TLB/pte invalidation stuff, very low priority until
someone starts doing more work with sparc32/SMP in 2.6.x :)
Andrew Morton [Wed, 1 Oct 2003 17:57:40 +0000 (10:57 -0700)]
[PATCH] dev_t forward compatibility fix
From: Andries.Brouwer@cwi.nl
ext2 used a 32-bit field for dev_t, with possibly undefined storage
following; thus, no action was required to go to 32-bit dev_t, but going to
64-bit dev_t required some subtlety: 0 was written in the first word and
the 64 bits in the following two. Al truncated my 64-bit stuff to 32 bits
but did not understand why there was this split, and wrote 0 followed by a
single word. We should at least zero the word following to have
well-defined storage later.
Sadly, after wandering aimlessly in the desert of unloved patches all
those years, all attribution got lost. This adds a copyright + license
to scripts/bin2c.c, which hasn't aged a day.
Andrew Morton [Wed, 1 Oct 2003 17:57:16 +0000 (10:57 -0700)]
[PATCH] Fix double request_region in com20020
From: Herbert Xu <herbert@gondor.apana.org.au>
Currently com20020 and com20020_cs both call request_region on the same
block of ports leading to a conflict. This patch resolves this by moving
request_region out of the generic driver and into the isa/pci/cs drivers.
The hugetlbfs_fill_super() doesn't free up memory allocated for sbinfo on
the way out in case of parsing error (and a few others). This leads to
memory leak If root tries to mount a hugetlbfs with invalid mount option.
Here is a patch that fix the problem.
Jes Sorensen [Wed, 1 Oct 2003 15:56:56 +0000 (08:56 -0700)]
[PATCH] qla1280 locking update
This fixes the qla1280 driver to not try to release an unlocked spinlock
at boot time - as well as a couple of other minor mods.
I also changed the MMIO option to be dependant on X86_VISWS as it's
really a chipset problem and not something each and every driver should
be asking for.
Getting a global CONFIG_MMIO_IS_BROKEN option would probable be a win
here.
Ivan Kokshaysky [Wed, 1 Oct 2003 15:52:33 +0000 (08:52 -0700)]
[PATCH] Alpha cypress CPU frequency calibration
This fixes (again...) CPU frequency calibration on some platforms with
the Cypress chip. That is, at some point CLOCK_TICK_RATE has been
changed to represent RTC reference clock instead of PIC one. Which
makes calibrate_cc_with_pic() produce utterly bogus results.
o kernel/ksyms.c: set_cpus_schedule was EXPORT_SYMBOL_GPL, bring it back
Originally, before this set of patches moving stuff out from kernel/ksyms.c,
set_cpus_schedule was EXPORT_SYMBOL_GPL, my mistake, bring it back.
Also follow Andrew Morton's suggestions of moving the EXPORT_SYMBOL{_GPL) even
closer to the place where the symbol exported is defined, i.e. just after the
symbol definition, this makes mistakes more difficult to happen, as when the
symbol definition is #ifdefed the EXPORT_SYMBOL{_GPL} is in the same block.
Rik van Riel [Wed, 1 Oct 2003 03:43:42 +0000 (20:43 -0700)]
[PATCH] syscall number for vserver
Vserver is a patch that implements BSD jail style virtual host semantics
inside Linux, where every process not only runs in its own namespace (it
reuses the chroot code for that, should switch to CLONE_NEWNS for 2.6),
but also its own hostname and IP address as well as its own view of
/proc.
Because of that added functionality, it needs more than what is
available in the LSM framework (which can only allow/deny permissions,
not alter return values).
The source code has been running stable for the last few years and is in
use at quite a few service providers. The Fedora project also wants to
use vserver for their build system. However, vserver for 2.4 just tacks
their syscalls onto the end of the syscall table and the userland tools
find those "dynamic numbers" somehow ... EWWWW.
For 2.6 I'd like to do things right. At the moment the vserver patch
has sys_new_s_context and sys_set_ipv4root calls, but since we'll
probably end up getting an ipv6 call too and people are planning future
functionality, I guess it would be more appropriate to multiplex these
through one sys_vserver patch, in the same way sys_ipc works.
For your reference, you can find more information about
vserver on these pages:
I estimate the project has about a dozen developers now. We are
planning on making the implementation for 2.6 fairly lightweight,
reusing infrastructure from other code where possible and only doing
things through sys_vserver where there is no other way.
This small change just adds sys_vserver to the syscall table.
Alexander Viro [Wed, 1 Oct 2003 03:42:10 +0000 (20:42 -0700)]
[PATCH] EFS set_blocksize() error handling
There doesn't seem to be any active maintainer for EFS: It's either
abandoned, or never required specific patches too badly (also quite
possible in this case).
It went into the tree in 2.3.2 and from there to 2.6.0-test6 I see
nothing that would look like maintainer's update. OTOH, it's read-only
and shouldn't be too badly broken (or hard to keep alive).
Outside of trunk (i.e. in 2.4.16--) we have a backport of global 2.5
change (sb_bread()) and check for set_blocksize() failures (from Alan).
This is the 2.6.x equivalent.
Matthew Wilcox [Tue, 30 Sep 2003 15:06:44 +0000 (08:06 -0700)]
[PATCH] PA-RISC updates
PA-RISC updates for 2.6.0-test6
- Some more support for 64-bit userspace
- Move many EXPORT_SYMBOLs out of parisc_ksyms.c
- Make both the OSS and ALSA harmony drivers build
- ioctl typechecking
- Make math-emu build without warnings.
- Persuade SuckyIO to not crash the machine.
It might not have prevented me from reporting the potential bug, but I
would've known you'd thought about it, it might help future developers,
and it's unlikely to become dangerously wrong.