12 Feb, 2007

40 commits

  • 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
     
  • fix-rmmod-read-write-races-in-proc-entries.patch doesn't want dynamically
    allocated ->proc_fops, because it will set it to NULL at module unload time.

    Regardless of module status, switch to statically allocated ->proc_fops which
    leads to simpler code without wrappers.

    AFAICS, also fix the following bug: "sn_force_interrupt" proc entry set
    ->write for itself, but was created with 0444 permissions. Change to 0644.

    Signed-off-by: Alexey Dobriyan
    Cc: Al Viro
    Cc: "Eric W. Biederman"
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Minor number 0 (under the raw major) is reserved for the rawctl device
    file, which is used to query, set, and unset raw device bindings. However,
    the ioctl interface does not protect the user from specifying a raw device
    with minor number 0:

    $ sudo ./raw /dev/raw/raw0 /dev/VolGroup00/swap
    /dev/raw/raw0: bound to major 253, minor 2
    $ ls -l /dev/rawctl
    ls: /dev/rawctl: No such file or directory
    $ ls -l /dev/raw/raw0
    crw------- 1 root root 162, 0 Jan 12 10:51 /dev/raw/raw0
    $ sudo ./raw -qa
    Cannot open master raw device '/dev/rawctl' (No such file or directory)

    As you can see, this prevents any further raw operations from
    succeeding. The fix (from Steve Fernandez) is quite simple--do not
    allow the allocation of minor number 0.

    Signed-off-by: Jeff Moyer
    Cc: Steven Fernandez
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • gcc emits this warning:

    kernel/auditfilter.c: In function 'audit_filter_user':
    kernel/auditfilter.c:1611: warning: 'state' is used uninitialized in this function

    I tend to agree with gcc - there are a couple of plausible exit paths from
    audit_filter_user_rules() where it does not set 'state', keeping the
    variable uninitialized. For example if a filter rule has an AUDIT_POSSIBLE
    action. Initialize to 'wont audit'. Fix whitespace damage too.

    Signed-off-by: Ingo Molnar
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • In the rare case where we have skipped orphan inode processing due to a
    readonly block device, and the block device subsequently changes back to
    read-write, disallow a remount,rw transition of the filesystem when we have an
    unprocessed orphan inodes as this would corrupt the list.

    Ideally we should process the orphan inode list during the remount, but that's
    trickier, and this plugs the hole for now.

    Signed-off-by: Eric Sandeen
    Cc: "Stephen C. Tweedie"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • In the rare case where we have skipped orphan inode processing due to a
    readonly block device, and the block device subsequently changes back to
    read-write, disallow a remount,rw transition of the filesystem when we have an
    unprocessed orphan inodes as this would corrupt the list.

    Ideally we should process the orphan inode list during the remount, but that's
    trickier, and this plugs the hole for now.

    Signed-off-by: Eric Sandeen
    Cc: "Stephen C. Tweedie"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • - no longer a userspace header
    - add #include for in-kernel compilation

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

    Adrian Bunk
     
  • Add support for the CPCI-ASIO4 quad port CompactPCI UART board from
    electronic system design gmbh.

    Signed-off-by: Matthias Fuchs
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthias Fuchs
     
  • Get the Perle quad-modem PCI card (PCI-RAS4) detected by serial driver. It
    may also get the PCI-RAS8 running, but can't guarantee as I didn't had one for
    testing.

    Signed-off-by: Thomas Hoehn
    Cc: Russell King
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Hoehn
     
  • - in man and text mode output, if the function return type is empty (like it
    is for macros), don't print the return type and a following space; this
    fixes an output malalignment;

    - in the function short description, strip leading, trailing, and multiple
    embedded spaces (to one space); this makes function name/description output
    spacing consistent;

    - fix a comment typo;

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

    Randy Dunlap
     
  • Cleanup kernel-doc notation in drivers/firmware/edd.c.

    Add edd.c to DocBook/kernel-api.tmpl.

    Signed-off-by: Randy Dunlap
    Acked-by: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • This is an "RTC framework" driver for the "CMOS" RTCs which are standard on
    PCs and some other platforms. That's MC146818 compatible silicon.
    Advantages of this vs. drivers/char/rtc.c (use one _or_ the other, only
    one will be able to claim the RTC irq) include:

    - This leverages both the new RTC framework and the driver model; both
    PNPACPI and platform device modes are supported. (A separate patch
    creates a platform device on PCs where PNPACPI isn't configured.)

    - It supports common extensions like longer alarms. (A separate patch
    exports that information from ACPI through platform_data.)

    - Likewise, system wakeup events use "real driver model support", with
    policy control via sysfs "wakeup" attributes and and using normal rtc
    ioctls to manage wakeup. (Patch in the works. The ACPI hooks are
    known; /proc/acpi/alarm can vanish. Making it work with EFI will
    be a minor challenge to someone with e.g. a MiniMac.)

    It's not yet been tested on non-x86 systems, without ACPI, or with HPET.
    And the RTC framework will surely have teething pains on "mainstream"
    PC-based systems (though must embedded Linux systems use it heavily), not
    limited to sorting out the "/dev/rtc0" issue (udev easily tweaked). Also,
    the ALSA rtctimer code doesn't use the new RTC API.

    Otherwise, this should be a no-known-regressions replacement for the old
    drivers/char/rtc.c driver, and should help the non-embedded distros (and
    the new timekeeping code) start to switch to the framework.

    Note also that any systems using "rtc-m48t86" are candidates to switch over
    to this more functional driver; the platform data is different, and the way
    bytes are read is different, but otherwise those chips should be compatible.

    [akpm@osdl.org: sparc32 fix]
    [akpm@osdl.org: sparc64 fix]
    Signed-off-by: David Brownell
    Cc: Woody Suwalski
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • I noticed that almost all architectures implemented exactly the same
    sys32_sysinfo... except parisc, where a bug was to be found in handling of
    the uptime. So let's remove a whole whack of code for fun and profit.
    Cribbed compat_sys_sysinfo from x86_64's implementation, since I figured it
    would be the best tested.

    This patch incorporates Arnd's suggestion of not using set_fs/get_fs, but
    instead extracting out the common code from sys_sysinfo.

    Cc: Christoph Hellwig
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyle McMartin
     
  • A variety of (mostly) innocuous fixes to the embedded kernel-doc content in
    source files, including:

    * make multi-line initial descriptions single line
    * denote some function names, constants and structs as such
    * change erroneous opening '/*' to '/**' in a few places
    * reword some text for clarity

    Signed-off-by: Robert P. J. Day
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Explain a couple of the most common errors in kernel-doc usage.

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

    Robert P. J. Day
     
  • Mostly so people can see the work in progress. This enhances the encode
    function which isn't currently used in the base tree but is when using some of
    the testing tty patches.

    This resolves a problem with some hardware where applications got confusing
    information from the tty ioctls. Correct but confusing.

    In some situations asking for, say, 9600 baud actually gets you 9595 baud or
    similar near-miss values. With the old code this meant that a request for
    B9600 got a return of BOTHER, 9595 which programs interpreted as a failure.

    The new code now works on the following basis

    - If you ask for specific rate via BOTHER, you get a precise return

    - If you ask for a standard Bfoo rate and the result is close you get a Bfoo
    return

    - If you ask for a standard Bfoo rate and get something way off you get a
    BOTHER/rate return

    This seems to fix up the cases I've found where this broke compatibility.

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

    Alan Cox
     
  • Allow whitespace in pointer-to-function
    [accept "(* done)", not just "(*done)"].

    Allow tabs (spaces are already allowed) between "#define" and a macro name.

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

    Randy Dunlap
     
  • Alphabetize the sysrq command keys list.

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

    Randy Dunlap
     
  • Bug: pnx8550 code creates directory but resets ->nlink to 1.

    create_proc_entry() et al will correctly set ->nlink for you.

    Signed-off-by: Alexey Dobriyan
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Jeff Dike
    Cc: Corey Minyard
    Cc: Alan Cox
    Cc: Kyle McMartin
    Cc: Martin Schwidefsky
    Cc: Greg KH
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan