12 Feb, 2007

40 commits

  • Martin Schwidefsky wrote:
    "s390 does not even need (in|out)b(_p|). I wondered what else from
    io.h do we not need. The answer is: almost nothing. With the devres
    patch from Al and the dma-mapping patch from Heiko we can get rid of
    iomem and all associated definitions."

    So we'll just need to replace NO_IOPORT with NO_IOMEM in Kconfig and
    kill arch/s390/mm/ioremap.c.

    BTW, there's an annoying bit of junk in there - IO_SPACE_LIMIT. We
    only need it for /proc/ioports, which AFAICS shouldn't even be there
    on s390 (or uml). OTOH, removing that thing would mean a user-visible
    change - we go from "empty file in /proc" to "no such file in /proc"...

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • * Split the implementation-agnostic stuff in separate files.
    * Make sure that targets using non-default request_irq() pull
    kernel/irq/devres.o
    * Introduce new symbols (HAS_IOPORT and HAS_IOMEM) defaulting to positive;
    allow architectures to turn them off (we needed these symbols anyway for
    dependencies of quite a few drivers).
    * protect the ioport-related parts of lib/devres.o with CONFIG_HAS_IOPORT.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Fix DocBook build. Regression was introduced by
    gregkh-usb-usb-linux-usb_ch9h-becomes-linux-usb-ch9h.patch

    Tested by `make htmldocs`.

    Signed-off-by: Don Mullis
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     
  • drivers/isdn/gigaset/bas-gigaset.c: In function 'dump_urb':
    drivers/isdn/gigaset/bas-gigaset.c:258: error: 'struct urb' has no member named 'bandwidth'

    Cc: Alan Stern
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • drivers/char/amiserial.c::rs_write() contains local_irq_disable() after
    local_save_flags(). Turn it into local_irq_save().

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

    Jiri Kosina
     
  • This patch contains two fixes for RapisIO enumeration logic:

    1. Fix enumeration in configurations with multiple switches. The patch adds:

    a. Enumeration of an empty switch. Empty switch is a switch that
    does not have any endpoint devices attached to it (except host device
    or previous switch in a chain). New code assigns a phony destination
    ID associated with the switch and sets up corresponding routes.

    b. Adds a second pass to the enumeration to setup routes to
    devices discovered after switch was scanned.

    2. Fix enumeration failure when riohdid parameter has non-zero value.
    Current version fails to setup response path to the host when it has
    destination ID other that 0.

    Signed-off-by: Alexandre Bounine
    Acked-by: Matt Porter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • release_mem contains two copies of exactly the same code. Refactor these
    into a new helper, release_tty. The only change in behaviour is that the
    driver reference count is now decremented after the master tty has been
    freed instead of before.

    [penberg@cs.helsinki.fi: fix use-after-free in release_tty.]
    Cc: Alan Cox
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • They are fat: 4x8 bytes in task_struct.
    They are uncoditionally updated in every fork, read, write and sendfile.
    They are used only if you have some "extended acct fields feature".

    And please, please, please, read(2) knows about bytes, not characters,
    why it is called "rchar"?

    Signed-off-by: Alexey Dobriyan
    Cc: Jay Lan
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Since they depends on TASKSTATS, it would be nice to move them closer to
    another options depending on TASKSTATS.

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

    Alexey Dobriyan
     
  • If you try to read things like /proc/sys/kernel/osrelease with single-byte
    reads, you get just one byte and then EOF. This is because _proc_do_string()
    assumes that the caller is read()ing into a buffer which is large enough to
    fit the whole string in a single hit.

    Fix.

    Cc: "Eric W. Biederman"
    Cc: Michael Tokarev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • SMP systems without premption and spinlock debugging enabled use unlock
    macros that don't tell sparse that the lock is being released. Add sparse
    annotations in this case.

    Signed-off-by: Pavel Roskin
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Roskin
     
  • Change a hard-coded constant 0 to the symbolic equivalent NOTIFY_DONE in
    the ratelimit_handler() CPU notifier handler function.

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

    Paul E. McKenney
     
  • Catch illegally nested kmap_atomic()s even if the page that is mapped by
    the 'inner' instance is from lowmem.

    This avoids spuriously zapped kmap-atomic ptes and turns hard to find
    crashes into clear asserts at the bug site.

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

    Ingo Molnar
     
  • jbd function called instead of fs specific one.

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

    Dmitriy Monakhov
     
  • Replace the apparent typo CONFIG_LOCKDEP_DEBUG with the correct
    CONFIG_DEBUG_LOCKDEP.

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

    Robert P. J. Day
     
  • the session and pgrp fields in mxser_struct are unused.

    Signed-off-by: Cedric Le Goater
    Cc: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cedric Le Goater
     
  • Converts 'boolean' to 'bool' and removes the 'boolean' typedef.

    Signed-off-by: Richard Knutsson
    Cc: Jens Axboe
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • Fix typo when describing RTC_WKALM. Add some helpful pointers to people
    developing their own RTC driver. Change a bunch of the error messages in the
    test program to be a bit more helpful.

    Signed-off-by: Mike Frysinger
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • The order of locking between lockdep_off/on() and local_irq_save/restore() in
    vprintk() should be changed.

    * In kernel/printk.c :

    vprintk() does :

    preempt_disable()
    local_irq_save()
    lockdep_off()
    spin_lock(&logbuf_lock)
    spin_unlock(&logbuf_lock)
    if(!down_trylock(&console_sem))
    up(&console_sem)
    lockdep_on()
    local_irq_restore()
    preempt_enable()

    The goals here is to make sure we do not call printk() recursively from
    kernel/lockdep.c:__lock_acquire() (called from spin_* and down/up) nor from
    kernel/lockdep.c:trace_hardirqs_on/off() (called from local_irq_restore/save).
    It can then potentially call printk() through mark_held_locks/mark_lock.

    It correctly protects against the spin_lock call and the up/down call, but it
    does not protect against local_irq_restore. It could cause infinite recursive
    printk/trace_hardirqs_on() calls when printk() is called from the
    mark_lock() error handing path.

    We should change the locking so it becomes correct :

    preempt_disable()
    lockdep_off()
    local_irq_save()
    spin_lock(&logbuf_lock)
    spin_unlock(&logbuf_lock)
    if(!down_trylock(&console_sem))
    up(&console_sem)
    local_irq_restore()
    lockdep_on()
    preempt_enable()

    Signed-off-by: Mathieu Desnoyers
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Remove the unused kernel config option PARIDE_PARPORT.

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

    Robert P. J. Day
     
  • Remove the kernel config option ZISOFS_FS, since it appears that the actual
    option is simply ZISOFS.

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

    Robert P. J. Day
     
  • Remove the few references to the obsolete kernel config option
    DEBUG_RWSEMS.

    Signed-off-by: Robert P. J. Day
    Cc: Ingo Molnar
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Remove the dead kernel config option AEDSP16_MPU401.

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

    Robert P. J. Day
     
  • Replace a small number of expressions with a call to the "container_of()"
    macro.

    Signed-off-by: Robert P. J. Day
    Acked-by: Paul Mackerras
    Cc: "David S. Miller"
    Cc: Martin Schwidefsky
    Cc: Stephen Smalley
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • - #ifdef guard this header for multiple inclusion
    - adjust the #include's to what is actually required by this header
    - remove an unneeded #ifdef
    - #endif comments

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

    Adrian Bunk
     
  • - reduce the userspace visible part
    - fix the in-kernel compilation

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

    Adrian Bunk
     
  • Remove the last (and commented out) invocation of the obsolete
    smp_commence() call.

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

    Robert P. J. Day
     
  • unlock_buffer(), like unlock_page(), must not clear the lock without
    ensuring that the critical section is closed.

    Mingming later sent the same patch, saying:

    We are running SDET benchmark and saw double free issue for ext3 extended
    attributes block, which complains the same xattr block already being freed (in
    ext3_xattr_release_block()). The problem could also been triggered by
    multiple threads loop untar/rm a kernel tree.

    The race is caused by missing a memory barrier at unlock_buffer() before the
    lock bit being cleared, resulting in possible concurrent h_refcounter update.
    That causes a reference counter leak, then later leads to the double free that
    we have seen.

    Inside unlock_buffer(), there is a memory barrier is placed *after* the lock
    bit is being cleared, however, there is no memory barrier *before* the bit is
    cleared. On some arch the h_refcount update instruction and the clear bit
    instruction could be reordered, thus leave the critical section re-entered.

    The race is like this: For example, if the h_refcount is initialized as 1,

    cpu 0: cpu1
    -------------------------------------- -----------------------------------
    lock_buffer() /* test_and_set_bit */
    clear_buffer_locked(bh);
    lock_buffer() /* test_and_set_bit */
    h_refcount = h_refcount+1; /* = 2*/ h_refcount = h_refcount + 1; /*= 2 */
    clear_buffer_locked(bh);
    .... ......

    We lost a h_refcount here. We need a memory barrier before the buffer head lock
    bit being cleared to force the order of the two writes. Please apply.

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

    Nick Piggin
     
  • Documentation for lib/rbtree.c.

    Signed-off-by: Rob Landley
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rob Landley
     
  • Extend the set of "__attribute__" shortcut macros, and remove identical
    (and now superfluous) definitions from a couple of source files.

    based on a page at robert love's blog:

    http://rlove.org/log/2005102601

    extend the set of shortcut macros defined in compiler-gcc.h with the
    following:

    #define __packed __attribute__((packed))
    #define __weak __attribute__((weak))
    #define __naked __attribute__((naked))
    #define __noreturn __attribute__((noreturn))
    #define __pure __attribute__((pure))
    #define __aligned(x) __attribute__((aligned(x)))
    #define __printf(a,b) __attribute__((format(printf,a,b)))

    Once these are in place, it's up to subsystem maintainers to decide if they
    want to take advantage of them. there is already a strong precedent for
    using shortcuts like this in the source tree.

    The ones that might give people pause are "__aligned" and "__printf", but
    shortcuts for both of those are already in use, and in some ways very
    confusingly. note the two very different definitions for a macro named
    "ALIGNED":

    drivers/net/sgiseeq.c:#define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf))
    drivers/scsi/ultrastor.c:#define ALIGNED(x) __attribute__((aligned(x)))

    also:

    include/acpi/platform/acgcc.h:
    #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))

    Given the precedent, then, it seems logical to at least standardize on a
    consistent set of these macros.

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

    Robert P. J. Day
     
  • Remove hack with printing space to wake up klogd. Use explicit
    wake_up_klogd().

    See earlier discussion
    http://groups.google.com/group/fa.linux.kernel/browse_frm/thread/75f496668409f58d/1a8f28983a51e1ff?lnk=st&q=wake_up_klogd+group%3Afa.linux.kernel&rnum=2#1a8f28983a51e1ff

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

    Kirill Korotaev
     
  • Part of long forgotten patch
    http://groups.google.com/group/fa.linux.kernel/msg/e98e941ce1cf29f6?dmode=source
    Since then, m32r grabbed two copies.

    Leave s390 copy because of important absence of CONFIG_VT, but remove
    references to non-existent timerlist_lock. ia64 also loses timerlist_lock.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Martin Schwidefsky
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill Korotaev
     
  • Remove the lone, remaining reference to the long-deceased
    rwlock_is_locked() macro.

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

    Robert P. J. Day
     
  • - Naming is confusing, ext3_inc_count manipulates i_nlink not i_count
    - handle argument passed in is not used
    - ext3 and ext4 already call inc_nlink and dec_nlink directly in other places

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

    Eric Sandeen
     
  • Return -ENOENT from ext[34]_link if we've raced with unlink and i_nlink is
    0. Doing otherwise has the potential to corrupt the orphan inode list,
    because we'd wind up with an inode with a non-zero link count on the list,
    and it will never get properly cleaned up & removed from the orphan list
    before it is freed.

    [akpm@osdl.org: build fix]
    Signed-off-by: Eric Sandeen
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • Signed-off-by: Alexey Dobriyan
    Cc: Dmitry Torokhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Fix insecure default behaviour reported by Tigran Aivazian: if an ext2 or
    ext3 or ext4 filesystem is tuned to mount with "acl", but mounted by a
    kernel built without ACL support, then umask was ignored when creating
    inodes - though root or user has umask 022, touch creates files as 0666,
    and mkdir creates directories as 0777.

    This appears to have worked right until 2.6.11, when a fix to the default
    mode on symlinks (always 0777) assumed VFS applies umask: which it does,
    unless the mount is marked for ACLs; but ext[234] set MS_POSIXACL in
    s_flags according to s_mount_opt set according to def_mount_opts.

    We could revert to the 2.6.10 ext[234]_init_acl (adding an S_ISLNK test);
    but other filesystems only set MS_POSIXACL when ACLs are configured. We
    could fix this at another level; but it seems most robust to avoid setting
    the s_mount_opt flag in the first place (at the expense of more ifdefs).

    Likewise don't set the XATTR_USER flag when built without XATTR support.

    Signed-off-by: Hugh Dickins
    Cc: Tigran Aivazian
    Cc:
    Cc: Andreas Gruenbacher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Compile-tested.

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

    Alexey Dobriyan