23 Jun, 2006

40 commits

  • Provide a checklist of techniques to aid kernel patch submitters in
    producing healthy patches and in lessening a burden on maintainers.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • If invalidate_mapping_pages is called to invalidate a very large mapping
    (e.g. a very large block device) and if the only active page in that
    device is near the end (or at least, at a very large index), such as, say,
    the superblock of an md array, and if that page happens to be locked when
    invalidate_mapping_pages is called, then

    pagevec_lookup will return this page and
    as it is locked, 'next' will be incremented and pagevec_lookup
    will be called again. and again. and again.
    while we count from 0 upto a very large number.

    We should really always set 'next' to 'page->index+1' before going around
    the loop again, not just if the page isn't locked.

    Cc: "Steinar H. Gunderson"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Cc: Greg KH
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Put the connector exports at the functions so people can see them in context.

    Cc: Evgeniy Polyakov
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Switch an open-coded strstrip() to use the new API.

    Acked-by: Corey Minyard
    Signed-off-by: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • Add a new strstrip() function to lib/string.c for removing leading and
    trailing whitespace from a string.

    Cc: Michael Holzheu
    Acked-by: Ingo Oeser
    Acked-by: Joern Engel
    Cc: Corey Minyard
    Signed-off-by: Pekka Enberg
    Acked-by: Michael Holzheu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • Change the license on the process event structure passed between kernel and
    userspace.

    Signed-off-by: Matt Helsley
    Acked-by: Guillaume Thouvenin
    Acked-by: Nguyen Anh Quynh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Helsley
     
  • Move connector header include to precisely where it's needed.

    Remove unused time.h header file as well. This was leftover from previous
    iterations of the process events patches.

    Signed-off-by: Matt Helsley
    Cc: Guillaume Thouvenin
    Cc: Nguyen Anh Quynh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Helsley
     
  • The likely() profiling tools show that __alloc_page() causes a lot of misses:

    ! 132 119193 __alloc_pages():mm/page_alloc.c@937

    Because most __alloc_page() calls are not atomic.

    Signed-off-by: Hua Zhong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hua Zhong
     
  • The percpu counter data type are changed in this set of patches to support
    more users like ext3 who need more than 32 bit to store the free blocks
    total in the filesystem.

    - Generic perpcu counters data type changes. The size of the global counter
    and local counter were explictly specified using s64 and s32. The global
    counter is changed from long to s64, while the local counter is changed from
    long to s32, so we could avoid doing 64 bit update in most cases.

    - Users of the percpu counters are updated to make use of the new
    percpu_counter_init() routine now taking an additional parameter to allow
    users to pass the initial value of the global counter.

    Signed-off-by: Mingming Cao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mingming Cao
     
  • - Move percpu_counter routines from mm/swap.c to lib/percpu_counter.c

    Signed-off-by: Ravikiran Thirumalai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ravikiran G Thirumalai
     
  • - When setting a sighandler using sigaction() call, if the flag
    SA_ONSTACK is set and no alternate stack is provided via sigaltstack(),
    the kernel still try to install the alternate stack. This behavior is
    the opposite of the one which is documented in Single Unix Specifications
    V3.

    - Also when setting an alternate stack using sigaltstack() with the flag
    SS_DISABLE, the kernel try to install the alternate stack on signal
    delivery.

    These two use cases makes the process crash at signal delivery.

    Signed-off-by: Laurent Meyer
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Cc: Kyle McMartin
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Chris Zankel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Laurent MEYER
     
  • Remove redundant casts from NEW_AUX_ENT() arguments in fs/binfmt_elf.c

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Do a CodingStyle cleanup of fs/binfmt_elf.c and also remove some pointless
    casts of kmalloc() return values in the same file.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Update Documentation/devices.txt with a new version from the LANANA site
    http://www.lanana.org/docs/device-list/devices-2.6+.txt

    Signed-off-by: Jan Engelhardt
    Cc: Torben Mathiasen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Engelhardt
     
  • Use the new LED infrastructure to support the 6 LEDs present on the Amstrad
    Delta.

    [akpm@osdl.org: cleanup]
    Signed-off-by: Jonathan McDowell
    Ackde-by: Richard Purdie
    Cc: Ben Dooks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan McDowell
     
  • Signed-off-by: Andreas Mohr
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Mohr
     
  • Steven Rostedt points out that `rsv' here is usually
    NULL, so we should avoid calling kfree().

    Also, fix up some nearby whitespace damage.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • There are a couple of places where JBD has to check to see whether an unneeded
    memory allocation was performed. Usually it _was_ needed, so we end up
    calling kfree(NULL). We can micro-optimise that by checking the pointer
    before calling kfree().

    Thanks to Steven Rostedt for identifying this.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • The hardirq_ctx and softirq_ctx variables are written to on init only,

    Signed-off-by: Andreas Mohr
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Mohr
     
  • If you get to that point in the code it means that desc->move_irq is set,
    pending_irq_cpumask[irq] and cpu_online_map should have a value. Still
    pretty good chance anding those two you'll still have a value. So these
    two branch predictors should be inverted.

    Signed-off-by: Daniel Walker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Walker
     
  • isdn_writebuf_stub() forgets to detect memory allocation and uaccess errors.
    And when that's fixed, if a error happens the caller will just keep on
    looping.

    So change the caller to detect the error, and to return it.

    Signed-off-by: Jesper Juhl
    Cc: Karsten Keil
    Signed-off-by: Tilman Schmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Fix leak of `rcvmsg' in sc_ioctl().

    There are two returns in the switch in sc_ioctl (the SCIOCSTART case) that
    may leak `rcvmsg'. This patch fixes that by adding a kfree() call at the
    beginning of that case.

    Bug found by the coverity checker as #1098

    Eric Sesterhenn send me a patch to fix the leak(s) by adding 2 kfree()
    calls before the returns, I changed that into just a single call at the
    beginning.

    Signed-off-by: Jesper Juhl
    Cc: Karsten Keil
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Here's a patch for cs46xx that
    - (mostly) cleans up the cs46xx driver according to CodingStyle
    - removes a bunch of pointless casts
    - fixes a small, potential use of uninitialized variable, bug
    - reduces the size of the compiled code by 36 bytes
    - reduces the size of the source file by 1831 bytes

    I know I should probably have split this into bits, but since I only
    thought of that *after* doing all the edits, splitting it up would have
    been a royal pain. And since these are all pretty trivial changes I thought
    I'd just submit the one huge patch and hope people could live with it (if
    not, then just tell me and I'll split it).

    The bug fix that's in there may be hard to spot, so I'll point it out. It's
    the
    - int val, valsave, mapped, ret;
    + int val, valsave, ret;
    + int mapped = 0;
    bit.
    Without that change we may use `mapped' uninitialized if, in cs_ioctl, the
    first test of "if(state)" is false and the second "if(state)" test is true.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Fix possible assertion failure in journal_commit_transaction() on
    jh->b_next_transaction == NULL (when we are processing BJ_Forget list and
    buffer is not jbddirty).

    !jbddirty buffers can be placed on BJ_Forget list for example by
    journal_forget() or by __dispose_buffer() - generally such buffer means
    that it has been freed by this transaction.

    Freed buffers should not be reallocated until the transaction has committed
    (that's why we have the assertion there) but they *can* be reallocated when
    the transaction has already been committed to disk and we are just
    processing the BJ_Forget list (as soon as we remove b_committed_data from
    the bitmap bh, ext3 will be able to reallocate buffers freed by the
    committing transaction). So we have to also count with the case that the
    buffer has been reallocated and b_next_transaction has been already set.

    And one more subtle point: it can happen that we manage to reallocate the
    buffer and also mark it jbddirty. Then we also add the freed buffer to the
    checkpoint list of the committing trasaction. But that should do no harm.

    Non-jbddirty buffers should be filed to BJ_Reserved and not BJ_Metadata
    list. It can actually happen that we refile such buffers during the commit
    phase when we reallocate in the running transaction blocks deleted in
    committing transaction (and that can happen if the committing transaction
    already wrote all the data and is just cleaning up BJ_Forget list).

    Signed-off-by: Jan Kara
    Acked-by: "Stephen C. Tweedie"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • add the __might_sleep() check back to cond_resched().

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Set errorp in dup_fd, it will be used in sys_unshare also.

    Signed-off-by: Prasanna Meda
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Prasanna Meda
     
  • Default values for boolean and tristate options can only be 'y', 'm' or 'n'.
    This patch removes wrong default for IP_DCCP_ACKVEC.

    Signed-off-by: Jean-Luc Leger
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean-Luc Leger
     
  • Default values for boolean and tristate options can only be 'y', 'm' or 'n'.
    This patch removes wrong default for USB_ISP116X_HCD, USB_SL811_HCD and
    USB_SL811_CS.

    Signed-off-by: Jean-Luc Leger
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean-Luc Leger
     
  • Default values for boolean and tristate options can only be 'y', 'm' or 'n'.
    This patch removes wrong default for SYSCALL_DEBUG.

    Signed-off-by: Jean-Luc Leger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean-Luc Leger
     
  • Default values for boolean and tristate options can only be 'y', 'm' or 'n'.
    This patch removes wrong default for SCHED_SMT.

    Signed-off-by: Jean-Luc Leger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean-Luc Leger
     
  • After a lot of reading the code and thinking about how it behaves I have
    managed to figure out what the current ptrace locking rules are. The
    current code is in much better that it appears at first glance. The
    troublesome code paths are actually the code paths that violate the current
    rules.

    ptrace uses simple exclusive access as it's locking. You can only touch
    task->ptrace if the task is stopped and you are the ptracer, or if the task
    is running and are the task itself.

    Very simple, very easy to maintain. It just needs to be documented so
    people know not to touch ptrace from elsewhere.

    Currently we do have a few pieces of code that are in violation of this
    rule. Particularly the core dump code, and ptrace_attach. But so far the
    code looks fixable.

    Signed-off-by: Eric W. Biederman
    Cc: Oleg Nesterov
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • The "count" and "pt" variables are declared and modified by do_poll(), as
    well as accessed and written indirectly in the do_pollfd() subroutine.

    This patch pulls all handling of these variables into the do_poll()
    function, thereby eliminating the odd use of indirection in do_pollfd().
    This is done by pulling the "struct pollfd" traversal loop from do_pollfd()
    into its only caller do_poll(). As an added bonus, the patch saves a few
    clock cycles, and also adds comments to make the code easier to follow.

    Signed-off-by: Vadim Lobanov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vadim Lobanov
     
  • Signed-off-by: Adrian Bunk
    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • exit_aio() and exit_mmap() can sleep. But it's easy to accidentally call
    mmput() from inside locks.

    Cc: Dave Peterson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • It's wasn't referenced in Makefile since at least 2.2.8, unbuildable due to
    trivial typos and things like DATA_LATCH and arc_write_control() which
    doesn't exist.

    Adrian Bunk:
    adapted the patch to unrelated context changes

    Signed-off-by: Domen Puncer
    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Domen Puncer
     
  • "Dual MIT/GPL" is also accepted (kernel/module.c), so updated comments.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xose Vazquez Perez
     
  • We can now make posix_locks_deadlock() static.

    Signed-off-by: Adrian Bunk
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Pass the POSIX lock owner ID to the flush operation.

    This is useful for filesystems which don't want to store any locking state
    in inode->i_flock but want to handle locking/unlocking POSIX locks
    internally. FUSE is one such filesystem but I think it possible that some
    network filesystems would need this also.

    Also add a flag to indicate that a POSIX locking request was generated by
    close(), so filesystems using the above feature won't send an extra locking
    request in this case.

    Signed-off-by: Miklos Szeredi
    Cc: Trond Myklebust
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • locks_remove_posix() can use posix_lock_file() instead of doing the lock
    removal by hand. posix_lock_file() now does exacly the same.

    The comment about pids no longer applies, posix_lock_file() takes only the
    owner into account.

    Signed-off-by: Miklos Szeredi
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi