09 May, 2007

40 commits

  • Currently the size of the per-cpu region reserved to save crash notes is
    set by the per-architecture value MAX_NOTE_BYTES. Which in turn is
    currently set to 1024 on all supported architectures.

    While testing ia64 I recently discovered that this value is in fact too
    small. The particular setup I was using actually needs 1172 bytes. This
    lead to very tedious failure mode where the tail of one elf note would
    overwrite the head of another if they ended up being alocated sequentially
    by kmalloc, which was often the case.

    It seems to me that a far better approach is to caclculate the size that
    the area needs to be. This patch does just that.

    If a simpler stop-gap patch for ia64 to be squeezed into 2.6.21(.X) is
    needed then this should be as easy as making MAX_NOTE_BYTES larger in
    arch/asm-ia64/kexec.h. Perhaps 2048 would be a good choice. However, I
    think that the approach in this patch is a much more robust idea.

    Acked-by: Vivek Goyal
    Signed-off-by: Simon Horman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Simon Horman
     
  • Remove artificial maximum 256 loop device that can be created due to a
    legacy device number limit. Searching through lkml archive, there are
    several instances where users complained about the artificial limit that
    the loop driver impose. There is no reason to have such limit.

    This patch rid the limit entirely and make loop device and associated block
    queue instantiation on demand. With on-demand instantiation, it also gives
    the benefit of not wasting memory if these devices are not in use (compare
    to current implementation that always create 8 loop devices), a net
    improvement in both areas. This version is both tested with creation of
    large number of loop devices and is compatible with existing losetup/mount
    user land tools.

    There are a number of people who worked on this and provided valuable
    suggestions, in no particular order, by:

    Jens Axboe
    Jan Engelhardt
    Christoph Hellwig
    Thomas M

    Signed-off-by: Ken Chen
    Cc: Jan Engelhardt
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ken Chen
     
  • Instead of having /dev/port support dependent in multiple places on a
    string of preprocessor symbols, define a new configuration directive for
    it. This ensures that all four places remain consistent with each other.

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

    Russell King
     
  • The 82875 EDAC driver enables an otherwise-hidden PCI device, but doesn't
    register it as a PCI device properly. Therefore, the device list in
    /proc/bus/pci/devices is different than the tree in /sys/bus/pci. This
    usually manifests as the X server failing to start, since it expects the
    two lists to be consistent.

    Signed-off-by: Adam Jackson
    Cc: Henrique de Moraes Holschuh
    Cc: Greg KH
    Cc: Alan Cox
    Cc: Doug Thompson
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John Feeney
     
  • Remove includes of where it is not used/needed.
    Suggested by Al Viro.

    Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
    sparc64, and arm (all 59 defconfigs).

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

    Randy Dunlap
     
  • Add touch_all_softlockup_watchdogs() to allow the softlockup watchdog
    timers on all cpus to be updated. This is used to prevent sysrq-t from
    generating a spurious watchdog message when generating lots of output.

    Softlockup watchdogs use sched_clock() as its timebase, which is inherently
    per-cpu (at least, when it is measuring unstolen time). Because of this,
    it isn't possible for one CPU to directly update the other CPU's timers,
    but it is possible to tell the other CPUs to do update themselves
    appropriately.

    Signed-off-by: Jeremy Fitzhardinge
    Acked-by: Chris Lalancette
    Signed-off-by: Prarit Bhargava
    Cc: Rick Lindsley
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     
  • The softlockup watchdog is currently a nuisance in a virtual machine, since
    the whole system could have the CPU stolen from it for a long period of
    time. While it would be unlikely for a guest domain to be denied timer
    interrupts for over 10s, it could happen and any softlockup message would
    be completely spurious.

    Earlier I proposed that sched_clock() return time in unstolen nanoseconds,
    which is how Xen and VMI currently implement it. If the softlockup
    watchdog uses sched_clock() to measure time, it would automatically ignore
    stolen time, and therefore only report when the guest itself locked up.
    When running native, sched_clock() returns real-time nanoseconds, so the
    behaviour would be unchanged.

    Note that sched_clock() used this way is inherently per-cpu, so this patch
    makes sure that the per-processor watchdog thread initialized its own
    timestamp.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: john stultz
    Cc: Zachary Amsden
    Cc: James Morris
    Cc: Dan Hecht
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Prarit Bhargava
    Cc: Chris Lalancette
    Cc: Rick Lindsley
    Cc: Eric Dumazet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     
  • Move the timekeeping code out of kernel/timer.c and into
    kernel/time/timekeeping.c. I made no cleanups or other changes in transit.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: John Stultz
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    john stultz
     
  • struct clocksource is a critical data structure.

    Most of its fields are read only, some of them are heavily modified at each
    timer interrupt.

    It makes sense to separate those fields and make sure they all share one
    cache line, or at least the minimum for machines with small cache lines.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Eric Dumazet
    Acked-by: John Stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     
  • An irqaction structure won't be added to an IRQ descriptor irqaction list if
    it doesn't agree with other irqactions on the IRQF_PERCPU flag. Don't check
    for this flag to change IRQ descriptor `status' for every irqaction added to
    the list, Doing the check only for the first irqaction added is enough.

    Signed-off-by: Ahmed S. Darwish
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ahmed S. Darwish
     
  • sysdev.h uses THIS_MODULE so should include .

    [akpm@linux-foundation.org: couple of fixes]
    Signed-off-by: Ralf Baechle
    Cc: Andi Kleen
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • Add a new deferrable delayed work init. This can be used to schedule work
    that are 'unimportant' when CPU is idle and can be called later, when CPU
    eventually comes out of idle.

    Use this init in cpufreq ondemand governor.

    Signed-off-by: Venkatesh Pallipadi
    Cc: Dave Jones
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Venki Pallipadi
     
  • Introduce a new flag for timers - deferrable: Timers that work normally
    when system is busy. But, will not cause CPU to come out of idle (just to
    service this timer), when CPU is idle. Instead, this timer will be
    serviced when CPU eventually wakes up with a subsequent non-deferrable
    timer.

    The main advantage of this is to avoid unnecessary timer interrupts when
    CPU is idle. If the routine currently called by a timer can wait until
    next event without any issues, this new timer can be used to setup timer
    event for that routine. This, with dynticks, allows CPUs to be lazy,
    allowing them to stay in idle for extended period of time by reducing
    unnecesary wakeup and thereby reducing the power consumption.

    This patch:

    Builds this new timer on top of existing timer infrastructure. It uses
    last bit in 'base' pointer of timer_list structure to store this deferrable
    timer flag. __next_timer_interrupt() function skips over these deferrable
    timers when CPU looks for next timer event for which it has to wake up.

    This is exported by a new interface init_timer_deferrable() that can be
    called in place of regular init_timer().

    [akpm@linux-foundation.org: Privatise a #define]
    Signed-off-by: Venkatesh Pallipadi
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Oleg Nesterov
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Venki Pallipadi
     
  • Update some of the layered parport_driver code to use parport->dev:

    - i2c-parport (parent of i2c_adapter)
    - spi_butterfly (parent of spi_master, allowing cruft removal)
    - lp (creating class_device)
    - ppdev (parent of parportN device)
    - tipar (creating class_device)

    There are still drivers that should be updated, like some of the input
    drivers; but they won't be any worse off than they are today.

    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Give legacy parallel ports a platform device in the device tree.

    This is a quick and dirty implementation; it doesn't actually convert the
    legacy parport code to the device driver model (by splitting out probing from
    device creation). But at least parallel port device drivers will finally have
    a device to work with.

    Signed-off-by: Jean Delvare
    Signed-off-by: David Brownell
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Currently a parport_driver can't get a handle on the device node for the
    underlying parport (PNPACPI, PCI, etc). That prevents correct placement of
    sysfs child nodes, which can affect things like power management.

    This patch adds a field to "struct parport" pointing to that device node, and
    updates non-legacy port drivers to initialize that device pointer. That field
    replaces the analagous PCI-only support in parport_pc.

    [akpm@linux-foundation.org: fix powerpc build]
    Signed-off-by: David Brownell
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • setup_irq() releases a desc->lock before calling register_handler_proc(), so
    the iteration over the IRQ action list is not protected.

    (akpm: the check itself is still racy, but at least it probably won't oops
    now).

    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Adamushko
     
  • Delete the unused header file include/linux/awe_voice.h, as well as
    its corresponding Kbuild entry.

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

    Robert P. J. Day
     
  • Currently cpuset_exit() changes the exiting task's ->cpuset pointer w/o
    taking task_lock(). This can lead to ugly races between attach_task and
    cpuset_exit. Details of the races are described at
    http://lkml.org/lkml/2007/3/24/132.

    Patch below closes those races.

    Signed-off-by: Srivatsa Vaddagiri
    Cc: Paul Jackson
    Cc: Balbir Singh
    Cc: Paul Menage
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Srivatsa Vaddagiri
     
  • remove_inode_dquot_ref() can now become static.

    Signed-off-by: Adrian Bunk
    Acked-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • I was playing with some code that sometimes got a string where a %n
    match should have been done where the input string ended, for example
    like this:

    sscanf("abc123", "abc%d%n", &a, &n); /* doesn't work */
    sscanf("abc123a", "abc%d%n", &a, &n); /* works */

    However, the scanf function in the kernel doesn't convert the %n in that
    case because it has already matched the complete input after %d and just
    completely stops matching then. This patch fixes that.

    [akpm@linux-foundation.org: cleanups]
    Signed-off-by: Johannes Berg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

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

    Robert P. J. Day
     
  • Schedule obsolete OSS drivers for removal.

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

    Adrian Bunk
     
  • Additions and removal from tty_drivers list were just done as well as
    iterating on it for /proc/tty/drivers generation.

    testing: modprobe/rmmod loop of simple module which does nothing but
    tty_register_driver() vs cat /proc/tty/drivers loop

    BUG: unable to handle kernel paging request at virtual address 6b6b6b6b
    printing eip:
    c01cefa7
    *pde = 00000000
    Oops: 0000 [#1]
    PREEMPT
    last sysfs file: devices/pci0000:00/0000:00:1d.7/usb5/5-0:1.0/bInterfaceProtocol
    Modules linked in: ohci_hcd af_packet e1000 ehci_hcd uhci_hcd usbcore xfs
    CPU: 0
    EIP: 0060:[] Not tainted VLI
    EFLAGS: 00010297 (2.6.21-rc4-mm1 #4)
    EIP is at vsnprintf+0x3a4/0x5fc
    eax: 6b6b6b6b ebx: f6cb50f2 ecx: 6b6b6b6b edx: fffffffe
    esi: c0354700 edi: f6cb6000 ebp: 6b6b6b6b esp: f31f5e68
    ds: 007b es: 007b fs: 00d8 gs: 0033 ss: 0068
    Process cat (pid: 31864, ti=f31f4000 task=c1998030 task.ti=f31f4000)
    Stack: 00000000 c0103f20 c013003a c0103f20 00000000 f6cb50da 0000000a 00000f0e
    f6cb50f2 00000010 00000014 ffffffff ffffffff 00000007 c0354753 f6cb50f2
    f73e39dc f73e39dc 00000001 c0175416 f31f5ed8 f31f5ed4 0ee00000 f32090bc
    Call Trace:
    [] restore_nocheck+0x12/0x15
    [] mark_held_locks+0x6d/0x86
    [] restore_nocheck+0x12/0x15
    [] seq_printf+0x2e/0x52
    [] show_tty_range+0x35/0x1f3
    [] seq_printf+0x2e/0x52
    [] show_tty_driver+0x8a/0x1d9
    [] seq_read+0x70/0x2ba
    [] seq_read+0x0/0x2ba
    [] proc_reg_read+0x63/0x9f
    [] vfs_read+0x7d/0xb5
    [] proc_reg_read+0x0/0x9f
    [] sys_read+0x41/0x6a
    [] sysenter_past_esp+0x5f/0x99
    =======================
    Code: 00 8b 4d 04 e9 44 ff ff ff 8d 4d 04 89 4c 24 50 8b 6d 00 81 fd ff 0f 00 00 b8 a4 c1 35 c0 0f 46 e8 8b 54 24 2c 89 e9 89 c8 eb 06 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 89 c6 8b 44 24 28 89
    EIP: [] vsnprintf+0x3a4/0x5fc SS:ESP 0068:f31f5e68

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

    Alexey Dobriyan
     
  • Remove do_sync_file_range() and convert callers to just use
    do_sync_mapping_range().

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

    Mark Fasheh
     
  • cs5535_gpio, add MODULE_DEVICE_TABLE

    Signed-off-by: Jiri Slaby
    Cc: Ben Gardner
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • rocket, add MODULE_DEVICE_TABLE

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

    Jiri Slaby
     
  • This patch moves the die notifier handling to common code. Previous
    various architectures had exactly the same code for it. Note that the new
    code is compiled unconditionally, this should be understood as an appel to
    the other architecture maintainer to implement support for it aswell (aka
    sprinkling a notify_die or two in the proper place)

    arm had a notifiy_die that did something totally different, I renamed it to
    arm_notify_die as part of the patch and made it static to the file it's
    declared and used at. avr32 used to pass slightly less information through
    this interface and I brought it into line with the other architectures.

    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix vmalloc_sync_all bustage]
    [bryan.wu@analog.com: fix vmalloc_sync_all in nommu]
    Signed-off-by: Christoph Hellwig
    Cc:
    Cc: Russell King
    Signed-off-by: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Fix sparse NULL warnings:
    kernel/kprobes.c:915:49: warning: Using plain integer as NULL pointer

    Signed-off-by: Randy Dunlap
    Acked-by: Ananth N Mavinakayanahalli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • REISER_FS /proc option needs to depend on PROC_FS.

    fs/reiserfs/procfs.c: In function 'show_super':
    fs/reiserfs/procfs.c:134: error: 'reiserfs_proc_info_data_t' has no member named 'max_hash_collisions'
    fs/reiserfs/procfs.c:134: error: 'reiserfs_proc_info_data_t' has no member named 'breads'
    fs/reiserfs/procfs.c:135: error: 'reiserfs_proc_info_data_t' has no member named 'bread_miss'
    fs/reiserfs/procfs.c:135: error: 'reiserfs_proc_info_data_t' has no member named 'search_by_key'
    fs/reiserfs/procfs.c:136: error: 'reiserfs_proc_info_data_t' has no member named 'search_by_key_fs_changed'
    fs/reiserfs/procfs.c:136: error: 'reiserfs_proc_info_data_t' has no member named 'search_by_key_restarted'
    fs/reiserfs/procfs.c:137: error: 'reiserfs_proc_info_data_t' has no member named 'insert_item_restarted'
    fs/reiserfs/procfs.c:137: error: 'reiserfs_proc_info_data_t' has no member named 'paste_into_item_restarted'
    fs/reiserfs/procfs.c:138: error: 'reiserfs_proc_info_data_t' has no member named 'cut_from_item_restarted'
    fs/reiserfs/procfs.c:139: error: 'reiserfs_proc_info_data_t' has no member named 'delete_solid_item_restarted'
    fs/reiserfs/procfs.c:139: error: 'reiserfs_proc_info_data_t' has no member named 'delete_item_restarted'
    fs/reiserfs/procfs.c:140: error: 'reiserfs_proc_info_data_t' has no member named 'leaked_oid'
    fs/reiserfs/procfs.c:140: error: 'reiserfs_proc_info_data_t' has no member named 'leaves_removable'
    fs/reiserfs/procfs.c: In function 'show_per_level':
    fs/reiserfs/procfs.c:184: error: 'reiserfs_proc_info_data_t' has no member named 'balance_at'
    fs/reiserfs/procfs.c:185: error: 'reiserfs_proc_info_data_t' has no member named 'sbk_read_at'
    fs/reiserfs/procfs.c:186: error: 'reiserfs_proc_info_data_t' has no member named 'sbk_fs_changed'
    fs/reiserfs/procfs.c:187: error: 'reiserfs_proc_info_data_t' has no member named 'sbk_restarted'
    fs/reiserfs/procfs.c:188: error: 'reiserfs_proc_info_data_t' has no member named 'free_at'
    fs/reiserfs/procfs.c:189: error: 'reiserfs_proc_info_data_t' has no member named 'items_at'
    fs/reiserfs/procfs.c:190: error: 'reiserfs_proc_info_data_t' has no member named 'can_node_be_removed'
    fs/reiserfs/procfs.c:191: error: 'reiserfs_proc_info_data_t' has no member named 'lnum'
    fs/reiserfs/procfs.c:192: error: 'reiserfs_proc_info_data_t' has no member named 'rnum'
    fs/reiserfs/procfs.c:193: error: 'reiserfs_proc_info_data_t' has no member named 'lbytes'
    fs/reiserfs/procfs.c:194: error: 'reiserfs_proc_info_data_t' has no member named 'rbytes'
    fs/reiserfs/procfs.c:195: error: 'reiserfs_proc_info_data_t' has no member named 'get_neighbors'
    fs/reiserfs/procfs.c:196: error: 'reiserfs_proc_info_data_t' has no member named 'get_neighbors_restart'
    fs/reiserfs/procfs.c:197: error: 'reiserfs_proc_info_data_t' has no member named 'need_l_neighbor'
    fs/reiserfs/procfs.c:197: error: 'reiserfs_proc_info_data_t' has no member named 'need_r_neighbor'
    fs/reiserfs/procfs.c: In function 'show_bitmap':
    fs/reiserfs/procfs.c:224: error: 'reiserfs_proc_info_data_t' has no member named 'free_block'
    fs/reiserfs/procfs.c:225: error: 'reiserfs_proc_info_data_t' has no member named 'scan_bitmap'
    fs/reiserfs/procfs.c:226: error: 'reiserfs_proc_info_data_t' has no member named 'scan_bitmap'
    fs/reiserfs/procfs.c:227: error: 'reiserfs_proc_info_data_t' has no member named 'scan_bitmap'
    fs/reiserfs/procfs.c:228: error: 'reiserfs_proc_info_data_t' has no member named 'scan_bitmap'
    fs/reiserfs/procfs.c:229: error: 'reiserfs_proc_info_data_t' has no member named 'scan_bitmap'
    fs/reiserfs/procfs.c:230: error: 'reiserfs_proc_info_data_t' has no member named 'scan_bitmap'
    fs/reiserfs/procfs.c:230: error: 'reiserfs_proc_info_data_t' has no member named 'scan_bitmap'
    fs/reiserfs/procfs.c: In function 'show_journal':
    fs/reiserfs/procfs.c:384: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:385: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:386: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:387: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:388: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:389: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:390: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:391: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:392: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:393: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:394: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:395: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:395: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c:395: error: 'reiserfs_proc_info_data_t' has no member named 'journal'
    fs/reiserfs/procfs.c: In function 'reiserfs_proc_info_init':
    fs/reiserfs/procfs.c:504: warning: implicit declaration of function '__PINFO'
    fs/reiserfs/procfs.c:504: error: request for member 'lock' in something not a structure or union
    fs/reiserfs/procfs.c: In function 'reiserfs_proc_info_done':
    fs/reiserfs/procfs.c:544: error: request for member 'lock' in something not a structure or union
    fs/reiserfs/procfs.c:545: error: request for member 'exiting' in something not a structure or union
    fs/reiserfs/procfs.c:546: error: request for member 'lock' in something not a structure or union

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

    Randy Dunlap
     
  • While researching the tty layer pid leaks I found a weird case in selinux when
    we drop a controlling tty because of inadequate permissions we don't do the
    normal hangup processing. Which is a problem if it happens the session leader
    has exec'd something that can no longer access the tty.

    We already have code in the kernel to handle this case in the form of the
    TIOCNOTTY ioctl. So this patch factors out a helper function that is the
    essence of that ioctl and calls it from the selinux code.

    This removes the inconsistency in handling dropping of a controlling tty and
    who knows it might even make some part of user space happy because it received
    a SIGHUP it was expecting.

    In addition since this removes the last user of proc_set_tty outside of
    tty_io.c proc_set_tty is made static and removed from tty.h

    Signed-off-by: Eric W. Biederman
    Acked-by: Alan Cox
    Cc: James Morris
    Cc: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • This patch should contain no functional changes.

    At some point I got confused and thought put_pid could not be called while a
    spin lock was held. While it may be nice to avoid that to reduce lock hold
    times put_pid can be safely called while we hold a spin lock.

    This patch removes all of the complications from the code introduced by my
    misunderstanding, making the code a little more readable.

    Signed-off-by: Eric W. Biederman
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • All of the users of proc_clear_tty are compiled into the kernel so exporting
    this symbol appears gratuitous.

    Signed-off-by: Eric W. Biederman
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • The console subsystem already has an idea of a boot console, using the
    CON_BOOT flag. The implementation has some flaws though. The major
    problem is that presence of a boot console makes register_console() ignore
    any other console devices (unless explicitly specified on the kernel
    command line).

    This patch fixes the console selection code to *not* consider a boot
    console a full-featured one, so the first non-boot console registering will
    become the default console instead. This way the unregister call for the
    boot console in the register_console() function actually triggers and the
    handover from the boot console to the real console device works smoothly.
    Added a printk for the handover, so you know which console device the
    output goes to when the boot console stops printing messages.

    The disable_early_printk() call is obsolete with that patch, explicitly
    disabling the early console isn't needed any more as it works automagically
    with that patch.

    I've walked through the tree, dropped all disable_early_printk() instances
    found below arch/ and tagged the consoles with CON_BOOT if needed. The
    code is tested on x86, sh (thanks to Paul) and mips (thanks to Ralf).

    Changes to last version: Rediffed against -rc3, adapted to mips cleanups by
    Ralf, fixed "udbg-immortal" cmd line arg on powerpc.

    Signed-off-by: Gerd Hoffmann
    Acked-by: Paul Mundt
    Acked-by: Ralf Baechle
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerd Hoffmann
     
  • console.name[] is eight chars, but so is "earlyvga". So when we try to print
    console->name when using earlyvga it runs off the end of the string.

    Make it bigger.

    Diagnosed-by: Gerd Hoffmann

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

    Andrew Morton
     
  • Eternal quest to make

    while true; do cat /proc/fs/xfs/stat >/dev/null 2>/dev/null; done
    while true; do find /proc -type f 2>/dev/null | xargs cat >/dev/null 2>/dev/null; done
    while true; do modprobe xfs; rmmod xfs; done

    work reliably continues and now kernel oopses in the following way:

    BUG: unable to handle ... at virtual address 6b6b6b6b
    EIP is at badness
    process: cat
    proc_oom_score
    proc_info_read
    sys_fstat64
    vfs_read
    proc_info_read
    sys_read

    Failing code is prefetch hidden in list_for_each_entry() in badness().
    badness() is reachable from two points. One is proc_oom_score, another
    is out_of_memory() => select_bad_process() => badness().

    Second path grabs tasklist_lock, while first doesn't.

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

    Alexey Dobriyan
     
  • LTP test sigaction_16_24 fails, because it expects sem_wait to be restarted
    if SA_RESTART is set. sem_wait is implemented with futex_wait, that
    currently doesn't support being restarted. Ulrich confirms that the call
    should be restartable.

    Implement a restart_block method to handle the relative timeout, and allow
    restarts.

    Signed-off-by: Nick Piggin
    Cc: Ulrich Drepper
    Cc: Rusty Russell
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • lguest uses the convenient futex infrastructure for inter-domain I/O, so
    expose get_futex_key, get_key_refs (renamed get_futex_key_refs) and
    drop_key_refs (renamed drop_futex_key_refs). Also means we need to expose the
    union that these use.

    No code changes.

    Signed-off-by: Rusty Russell
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rusty Russell
     
  • Signed-off-by: Dale Farnsworth.org
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dale Farnsworth
     
  • Add an RTC driver for Ricoh RS5C313 RTC chip.

    [akpm@linux-foundation.org: Zillions of coding-style fixes]
    [akpm@linux-foundation.org: build fixes]
    Signed-off-by: Nobuhiro Iwamatsu
    Cc: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nobuhiro Iwamatsu