09 May, 2007

40 commits

  • Signed-off-by: Adrian Bunk
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • - ext3_dx_find_entry() exit with out setting proper error pointer

    - do_split() exit with out setting proper error pointer
    it is realy painful because many callers contain folowing code:

    de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
    if (!(de))
    return retval;
    <<< WOW retval wasn't changed by do_split(), so caller failed
    <<< but return SUCCESS :)

    - Rearrange do_split() error path. Current error path is realy ugly, all
    this up and down jump stuff doesn't make code easy to understand.

    [dmonakhov@sw.ru: fix annoying fake error messages]
    Signed-off-by: Monakhov Dmitriy
    Cc: Andreas Dilger
    Cc: Theodore Ts'o
    Signed-off-by: Monakhov Dmitriy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitriy Monakhov
     
  • The first thing done by timespec_trunc() is :

    if (gran
    imul $0x3e8,%eax,%eax
    cmp %ebx,%eax

    This patch reorders kernel/time.c a bit so that jiffies_to_usecs() is defined
    before timespec_trunc() so that compiler now generates :

    cmp $0x3d0900,%edx (HZ=250 on my machine)

    This gives a better code (timespec_trunc() becoming a leaf function), and
    shorter kernel size as well.

    Signed-off-by: Eric Dumazet
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: john stultz
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     
  • PNP now initializes device dma masks, which prevents oopses when generic
    dma calls are made using pnp device nodes.

    This assumes PNP only uses ISA DMA, with 24 bit addresses; and that it's
    safe to init those masks for all devices (rather than finding out which
    devices have been assigned DMA channels, and handling only those).

    Signed-off-by: David Brownell
    Cc: Adam Belay
    Cc: Jaroslav Kysela
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • The corresponding rcu_torture_cleanup cannot get marked as __exit, because
    rcu_torture_init uses it to clean up if init fails.

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

    Josh Triplett
     
  • sys_clone() and sys_unshare() both makes copies of nsproxy and its associated
    namespaces. But they have different code paths.

    This patch merges all the nsproxy and its associated namespace copy/clone
    handling (as much as possible). Posted on container list earlier for
    feedback.

    - Create a new nsproxy and its associated namespaces and pass it back to
    caller to attach it to right process.

    - Changed all copy_*_ns() routines to return a new copy of namespace
    instead of attaching it to task->nsproxy.

    - Moved the CAP_SYS_ADMIN checks out of copy_*_ns() routines.

    - Removed unnessary !ns checks from copy_*_ns() and added BUG_ON()
    just incase.

    - Get rid of all individual unshare_*_ns() routines and make use of
    copy_*_ns() instead.

    [akpm@osdl.org: cleanups, warning fix]
    [clg@fr.ibm.com: remove dup_namespaces() declaration]
    [serue@us.ibm.com: fix CONFIG_IPC_NS=n, clone(CLONE_NEWIPC) retval]
    [akpm@linux-foundation.org: fix build with CONFIG_SYSVIPC=n]
    Signed-off-by: Badari Pulavarty
    Signed-off-by: Serge Hallyn
    Cc: Cedric Le Goater
    Cc: "Eric W. Biederman"
    Cc:
    Signed-off-by: Cedric Le Goater
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Badari Pulavarty
     
  • Petr Tesarik discovered a problem in remove_arg_zero(). He writes:

    When a script is loaded, load_script() replaces argv[0] with the
    name of the interpreter and the filename passed to the exec syscall.
    However, there is no guarantee that the length of the interpreter
    name plus the length of the filename is greater than the length of
    the original argv[0]. If the difference happens to cross a page boundary,
    setup_arg_pages() will call put_dirty_page() [aka install_arg_page()]
    with an address outside the VMA.

    Therefore, remove_arg_zero() must free all pages which would be unused
    after the argument is removed.

    So, rewrite the remove_arg_zero function without gotos, with a few comments,
    and with the commonly used explicit index/offset. This fixes the problem
    and makes it easier to understand as well.

    [a.p.zijlstra@chello.nl: add comment]
    Signed-off-by: Nick Piggin
    Cc: Petr Tesarik
    Signed-off-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • The value of shmmax may be larger than will fit in the struct used by
    the 32bit compat version of sys_shmctl. This change mirrors what the
    normal sys_shmctl does when called with the old IPC_INFO command.

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

    Guy Streeter
     
  • Replace call_smp_function with stop_machine_run in the Intel RNG driver.

    CPU A has done read_lock(&lock)
    CPU B has done write_lock_irq(&lock) and is waiting for A to release the lock.

    A third CPU calls call_smp_function and issues the IPI. CPU A takes CPU
    C's IPI. CPU B is waiting with interrupts disabled and does not see the
    IPI. CPU C is stuck waiting for CPU B to respond to the IPI.

    Deadlock.

    The solution is to use stop_machine_run instead of call_smp_function
    (call_smp_function should not be called in situations where the CPUs may be
    suspended).

    [haruo.tomita@toshiba.co.jp: fix a typo in mod_init()]
    [haruo.tomita@toshiba.co.jp: fix memory leak]
    Signed-off-by: Prarit Bhargava
    Cc: Jan Beulich
    Cc: "Tomita, Haruo"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Prarit Bhargava
     
  • This could help to find buggy drivers where request_irq return value wasn't
    checked. There's just no reason to ignore errors which can and do occur.
    Anyone who got warning during compilation have to realise what it is't
    realy safe code.

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

    Monakhov Dmitriy
     
  • Remove the Kconfig selection of semaphore debugging from the ALPHA and FRV
    Kconfig files, and centralize it in lib/Kconfig.debug.

    There doesn't seem to be much point in letting individual architectures
    independently define the same Kconfig option when it can just as easily be
    put in a single Kconfig file and made dependent on a subset of
    architectures. that way, at least the option shows up in the same relative
    location in the menu each time.

    Signed-off-by: Robert P. J. Day
    Cc: David Howells
    Cc: Ivan Kokshaysky
    Cc: Richard Henderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Correct the misspelling of the preprocessor check of a Kconfig option to refer
    to CONFIG_REISERFS_PROC_INFO and not just the incorrect REISERFS_PROC_INFO.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • This converts an open-coded krealloc() to use the shiny new API.

    Signed-off-by: Pekka Enberg
    Acked-by: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • This makes in-core superblock fit into one cacheline here.

    Before:
    struct dentry * xattr_root; /* 124 4 */
    /* --- cacheline 1 boundary (128 bytes) --- */
    struct rw_semaphore xattr_dir_sem; /* 128 12 */
    int j_errno; /* 140 4 */
    }; /* size: 144, cachelines: 2 */
    /* sum members: 142, holes: 1, sum holes: 2 */
    /* last cacheline: 16 bytes */

    After:
    int j_errno; /* 124 4 */
    /* --- cacheline 1 boundary (128 bytes) --- */
    }; /* size: 128, cachelines: 1 */
    /* sum members: 126, holes: 1, sum holes: 2 */

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

    Alexey Dobriyan
     
  • This driver provides support for the Apple System Management Controller, which
    provides an accelerometer (Apple Sudden Motion Sensor), light sensors,
    temperature sensors, keyboard backlight control and fan control. Only
    Intel-based Apple's computers are supported (MacBook Pro, MacBook, MacMini).

    [bunk@stusta.de: make drivers/hwmon/applesmc.c:backlight_work stati]
    [khali@linux-fr.org: fix temperature attribute file names]
    Signed-off-by: Nicolas Boichat
    Cc: Jean Delvare
    Cc: Dmitry Torokhov
    Signed-off-by: Jean Delvare
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Boichat
     
  • It is sometimes useful to compile individual drivers with optimization
    disabled for easier debugging. Currently drivers which use htonl() and
    similar functions don't compile with -O0. This patch fixes it. It also
    removes obsolete and misleading comments. This header is not for
    userspace, so we don't have to care about strange programs these comments
    mention.

    (akpm: -O0 probably isn't a good idea, but this code looks pretty crufty and
    unuseful)

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

    Michal Schmidt
     
  • Add a proper protype for prepare_namespace() in include/linux/init.h.

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

    Adrian Bunk
     
  • kbuild spits outs following warning on a
    defconfig x86_64 build:
    WARNING: swiotlb.o - Section mismatch: reference to .init.text:swiotlb_init from __ksymtab between '__ksymtab_swiotlb_init' (at offset 0xa0) and '__ksymtab_swiotlb_free_coherent'

    This warning happens because the function swiotlb_init is marked __init and
    EXPORT_SYMBOL(). A 'git grep swiotlb_init' showed no users in drivers/ so
    remove the EXPORT_SYMBOL.

    Signed-off-by: Sam Ravnborg
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Whitespace cleanup only: convert some series of spaces to tabs.

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

    Randy Dunlap
     
  • sb_read may return NULL, let's explicitly check it. If so free new bitmap
    blocks array, after this we may safely exit as it done above during bitmap
    allocation.

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

    Dmitriy Monakhov
     
  • sb_read may return NULL, so let's explicitly check it.

    Signed-off-by: Dmitriy Monakhov
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitriy Monakhov
     
  • Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2

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

    Vignesh Babu BM
     
  • Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2

    Signed-off-by: vignesh babu
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vignesh Babu BM
     
  • Replacing (n & (n-1)) in the context of power of 2 checks with
    is_power_of_2

    Signed-off-by: vignesh babu
    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vignesh Babu BM
     
  • - make needlessly global code static
    - remove the unused EXPORT_SYMBOL's

    Signed-off-by: Adrian Bunk
    Acked-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • The tty driver write method is different to the usual fops device write
    methods as the buffer is already in kernel space. Clarify the docs since
    someone writing a driver made that mistake.

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

    Alan
     
  • Currently, devpts doesn't generate an fsnotify event upon pts creation
    because the regular vfs paths aren't involved. Deallocation, on the other
    hand, correctly generates a nameremove event thanks to the d_delete()
    invocation in devpts_pty_kill().

    This patch adds the missing fsnotify_create() trigger in devpts_pty_new().

    Signed-off-by: Florin Malita
    Acked-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florin Malita
     
  • Add SEEK_MAX and use it to validate lseek arguments from userspace.

    Signed-off-by: Chris Snook
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Snook
     
  • Convert magic numbers to SEEK_* values from fs.h

    Signed-off-by: Chris Snook
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Snook
     
  • Add a paragraph in Documentation/SubmittingDrivers requesting that the
    basic PM support be provided by new device drivers.

    Add two new documents in Documentation/power/ giving general instructions
    on debugging the suspend/resume functionality and testing the suspend and
    resume support in device drivers.

    Signed-off-by: Rafael J. Wysocki
    Cc: Pavel Machek
    Cc: David Brownell
    Cc: Nigel Cunningham
    Cc: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • Constant folding does not work for the swabXX() byte swapping functions,
    and the C versions optimize poorly.

    Attempting to initialize a global variable to swab16(0x1234) or put
    something like "case swab32(42):" in a switch statement will not compile.
    It can work, swab.h just isn't doing it correctly. This patch fixes that.

    Contrary to the comment in asm-i386/byteorder.h, gcc does not recognize the
    "C" version of swab16 and turn it into efficient code. gcc can do this,
    just not with the current code. The simple function:

    u16 foo(u16 x) { return swab16(x); }

    Would compile to:
    movzwl %ax, %eax
    movl %eax, %edx
    shrl $8, %eax
    sall $8, %edx
    orl %eax, %edx

    With this patch, it will compile to:
    rolw $8, %ax

    I also attempted to document the maze different macros/inline functions
    that are used to create the final product.

    Signed-off-by: Trent Piepho
    Cc: Francois-Rene Rideau
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Trent Piepho
     
  • Don't use hardcoded 99 value, use MAX_RT_PRIO.

    Signed-off-by: Oleg Nesterov
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Except for BUG_ON() checks, we should not use EXIT_XXXX defines outside of
    exit/wait paths.

    Signed-off-by: Oleg Nesterov
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Cc: Ingo Molnar
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Add pci_remove handling to the driver, so it will clean up if
    the device is hot-removed.

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

    Corey Minyard
     
  • Convert over to the new NMI handling for getting IPMI watchdog timeouts via an
    NMI. This add config options to know if there is the ability to receive NMIs
    and if it has an NMI post processing call. Then it modifies the IPMI watchdog
    to take advantage of this so that it can know if an NMI comes in.

    It also adds testing that the IPMI NMI watchdog works.

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

    Corey Minyard
     
  • The IPMI driver used enable_irq and disable_irq when it got into situations
    where it couldn't allocate memory; it did this to avoid having the interrupt
    just lock the machine when it couldn't get memory to perform the transaction
    to disable the interrupt.

    This patch modifies the driver to not use disable_irq and enable_irq. It
    instead sends the messages to the BMC to perform this operation. It also
    makes sure interrupts are cleanly disabled when the interface is shut down and
    cleans up some shutdown things that are no longer necessary.

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

    Corey Minyard
     
  • Add support for of_platform_driver to the ipmi_si module. When loading the
    module, the driver will be registered to of_platform. The driver will be
    probed for all devices with the type ipmi. It's supporting devices with
    compatible settings ipmi-kcs, ipmi-smic and ipmi-bt. Only ipmi-kcs could be
    tested.

    Signed-off-by: Christian Krafft
    Acked-by: Heiko J Schick
    Signed-off-by: Corey Minyard
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Corey Minyard
     
  • Teach the dentry slab shrinker to aggressively shrink parent dentries when
    shrinking the dentry cache.

    This is done to attempt to improve the situation where the dentry slab cache
    gets a lot of internal fragmentation due to pages containing directory
    dentries. It is expected that this change will cause some of those dentries
    to be reaped earlier, and with less scanning.

    Needs careful testing.

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

    Andrew Morton
     
  • The time shrink_dcache_parent() takes, grows quadratically with the depth
    of the tree under 'parent'. This starts to get noticable at about 10,000.

    These kinds of depths don't occur normally, and filesystems which invoke
    shrink_dcache_parent() via d_invalidate() seem to have other depth
    dependent timings, so it's not even easy to expose this problem.

    However with FUSE it's easy to create a deep tree and d_invalidate()
    will also get called. This can make a syscall hang for a very long
    time.

    This is the original discovery of the problem by Russ Cox:

    http://article.gmane.org/gmane.comp.file-systems.fuse.devel/3826

    The following patch fixes the quadratic behavior, by optionally allowing
    prune_dcache() to prune ancestors of a dentry in one go, instead of doing
    it one at a time.

    Common code in dput() and prune_one_dentry() is extracted into a new helper
    function d_kill().

    shrink_dcache_parent() as well as shrink_dcache_sb() are converted to use
    the ancestry-pruner option. Only for shrink_dcache_memory() is this
    behavior not desirable, so it keeps using the old algorithm.

    Signed-off-by: Miklos Szeredi
    Cc: Al Viro
    Cc: Maneesh Soni
    Acked-by: "Paul E. McKenney"
    Cc: Dipankar Sarma
    Cc: Neil Brown
    Cc: Trond Myklebust
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This past week I was playing around with that pahole tool
    (http://oops.ghostprotocols.net:81/acme/dwarves/) and looking at the size
    of various struct in the kernel. I was surprised by the size of the
    task_struct on x86_64, approaching 4K. I looked through the fields in
    task_struct and found that a number of them were declared as "unsigned
    long" rather than "unsigned int" despite them appearing okay as 32-bit
    sized fields. On x86_64 "unsigned long" ends up being 8 bytes in size and
    forces 8 byte alignment. Is there a reason there a reason they are
    "unsigned long"?

    The patch below drops the size of the struct from 3808 bytes (60 64-byte
    cachelines) to 3760 bytes (59 64-byte cachelines). A couple other fields
    in the task struct take a signficant amount of space:

    struct thread_struct thread; 688
    struct held_lock held_locks[30]; 1680

    CONFIG_LOCKDEP is turned on in the .config

    [akpm@linux-foundation.org: fix printk warnings]
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    William Cohen