07 Jun, 2008

40 commits

  • When posting:
    [PATCH 1/8] Scaling msgmni to the amount of lowmem
    (see http://lkml.org/lkml/2008/2/11/171), I have added a KERN_INFO message
    that is output each time msgmni is recomputed.

    In http://lkml.org/lkml/2008/4/29/575 Tony Luck complained that this
    message references an ipc namespace address that is useless.

    I first thought of using an audit_log instead of a printk, as suggested by
    Serge Hallyn. But unfortunately, we do not have any other information
    than the namespace address to provide here too. So I chose to move the
    message and output it only at boot time, removing the reference to the
    namespace.

    Signed-off-by: Nadia Derbey
    Cc: Pierre Peiffer
    Cc: Manfred Spraul
    Acked-by: Tony Luck
    Cc: "Serge E. Hallyn"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • When posting:

    [PATCH 1/8] Scaling msgmni to the amount of lowmem

    (see http://article.gmane.org/gmane.linux.kernel/637849/) I changed the
    MSGPOOL value to make it fit what is said in the man pages (i.e. a size
    in bytes).

    But Michael Kerrisk rightly complained that this change could affect the
    ABI. So I'm posting this patch to make MSGPOOL expressed back in Kbytes.
    Michael, on his side, has fixed the man page.

    Signed-off-by: Nadia Derbey
    Cc: Pierre Peiffer
    Cc: Manfred Spraul
    Acked-by: Michael Kerrisk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • Original report: """I used to force my console to black-on-white by the
    command `setterm -inversescreen on`. In 2.6.26-rc4, I get lots of black
    background characters."""

    Another addendum to commit c9e587ab. This was previously missed out since
    I was not aware of what vc_decscnm was for.

    Signed-off-by: Jan Engelhardt
    Reported-by:
    Tested-by:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Engelhardt
     
  • If cpu specific cpufreq driver(i.e. longrun) has "setpolicy" function,
    governor object isn't set into cpufreq_policy object at "__cpufreq_set_policy"
    function in driver/cpufreq/cpufreq.c .

    This causes a null object access at "store_scaling_setspeed" and
    "show_scaling_setspeed" function in driver/cpufreq/cpufreq.c when reading or
    writing through /sys interface (ex. cat
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed)

    Addresses:
    http://bugzilla.kernel.org/show_bug.cgi?id=10654
    https://bugzilla.redhat.com/show_bug.cgi?id=443354

    Signed-off-by: CHIKAMA Masaki
    Cc: Dave Jones
    Cc: Chuck Ebbert
    Acked-by: Dominik Brodowski
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    CHIKAMA masaki
     
  • The interlaced and double line mode bits should not be copied to new
    console when the console is switched. Otherwise, the new console may be
    set to incorrect refresh rate.

    Also, the x and y offsets does not need to be copied.

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

    Krzysztof Helt
     
  • This semaphore doesn't appear to be used, so remove it.

    Signed-off-by: Daniel Walker
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Walker
     
  • Adding a nonexistent cpu to a cpuset will be omitted quietly. It should
    return -EINVAL.

    Example: (real_nr_cpus < NR_CPUS or cpu#4 was just offline)

    # cat cpus
    0-1
    # /bin/echo 4 > cpus
    # /bin/echo $?
    0
    # cat cpus

    #

    The same occurs when add a nonexistent mem.
    This patch will fix this bug.
    And when *buf == "", the check is unneeded.

    Signed-off-by: Lai Jiangshan
    Acked-by: Paul Jackson
    Cc: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     
  • Fix a bug in add_to_pagemap. Previously, since pm->out was a char *,
    put_user was only copying 1 byte of every PFN, resulting in the top 7
    bytes of each PFN not being copied. By requiring that reads be a multiple
    of 8 bytes, I can make pm->out and pm->end u64*s instead of char*s, which
    makes put_user work properly, and also simplifies the logic in
    add_to_pagemap a bit.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Thomas Tuttle
    Cc: Matt Mackall
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Tuttle
     
  • Consider you added a 'c foo:bar r' permission to some cgroup and then (a
    bit later) 'c'foo:bar w' for it. After this you'll see the

    c foo:bar r
    c foo:bar w

    lines in a devices.list file.

    Another example - consider you added 10 'c foo:bar r' permissions to some
    cgroup (e.g. by mistake). After this you'll see 10 c foo:bar r lines in
    a list file.

    This is weird. This situation also has one more annoying consequence.
    Having many items in a white list makes permissions checking slower, sine
    it has to walk a longer list.

    The proposal is to merge permissions for items, that correspond to the
    same device.

    Signed-off-by: Pavel Emelyanov
    Acked-by: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • Currently even if a task sits in an all-denied cgroup it can still mount
    any block device in any mode it wants.

    Put a proper check in do_open for block device to prevent this.

    Signed-off-by: Pavel Emelyanov
    Acked-by: Serge Hallyn
    Tested-by: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • Two functions, that need to get a device_cgroup from a task (they are
    devcgroup_inode_permission and devcgroup_inode_mknod) make it in a strange
    way:

    They get a css_set from task, then a subsys_state from css_set, then a
    cgroup from the state and then a subsys_state again from the cgroup.
    Besides, the devices_subsys_id is read from memory, whilst there's a
    enum-ed constant for it.

    Optimize this part a bit:
    1. Get the subsys_stats form the task and be done - no 2 extra
    dereferences,
    2. Use the device_subsys_id constant, not the value from memory
    (i.e. one less dereference).

    Found while preparing 2.6.26 OpenVZ port.

    Signed-off-by: Pavel Emelyanov
    Acked-by: Serge Hallyn
    Acked-by: Paul Menage
    Cc: Balbir Singh
    Cc: James Morris
    Cc: Chris Wright
    Cc: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • This is just picking the container_of out of cgroup_to_devcgroup into a
    separate function.

    This new css_to_devcgroup will be used in the 2nd patch.

    Signed-off-by: Pavel Emelyanov
    Acked-by: Serge Hallyn
    Cc: Paul Menage
    Cc: Balbir Singh
    Cc: James Morris
    Cc: Chris Wright
    Cc: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • This patch introduces memory_read_from_buffer().

    The only difference between memory_read_from_buffer() and
    simple_read_from_buffer() is which address space the function copies to.

    simple_read_from_buffer copies to user space memory.
    memory_read_from_buffer copies to normal memory.

    Signed-off-by: Akinobu Mita
    Cc: Al Viro
    Cc: Doug Warzecha
    Cc: Zhang Rui
    Cc: Matt Domsch
    Cc: Abhay Salunke
    Cc: Greg Kroah-Hartman
    Cc: Markus Rechberger
    Cc: Kay Sievers
    Cc: Bob Moore
    Cc: Thomas Renninger
    Cc: Len Brown
    Cc: Benjamin Herrenschmidt
    Cc: "Antonino A. Daplas"
    Cc: Krzysztof Helt
    Cc: Geert Uytterhoeven
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Peter Oberparleiter
    Cc: Michael Holzheu
    Cc: Brian King
    Cc: James E.J. Bottomley
    Cc: Andrew Vasquez
    Cc: Seokmann Ju
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Bluetooth will be able to use this.

    Signed-off-by: Harvey Harrison
    Cc: Marcel Holtmann
    Cc: Dave Young
    Cc: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Change the name of the device from "rtc-ds1374" to just "ds1374", to match
    what all other RTC drivers do. I seem to remember that this name was
    chosen to avoid possible confusion with an older ds1374 driver, but that
    driver was removed 3 months ago.

    Signed-off-by: Jean Delvare
    Signed-off-by: Alessandro Zummo
    Acked-by: Kumar Gala
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Although if people have questions about ARCnet, perhaps it's _better_
    for them to be mailing dwmw2@cam.ac.uk about it...

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

    David Woodhouse
     
  • Include limits.h to get a definition of PATH_MAX.

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

    Ingo Molnar
     
  • We lost the marking of SIGWINCH as being OK to receive during stub
    execution, causing a panic should that happen.

    Cc: Benedict Verheyen
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • x86_64 defines either memcpy or __memcpy depending on the gcc version, and
    it looks like UML needs to follow that in its exporting.

    Cc: Gabriel C
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch makes os_get_task_size locate the bottom of the address space,
    as well as the top. This is for systems which put a lower limit on mmap
    addresses. It works by manually scanning pages from zero onwards until a
    valid page is found.

    Because the bottom of the address space may not be zero, it's not
    sufficient to assume the top of the address space is the size of the
    address space. The size is the difference between the top address and
    bottom address.

    [jdike@addtoit.com: changed the name to reflect that this function is
    supposed to return the top of the process address space, not its size and
    changed the return value to reflect that. Also some minor formatting
    changes]
    Signed-off-by: Tom Spink
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tom Spink
     
  • Removed duplicated include file "kern_util.h" in
    arch/um/drivers/ubd_kern.c.

    Signed-off-by: Huang Weiyi
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Weiyi
     
  • Protection against the host's time going backwards (eg, ntp activity on
    the host) by keeping track of the time at the last tick and if it's
    greater than the current time, keep time stopped until the host catches
    up.

    Cc: Nix
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Update status and URL for the "Gary's Encyclopedia" entry.

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

    Paul Jackson
     
  • Signed-off-by: Dan Williams
    Cc: Jonathan Woithe
    Cc: Len Brown
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • kobjsize() has been abusing page->index as a method for sorting out
    compound order, which blows up both for page cache pages, and SLOB's
    reuse of the index in struct slob_page.

    Presently we are not able to accurately size arbitrary pointers that
    don't come from kmalloc(), so the best we can do is sort out the
    compound order from the head page if it's a compound page, or default
    to 0-order if it's impossible to ksize() the object.

    Obviously this leaves quite a bit to be desired in terms of object
    sizing accuracy, but the behaviour is unchanged over the existing
    implementation, while fixing the page->index oopses originally reported
    here:

    http://marc.info/?l=linux-mm&m=121127773325245&w=2

    Accuracy could also be improved by having SLUB and SLOB both set PG_slab
    on ksizeable pages, rather than just handling the __GFP_COMP cases
    irregardless of the PG_slab setting, as made possibly with Pekka's
    patches:

    http://marc.info/?l=linux-kernel&m=121139439900534&w=2
    http://marc.info/?l=linux-kernel&m=121139440000537&w=2
    http://marc.info/?l=linux-kernel&m=121139440000540&w=2

    This is primarily a bugfix for nommu systems for 2.6.26, with the aim
    being to gradually kill off kobjsize() and its particular brand of
    object abuse entirely.

    Reviewed-by: Pekka Enberg
    Signed-off-by: Paul Mundt
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mundt
     
  • As some m68k machines have plenty of libc5 binaries in active use, enable
    CONFIG_COMPAT_BRK by default.

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

    Geert Uytterhoeven
     
  • Fix a regression introduced by

    commit 4cc6028d4040f95cdb590a87db478b42b8be0508
    Author: Jiri Kosina
    Date: Wed Feb 6 22:39:44 2008 +0100

    brk: check the lower bound properly

    The check in sys_brk() on minimum value the brk might have must take
    CONFIG_COMPAT_BRK setting into account. When this option is turned on
    (i.e. we support ancient legacy binaries, e.g. libc5-linked stuff), the
    lower bound on brk value is mm->end_code, otherwise the brk start is
    allowed to be arbitrarily shifted.

    Signed-off-by: Jiri Kosina
    Tested-by: Geert Uytterhoeven
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     
  • As commit 6089093e588ee3f6aed99d08b1cf5ea37c52cf97 ("ip2: fix crashes on
    load/unload") fixed the ip2 crashes on load/unload by making ip2/ip2main
    one module (ip2), Kconfig shouldn't mention a now non-existing module.

    Signed-off-by: Roland.Kletzing
    Acked-by: Alan Cox
    Cc: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland.Kletzing
     
  • Signed-off-by: Alexey Dobriyan
    Cc: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • The page decrypt calls in ecryptfs_write() are both pointless and buggy.
    Pointless because ecryptfs_get_locked_page() has already brought the page
    up to date, and buggy because prior mmap writes will just be blown away by
    the decrypt call.

    This patch also removes the declaration of a now-nonexistent function
    ecryptfs_write_zeros().

    Thanks to Eric Sandeen and David Kleikamp for helping to track this
    down.

    Eric said:

    fsx w/ mmap dies quickly ( < 100 ops) without this, and survives
    nicely (to millions of ops+) with it in place.

    Signed-off-by: Michael Halcrow
    Cc: Eric Sandeen
    Cc: Dave Kleikamp
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     
  • This version is a bit of a whopper. This version brings a few new checks,
    improvements to a number of checks mostly through modifications to the
    way types are parsed, several fixes to quote/comment handling, as well as
    the usual slew of fixes for false positives.

    Of note:
    - return is not a function and is now reported,
    - preprocessor directive detection is loosened to match C99 standard,
    - we now intuit new type modifiers, and
    - comment handling is much improved

    Andy Whitcroft (18):
    Version: 0.19
    fix up a couple of missing newlines in reports
    colon to parenthesis spacing varies on asm
    values: #include is a preprocessor statement
    quotes: fix single character quotes at line end
    add typedef exception for the non-pointer "function types"
    kerneldoc parameters must be on one line, relax line length
    types: word boundary is not always required
    improved #define bracketing reports
    uninitialized_var is an annotation not a function name
    possible types: add possible modifier handling
    possible types: fastcall is a type modifier
    types: unsigned is not a modifier on all types
    static/external initialisation to zero should allow modifiers
    checkpatch: fix recognition of preprocessor directives -- part 2
    comments: fix inter-hunk comment tracking
    return is not a function
    do not report include/asm/foo.h use in include/linux/foo.h
    return is not a function -- tighten test

    [jengelh@computergmbh.de: fix recognition of preprocessor directives]
    Signed-off-by: Andy Whitcroft
    Cc: Jan Engelhardt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Some drivers are using too generic "serial" name for driver_name, this
    might cause issues, like this:

    Freescale QUICC Engine UART device driver
    proc_dir_entry 'serial' already registered
    Call Trace:
    [cf82de50] [c0007f7c] show_stack+0x4c/0x1ac (unreliable)
    [cf82de90] [c00b03fc] proc_register+0xfc/0x1ac
    [cf82dec0] [c00b05c8] create_proc_entry+0x60/0xac
    [cf82dee0] [c00b23dc] proc_tty_register_driver+0x60/0x98
    [cf82def0] [c016dbd8] tty_register_driver+0x1b4/0x228
    [cf82df20] [c0184d70] uart_register_driver+0x144/0x194
    [cf82df40] [c030a378] ucc_uart_init+0x2c/0x94
    [cf82df50] [c02f21a0] kernel_init+0x98/0x27c
    [cf82dff0] [c000fa74] kernel_thread+0x44/0x60

    ^^ The board is using ucc_uart.c and 8250.c, both registered as
    "serial".

    This patch fixes two drivers that are using "serial" for driver_name and
    not "ttyS" for dev_name. Drivers that are using "ttyS" for dev_name, will
    conflict anyway, so we don't bother with these.

    Signed-off-by: Anton Vorontsov
    Acked-by: Alan Cox
    Acked-By: Timur Tabi
    Acked-by: Maciej W. Rozycki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • =============================================
    [ INFO: possible recursive locking detected ]
    2.6.26-rc4 #30
    ---------------------------------------------
    heap-overflow/2250 is trying to acquire lock:
    (&mm->page_table_lock){--..}, at: [] .copy_hugetlb_page_range+0x108/0x280

    but task is already holding lock:
    (&mm->page_table_lock){--..}, at: [] .copy_hugetlb_page_range+0xfc/0x280

    other info that might help us debug this:
    3 locks held by heap-overflow/2250:
    #0: (&mm->mmap_sem){----}, at: [] .dup_mm+0x134/0x410
    #1: (&mm->mmap_sem/1){--..}, at: [] .dup_mm+0x144/0x410
    #2: (&mm->page_table_lock){--..}, at: [] .copy_hugetlb_page_range+0xfc/0x280

    stack backtrace:
    Call Trace:
    [c00000003b2774e0] [c000000000010ce4] .show_stack+0x74/0x1f0 (unreliable)
    [c00000003b2775a0] [c0000000003f10e0] .dump_stack+0x20/0x34
    [c00000003b277620] [c0000000000889bc] .__lock_acquire+0xaac/0x1080
    [c00000003b277740] [c000000000089000] .lock_acquire+0x70/0xb0
    [c00000003b2777d0] [c0000000003ee15c] ._spin_lock+0x4c/0x80
    [c00000003b277870] [c0000000000cf2e8] .copy_hugetlb_page_range+0x108/0x280
    [c00000003b277950] [c0000000000bcaa8] .copy_page_range+0x558/0x790
    [c00000003b277ac0] [c000000000050fe0] .dup_mm+0x2d0/0x410
    [c00000003b277ba0] [c000000000051d24] .copy_process+0xb94/0x1020
    [c00000003b277ca0] [c000000000052244] .do_fork+0x94/0x310
    [c00000003b277db0] [c000000000011240] .sys_clone+0x60/0x80
    [c00000003b277e30] [c0000000000078c4] .ppc_clone+0x8/0xc

    Fix is the same way that mm/memory.c copy_page_range does the
    lockdep annotation.

    Acked-by: KOSAKI Motohiro
    Acked-by: Adam Litke
    Acked-by: Nishanth Aravamudan
    Signed-off-by: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • The temporary structure for calculated CVT mode is not initialized. Few
    fields have only bits or-ed or and-ed so they may be left in incorrect
    (random) state.

    Testing of the tridentfb seems like a good exercise for the fbdev layer.

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

    Krzysztof Helt
     
  • Fix the following compile error:

    CC fs/binfmt_flat.o
    In file included from
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:36:
    /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/flat.h:14:22: error: asm/flat.h: No such file or directory
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c: In function 'create_flat_tables':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:124: error: implicit declaration of function 'flat_stack_align'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:125: error: implicit declaration of function 'flat_argvp_envp_on_stack'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c: In function 'calc_reloc':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:347: error: implicit declaration of function 'flat_reloc_valid'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c: In function 'load_flat_file':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:479: error: implicit declaration of function 'flat_old_ram_flag'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:755: error: implicit declaration of function 'flat_set_persistent'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:757: error: implicit declaration of function 'flat_get_relocate_addr'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:765: error: implicit declaration of function 'flat_get_addr_from_rp'
    /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/binfmt_flat.c:781: error: implicit declaration of function 'flat_put_addr_at_rp'

    Reported-by: Adrian Bunk
    Signed-off-by: Adrian Bunk
    Tested-by: David Howells
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Make the doc consistent with current cpusets implementation.

    Signed-off-by: Miao Xie
    Acked-by: Paul Jackson
    Cc: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miao Xie
     
  • If a block is computed (rather than read) then a check/repair operation
    may be lead to believe that the data on disk is correct, when infact it
    isn't. So only compute blocks for failed devices.

    This issue has been around since at least 2.6.12, but has become harder to
    hit in recent kernels since most reads bypass the cache.

    echo repair > /sys/block/mdN/md/sync_action will set the parity blocks to the
    correct state.

    Cc:
    Signed-off-by: Dan Williams
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • If an array was created with --assume-clean we will oops when trying to
    set ->resync_max.

    Fix this by initializing ->recovery_wait in mddev_find.

    Cc:
    Signed-off-by: Dan Williams
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • During the initial array synchronization process there is a window between
    when a prexor operation is scheduled to a specific stripe and when it
    completes for a sync_request to be scheduled to the same stripe. When
    this happens the prexor completes and the stripe is unconditionally marked
    "insync", effectively canceling the sync_request for the stripe. Prior to
    2.6.23 this was not a problem because the prexor operation was done under
    sh->lock. The effect in older kernels being that the prexor would still
    erroneously mark the stripe "insync", but sync_request would be held off
    and re-mark the stripe as "!in_sync".

    Change the write completion logic to not mark the stripe "in_sync" if a
    prexor was performed. The effect of the change is to sometimes not set
    STRIPE_INSYNC. The worst this can do is cause the resync to stall waiting
    for STRIPE_INSYNC to be set. If this were happening, then STRIPE_SYNCING
    would be set and handle_issuing_new_read_requests would cause all
    available blocks to eventually be read, at which point prexor would never
    be used on that stripe any more and STRIPE_INSYNC would eventually be set.

    echo repair > /sys/block/mdN/md/sync_action will correct arrays that may
    have lost this race.

    Cc:
    Signed-off-by: Dan Williams
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • This addresses other oopsing paths in "spidev" by changing how it manages
    refcounting. It decouples the lifecycle of the per-device data from the
    class device (not just the spi device):

    - Use class_{create,destroy} not class_{register,unregister}.
    - Use device_{create,destroy} not device_{register,unregister}.
    - Free the per-device data only when TWO conditions are true:
    * Driver is unbound from underlying SPI device, and
    * Device is no longer open (new)

    Also, spi_{get,set}_drvdata not dev_{get,set}_drvdata for simpler code.

    Signed-off-by: David Brownell
    Sebastian Siewior
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell