23 Jun, 2006

40 commits

  • Update the sparse documentation to omit the -Wbitwise flag example (as it
    is now passed by default), and document the kernel defines to enable
    endianness checking.

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

    Bob Copeland
     
  • While writing a version of losetup, I ran into the problem that the loop
    device was returning total garbage.

    It turns out the problem was that this losetup was only issuing the
    LOOP_SET_FD ioctl and not issuing a subsequent LOOP_SET_STATUS ioctl. This
    losetup didn't have any special status to set, so it left out the call.

    The deeper cause is that loop_set_fd sets the transfer function to NULL,
    which causes no transfer to happen lo_do_transfer.

    This patch fixes the problem by setting transfer to transfer_none in
    loop_set_fd.

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

    Constantine Sapuntzakis
     
  • Sometimes partitions claim to be larger than the reported capacity of a
    disk device. This patch makes the kernel warn about those partitions.

    We still permit these patitions to be used. Quoting Andries Brouwer
    :

    Case 1: The kernel is mistaken about the size of the disk. (There are
    commands to clip a disk to a certain capacity, there are jumpers to tell a
    disk that it should report a certain capacity etc. Usually this is because
    of BIOS bugs. In bad cases the machine will crash in the BIOS and hence fail
    to boot if the disk reports full capacity.) In such cases actually accessing
    the blocks of the partition may work fine, or may work fine after running an
    unclip utility. I wrote "setmax" some years ago precisely for this reason.

    Case 2: There was a messy partition table (maybe just a rounding error) but
    the actual filesystem on the partition is contained in the physical disk.
    Now using the filesystem goes without problem.

    Case 3: Both partition and filesystem extend beyond the end of the disk. In
    forensic or debugging situations one often uses a copy of the start of a
    disk. Now access beyond the end gives an expected I/O error.

    Signed-off-by: Mike Miller
    Signed-off-by: Stephen Cameron
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Miller
     
  • Signed-off-by: Eric Sesterhenn
    Signed-off-by: Alexey Dobriyan
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Alan Cox
    Cc: James Bottomley
    Acked-by: "Salyzyn, Mark"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     
  • Split the checkpoint list of the transaction into two lists. In the first
    list we keep the buffers that need to be submitted for IO. In the second
    list are kept buffers that were already submitted and we just have to wait
    for the IO to complete. This should simplify a handling of checkpoint
    lists a bit and can eventually be also a performance gain.

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

    Jan Kara
     
  • Mark a few non-exported functions static.

    Signed-off-by: Peter Hagervall
    Cc: Paul Fulghum
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Hagervall
     
  • Correct the return type of handle_IRQ_event() (inconsistency noticed during
    Xen development), and remove redundant declarations. The return type
    adjustment required breaking out the definition of irqreturn_t into a
    separate header, in order to satisfy current include order dependencies.

    Signed-off-by: Jan Beulich

    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Russell King
    Cc: Ian Molton
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Hirokazu Takata
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: William Lee Irwin III
    Cc: "David S. Miller"
    Cc: Miles Bader
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     
  • This patch fixes a NULL dereference spotted by the Coverity checker.

    Signed-off-by: Adrian Bunk
    Cc: "H. Peter Anvin"
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Add a chapter on typedefs, copied from an email from Linus to lkml on Feb.
    3, 2006. (Subject: Re: [RFC][PATCH 1/5] Virtualization/containers:
    startup)

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

    Randy Dunlap
     
  • When CONFIG_BASE_SAMLL=1, cascade() in may enter the infinite loop.
    Because of CONFIG_BASE_SMALL=1(TVR_BITS=6 and TVN_BITS=4), the list
    base->tv5 may cascade into base->tv5. So, the kernel enters the infinite
    loop in the function cascade().

    I created a test module to verify this bug, and a patch to fix it.

    #include
    #include
    #include
    #include
    #if 0
    #include
    #else
    #define kdb_printf printk
    #endif

    #define TVN_BITS (CONFIG_BASE_SMALL ? 4 : 6)
    #define TVR_BITS (CONFIG_BASE_SMALL ? 6 : 8)
    #define TVN_SIZE (1 << TVN_BITS)
    #define TVR_SIZE (1 << TVR_BITS)
    #define TVN_MASK (TVN_SIZE - 1)
    #define TVR_MASK (TVR_SIZE - 1)

    #define TV_SIZE(N) (N*TVN_BITS + TVR_BITS)

    struct timer_list timer0;
    struct timer_list dummy_timer1;
    struct timer_list dummy_timer2;

    void dummy_timer_fun(unsigned long data) {
    }
    unsigned long j=0;
    void check_timer_base(unsigned long data)
    {
    kdb_printf("check_timer_base %08x\n",jiffies);
    mod_timer(&timer0,(jiffies & (~0xFFF)) + 0x1FFF);
    }

    int init_module(void)
    {
    init_timer(&timer0);
    timer0.data = (unsigned long)0;
    timer0.function = check_timer_base;
    mod_timer(&timer0,jiffies+1);

    init_timer(&dummy_timer1);
    dummy_timer1.data = (unsigned long)0;
    dummy_timer1.function = dummy_timer_fun;

    init_timer(&dummy_timer2);
    dummy_timer2.data = (unsigned long)0;
    dummy_timer2.function = dummy_timer_fun;

    j=jiffies;
    j&=(~((1<<<
    Cc: Matt Mackall
    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Porpoise
     
  • list_splice_init(list, head) does unneeded job if it is known that
    list_empty(head) == 1. We can use list_replace_init() instead.

    Signed-off-by: Oleg Nesterov
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • list_replace() is similar to list_replace_rcu(), but unlike
    list_replace_rcu() it

    could be used when list_empty(old) == 1

    doesn't use barriers

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

    Oleg Nesterov
     
  • Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    bjdouma
     
  • There are three different IO cards which an SGI IOC4 controller may find
    itself on. One of these variants does not bring out the IDE and serial
    signals, so we need to disable attaching the corresponding IOC4 subdrivers
    to such cards.

    Cleans up message clutter emitted during device probing.

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

    Brent Casavant
     
  • Fix one audit kernel-doc description (one parameter was missing).
    Add audit*.c interfaces to DocBook.
    Add BSD accounting interfaces to DocBook.

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

    Randy Dunlap
     
  • Remove synchronize_kernel() (deprecated 2-APR-2005 in
    http://lkml.org/lkml/2005/4/3/11) and makes the RCU API inaccessible to
    non-GPL Linux kernel modules (as was announced more than one year ago in
    http://lkml.org/lkml/2005/4/3/8). Tested on x86 and ppc64.

    Signed-off-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul E. McKenney
     
  • kernel/sys.c doesn't have anything in it relying on linux/init.h -
    remove the include.

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

    Jes Sorensen
     
  • 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