01 Mar, 2011

1 commit

  • Commit e2cda3226481 ("thp: add pmd mangling generic functions") replaced
    some macros in with inline functions.

    If the functions are to be defined (not all architectures need them)
    then struct vm_area_struct must be defined first. So include
    .

    Fixes a build failure seen in Debian:

    CC [M] drivers/media/dvb/mantis/mantis_pci.o
    In file included from arch/arm/include/asm/pgtable.h:460,
    from drivers/media/dvb/mantis/mantis_pci.c:25:
    include/asm-generic/pgtable.h: In function 'ptep_test_and_clear_young':
    include/asm-generic/pgtable.h:29: error: dereferencing pointer to incomplete type

    Signed-off-by: Ben Hutchings
    Signed-off-by: Linus Torvalds

    Ben Hutchings
     

26 Feb, 2011

25 commits

  • * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    PM: Make ACPI wakeup from S5 work again when CONFIG_PM_SLEEP is unset

    Linus Torvalds
     
  • Fixes sysfs config attribute to allow access to entire 16MB maintenance
    space of RapidIO devices.

    Signed-off-by: Alexandre Bounine
    Cc: Kumar Gala
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Thomas Moll
    Cc: Micha Nelissen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Initialize ts_real.flags to fix compiler warning about possible
    uninitialized use of this field.

    Signed-off-by: Alexander Gordeev
    Cc: john stultz
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • It seems odd that truncate_inode_pages_range(), called not only when
    truncating but also when evicting inodes, has mem_cgroup_uncharge_start
    and _end() batching in its second loop to clear up a few leftovers, but
    not in its first loop that does almost all the work: add them there too.

    Signed-off-by: Hugh Dickins
    Acked-by: KAMEZAWA Hiroyuki
    Acked-by: Balbir Singh
    Acked-by: Daisuke Nishimura
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • The THP code didn't pass the correct interleaving shift to the memory
    policy code. Fix this here by adjusting for the order.

    Signed-off-by: Andi Kleen
    Reviewed-by: Christoph Lameter
    Acked-by: Andrea Arcangeli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • A race can occur when io_submit() races with io_destroy():

    CPU1 CPU2
    io_submit()
    do_io_submit()
    ...
    ctx = lookup_ioctx(ctx_id);
    io_destroy()
    Now do_io_submit() holds the last reference to ctx.
    ...
    queue new AIO
    put_ioctx(ctx) - frees ctx with active AIOs

    We solve this issue by checking whether ctx is being destroyed in AIO
    submission path after adding new AIO to ctx. Then we are guaranteed that
    either io_destroy() waits for new AIO or we see that ctx is being
    destroyed and bail out.

    Cc: Nick Piggin
    Reviewed-by: Jeff Moyer
    Signed-off-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • aio-dio-invalidate-failure GPFs in aio_put_req from io_submit.

    lookup_ioctx doesn't implement the rcu lookup pattern properly.
    rcu_read_lock does not prevent refcount going to zero, so we might take
    a refcount on a zero count ioctx.

    Fix the bug by atomically testing for zero refcount before incrementing.

    [jack@suse.cz: added comment into the code]
    Reviewed-by: Jeff Moyer
    Signed-off-by: Nick Piggin
    Signed-off-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • When pfn_valid_within() failed 'iter' was incremented twice.

    Signed-off-by: Namhyung Kim
    Reviewed-by: KAMEZAWA Hiroyuki
    Reviewed-by: Minchan Kim
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • In linux rtc_time struct, tm_mon range is 0~11, tm_wday range is 0~6,
    while in RTC HW REG, month range is 1~12, day of the week range is 1~7,
    this patch adjusts difference of them.

    The efect of this bug was that most of month will be operated on as the
    next month by the hardware (When in Jan it maybe even worse). For
    example, if in May, software wrote 4 to the hardware, which handled it as
    April. Then the logic would be different between software and hardware,
    which would cause weird things to happen.

    Signed-off-by: Lei Xu
    Cc: Alessandro Zummo
    Cc: john stultz
    Cc: Jack Lan
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lei Xu
     
  • The kernel automatically evaluates partition tables of storage devices.
    The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains
    a bug that causes a kernel oops on certain corrupted LDM partitions. A
    kernel subsystem seems to crash, because, after the oops, the kernel no
    longer recognizes newly connected storage devices.

    The patch changes ldm_parse_vmdb() to Validate the value of vblk_size.

    Signed-off-by: Timo Warns
    Cc: Eugene Teo
    Acked-by: Richard Russon
    Cc: Harvey Harrison
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Timo Warns
     
  • should_continue_reclaim() for reclaim/compaction allows scanning to
    continue even if pages are not being reclaimed until the full list is
    scanned. In terms of allocation success, this makes sense but potentially
    it introduces unwanted latency for high-order allocations such as
    transparent hugepages and network jumbo frames that would prefer to fail
    the allocation attempt and fallback to order-0 pages. Worse, there is a
    potential that the full LRU scan will clear all the young bits, distort
    page aging information and potentially push pages into swap that would
    have otherwise remained resident.

    This patch will stop reclaim/compaction if no pages were reclaimed in the
    last SWAP_CLUSTER_MAX pages that were considered. For allocations such as
    hugetlbfs that use __GFP_REPEAT and have fewer fallback options, the full
    LRU list may still be scanned.

    Order-0 allocation should not be affected because RECLAIM_MODE_COMPACTION
    is not set so the following avoids the gfp_mask being examined:

    if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION))
    return false;

    A tool was developed based on ftrace that tracked the latency of
    high-order allocations while transparent hugepage support was enabled and
    three benchmarks were run. The "fix-infinite" figures are 2.6.38-rc4 with
    Johannes's patch "vmscan: fix zone shrinking exit when scan work is done"
    applied.

    STREAM Highorder Allocation Latency Statistics
    fix-infinite break-early
    1 :: Count 10298 10229
    1 :: Min 0.4560 0.4640
    1 :: Mean 1.0589 1.0183
    1 :: Max 14.5990 11.7510
    1 :: Stddev 0.5208 0.4719
    2 :: Count 2 1
    2 :: Min 1.8610 3.7240
    2 :: Mean 3.4325 3.7240
    2 :: Max 5.0040 3.7240
    2 :: Stddev 1.5715 0.0000
    9 :: Count 111696 111694
    9 :: Min 0.5230 0.4110
    9 :: Mean 10.5831 10.5718
    9 :: Max 38.4480 43.2900
    9 :: Stddev 1.1147 1.1325

    Mean time for order-1 allocations is reduced. order-2 looks increased but
    with so few allocations, it's not particularly significant. THP mean
    allocation latency is also reduced. That said, allocation time varies so
    significantly that the reductions are within noise.

    Max allocation time is reduced by a significant amount for low-order
    allocations but reduced for THP allocations which presumably are now
    breaking before reclaim has done enough work.

    SysBench Highorder Allocation Latency Statistics
    fix-infinite break-early
    1 :: Count 15745 15677
    1 :: Min 0.4250 0.4550
    1 :: Mean 1.1023 1.0810
    1 :: Max 14.4590 10.8220
    1 :: Stddev 0.5117 0.5100
    2 :: Count 1 1
    2 :: Min 3.0040 2.1530
    2 :: Mean 3.0040 2.1530
    2 :: Max 3.0040 2.1530
    2 :: Stddev 0.0000 0.0000
    9 :: Count 2017 1931
    9 :: Min 0.4980 0.7480
    9 :: Mean 10.4717 10.3840
    9 :: Max 24.9460 26.2500
    9 :: Stddev 1.1726 1.1966

    Again, mean time for order-1 allocations is reduced while order-2
    allocations are too few to draw conclusions from. The mean time for THP
    allocations is also slightly reduced albeit the reductions are within
    varianes.

    Once again, our maximum allocation time is significantly reduced for
    low-order allocations and slightly increased for THP allocations.

    Anon stream mmap reference Highorder Allocation Latency Statistics
    1 :: Count 1376 1790
    1 :: Min 0.4940 0.5010
    1 :: Mean 1.0289 0.9732
    1 :: Max 6.2670 4.2540
    1 :: Stddev 0.4142 0.2785
    2 :: Count 1 -
    2 :: Min 1.9060 -
    2 :: Mean 1.9060 -
    2 :: Max 1.9060 -
    2 :: Stddev 0.0000 -
    9 :: Count 11266 11257
    9 :: Min 0.4990 0.4940
    9 :: Mean 27250.4669 24256.1919
    9 :: Max 11439211.0000 6008885.0000
    9 :: Stddev 226427.4624 186298.1430

    This benchmark creates one thread per CPU which references an amount of
    anonymous memory 1.5 times the size of physical RAM. This pounds swap
    quite heavily and is intended to exercise THP a bit.

    Mean allocation time for order-1 is reduced as before. It's also reduced
    for THP allocations but the variations here are pretty massive due to
    swap. As before, maximum allocation times are significantly reduced.

    Overall, the patch reduces the mean and maximum allocation latencies for
    the smaller high-order allocations. This was with Slab configured so it
    would be expected to be more significant with Slub which uses these size
    allocations more aggressively.

    The mean allocation times for THP allocations are also slightly reduced.
    The maximum latency was slightly increased as predicted by the comments
    due to reclaim/compaction breaking early. However, workloads care more
    about the latency of lower-order allocations than THP so it's an
    acceptable trade-off.

    Signed-off-by: Mel Gorman
    Acked-by: Andrea Arcangeli
    Acked-by: Johannes Weiner
    Reviewed-by: Minchan Kim
    Acked-by: Andrea Arcangeli
    Acked-by: Rik van Riel
    Cc: Michal Hocko
    Cc: Kent Overstreet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • The regulator framework is used for power management. The regulators are
    only named in the driver code, the actual control stuff is in the board
    file for each architecture or use case.

    The PN544 chip has three regulators that can be controlled or not -
    depending on the architecture where the chip is being used. So some of
    the regulators may not be controllable. In our current case the third
    regulator, which was missing from the code, went unnoticed because we
    didn't need to control it. To be as general as possible - in this respect
    - the driver needs to list all regulators. Then the board file can be
    used to actually set the usage.

    Signed-off-by: Matti J. Aaltonen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matti J. Aaltonen
     
  • Spell out the NFC acronym when it's shown for the first time.

    Signed-off-by: Matti J. Aaltonen
    Acked-by: Wolfram Sang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matti J. Aaltonen
     
  • swiotlb's map_page wrongly calls panic() when it can't find a buffer fit
    for device's dma mask. It should return an error instead.

    Devices with an odd dma mask (i.e. under 4G) like b44 network card hit
    this bug (the system crashes):

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

    If swiotlb returns an error, b44 driver can use the own bouncing
    mechanism.

    Reported-by: Chuck Ebbert
    Signed-off-by: FUJITA Tomonori
    Tested-by: Arkadiusz Miskiewicz
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • I have translated some kernel documentation so I wish to maintain the
    Chinese documentation in our kernel directories.

    Signed-off-by: Harry Wei
    Cc: Joe Perches
    Cc: Greg KH
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harry Wei
     
  • The move_pages() usage of find_task_by_vpid() requires rcu_read_lock() to
    prevent free_pid() from reclaiming the pid.

    Without this patch, RCU warnings are printed in v2.6.38-rc4 move_pages()
    with:

    CONFIG_LOCKUP_DETECTOR=y
    CONFIG_PREEMPT=y
    CONFIG_LOCKDEP=y
    CONFIG_PROVE_LOCKING=y
    CONFIG_PROVE_RCU=y

    Previously, migrate_pages() went through a similar transformation
    replacing usage of tasklist_lock with rcu read lock:

    commit 55cfaa3cbdd29c4919ecb5fb8965c310f357e48c
    Author: Zeng Zhaoming
    Date: Thu Dec 2 14:31:13 2010 -0800

    mm/mempolicy.c: add rcu read lock to protect pid structure

    commit 1e50df39f6e2c3a4a3394df62baa8a213df16c54
    Author: KOSAKI Motohiro
    Date: Thu Jan 13 15:46:14 2011 -0800

    mempolicy: remove tasklist_lock from migrate_pages

    Signed-off-by: Greg Thelen
    Cc: Mel Gorman
    Cc: Minchan Kim
    Cc: Rik van Riel
    Cc: KAMEZAWA Hiroyuki
    Cc: "Paul E. McKenney"
    Cc: Tetsuo Handa
    Cc: Sergey Senozhatsky
    Cc: Oleg Nesterov
    Cc: Zeng Zhaoming
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Greg Thelen
     
  • In several places, an epoll fd can call another file's ->f_op->poll()
    method with ep->mtx held. This is in general unsafe, because that other
    file could itself be an epoll fd that contains the original epoll fd.

    The code defends against this possibility in its own ->poll() method using
    ep_call_nested, but there are several other unsafe calls to ->poll
    elsewhere that can be made to deadlock. For example, the following simple
    program causes the call in ep_insert recursively call the original fd's
    ->poll, leading to deadlock:

    #include
    #include

    int main(void) {
    int e1, e2, p[2];
    struct epoll_event evt = {
    .events = EPOLLIN
    };

    e1 = epoll_create(1);
    e2 = epoll_create(2);
    pipe(p);

    epoll_ctl(e2, EPOLL_CTL_ADD, e1, &evt);
    epoll_ctl(e1, EPOLL_CTL_ADD, p[0], &evt);
    write(p[1], p, sizeof p);
    epoll_ctl(e1, EPOLL_CTL_ADD, e2, &evt);

    return 0;
    }

    On insertion, check whether the inserted file is itself a struct epoll,
    and if so, do a recursive walk to detect whether inserting this file would
    create a loop of epoll structures, which could lead to deadlock.

    [nelhage@ksplice.com: Use epmutex to serialize concurrent inserts]
    Signed-off-by: Davide Libenzi
    Signed-off-by: Nelson Elhage
    Reported-by: Nelson Elhage
    Tested-by: Nelson Elhage
    Cc: [2.6.34+, possibly earlier]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
    regulator, mc13xxx: Remove pointless test for unsigned less than zero
    regulator: Fix warning with CONFIG_BUG disabled

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
    Btrfs: fix fiemap bugs with delalloc
    Btrfs: set FMODE_EXCL in btrfs_device->mode
    Btrfs: make btrfs_rm_device() fail gracefully
    Btrfs: Avoid accessing unmapped kernel address
    Btrfs: Fix BTRFS_IOC_SUBVOL_SETFLAGS ioctl
    Btrfs: allow balance to explicitly allocate chunks as it relocates
    Btrfs: put ENOSPC debugging under a mount option

    Linus Torvalds
     
  • …git/tip/linux-2.6-tip

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86 quirk: Fix polarity for IRQ0 pin2 override on SB800 systems
    x86/mrst: Fix apb timer rating when lapic timer is used
    x86: Fix reboot problem on VersaLogic Menlow boards

    Linus Torvalds
     
  • The member of the rtc_class_ops struct is called alarm_irq_enable and
    not alarm_irq_enabled

    CC: Thomas Gleixner
    Signed-off-by: Jelle Martijn Kok
    Signed-off-by: John Stultz
    Signed-off-by: Linus Torvalds

    Jelle Martijn Kok
     
  • * 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
    usb: musb: core: set has_tt flag
    USB: xhci: mark local functions as static
    USB: xhci: fix couple sparse annotations
    USB: xhci: rework xhci_print_ir_set() to get ir set from xhci itself
    USB: Reset USB 3.0 devices on (re)discovery
    xhci: Fix an error in count_sg_trbs_needed()
    xhci: Fix errors in the running total calculations in the TRB math
    xhci: Clarify some expressions in the TRB math
    xhci: Avoid BUG() in interrupt context

    Linus Torvalds
     
  • * 'for-linus' of git://neil.brown.name/md:
    md: Fix - again - partition detection when array becomes active
    Fix over-zealous flush_disk when changing device size.
    md: avoid spinlock problem in blk_throtl_exit
    md: correctly handle probe of an 'mdp' device.
    md: don't set_capacity before array is active.
    md: Fix raid1->raid0 takeover

    Linus Torvalds
     
  • With slab poisoning enabled, I see the following oops:

    Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6b6b73
    ...
    NIP [c0000000006bc61c] .rxrpc_destroy+0x44/0x104
    LR [c0000000006bc618] .rxrpc_destroy+0x40/0x104
    Call Trace:
    [c0000000feb2bc00] [c0000000006bc618] .rxrpc_destroy+0x40/0x104 (unreliable)
    [c0000000feb2bc90] [c000000000349b2c] .key_cleanup+0x1a8/0x20c
    [c0000000feb2bd40] [c0000000000a2920] .process_one_work+0x2f4/0x4d0
    [c0000000feb2be00] [c0000000000a2d50] .worker_thread+0x254/0x468
    [c0000000feb2bec0] [c0000000000a868c] .kthread+0xbc/0xc8
    [c0000000feb2bf90] [c000000000020e00] .kernel_thread+0x54/0x70

    We aren't initialising token->next, but the code in destroy_context relies
    on the list being NULL terminated. Use kzalloc to zero out all the fields.

    Signed-off-by: Anton Blanchard
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Anton Blanchard
     
  • I'm seeing the following oops when testing afs:

    Unable to handle kernel paging request for data at address 0x00000008
    ...
    NIP [c0000000003393b0] .afs_unlink_writeback+0x38/0xc0
    LR [c00000000033987c] .afs_put_writeback+0x98/0xec
    Call Trace:
    [c00000000345f600] [c00000000033987c] .afs_put_writeback+0x98/0xec
    [c00000000345f690] [c00000000033ae80] .afs_write_begin+0x6a4/0x75c
    [c00000000345f790] [c00000000012b77c] .generic_file_buffered_write+0x148/0x320
    [c00000000345f8d0] [c00000000012e1b8] .__generic_file_aio_write+0x37c/0x3e4
    [c00000000345f9d0] [c00000000012e2a8] .generic_file_aio_write+0x88/0xfc
    [c00000000345fa90] [c0000000003390a8] .afs_file_write+0x10c/0x178
    [c00000000345fb40] [c000000000188788] .do_sync_write+0xc4/0x128
    [c00000000345fcc0] [c000000000189658] .vfs_write+0xe8/0x1d8
    [c00000000345fd70] [c000000000189884] .SyS_write+0x68/0xb0
    [c00000000345fe30] [c000000000008564] syscall_exit+0x0/0x40

    afs_write_begin hits an error and calls afs_unlink_writeback. In there
    we do list_del_init on an uninitialised list.

    The patch below initialises ->link when creating the afs_writeback struct.

    Signed-off-by: Anton Blanchard
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Anton Blanchard
     

25 Feb, 2011

14 commits

  • The variable 'val' is a 'unsigned int', so it can never be less than zero.
    This fact makes the "val < 0" part of the test done in BUG_ON() in
    mc13xxx_regulator_get_voltage() rather pointles since it can never have
    any effect.
    This patch removes the pointless test.

    Signed-off-by: Jesper Juhl
    Acked-by: Alberto Panizzo
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Jesper Juhl
     
  • Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/i915: Fix unintended recursion in ironlake_disable_rc6
    drm/i915: fix corruptions on i8xx due to relaxed fencing
    drm/i915: skip FDI & PCH enabling for DP_A
    agp/intel: Experiment with a 855GM GWB bit
    drm/i915: don't enable FDI & transcoder interrupts after all
    drm/i915: Ignore a hung GPU when flushing the framebuffer prior to a switch

    Linus Torvalds
     
  • …ickle/drm-intel into drm-fixes

    * 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel:
    drm/i915: Fix unintended recursion in ironlake_disable_rc6

    Dave Airlie
     
  • * 'kvm-updates/2.6.38' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: SVM: Advance instruction pointer in dr_intercept

    Linus Torvalds
     
  • Signed-off-by: Herton Ronaldo Krzesinski
    Signed-off-by: Linus Torvalds

    Herton Ronaldo Krzesinski
     
  • On some SB800 systems polarity for IOAPIC pin2 is wrongly
    specified as low active by BIOS. This caused system hangs after
    resume from S3 when HPET was used in one-shot mode on such
    systems because a timer interrupt was missed (HPET signal is
    high active).

    For more details see:

    http://marc.info/?l=linux-kernel&m=129623757413868

    Tested-by: Manoj Iyer
    Tested-by: Andre Przywara
    Signed-off-by: Andreas Herrmann
    Cc: Borislav Petkov
    Cc: stable@kernel.org # 37.x, 32.x
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Andreas Herrmann
     
  • MUSB is a non-standard host implementation which
    can handle all speeds with the same core. We need
    to set has_tt flag after commit
    d199c96d41d80a567493e12b8e96ea056a1350c1 (USB: prevent
    buggy hubs from crashing the USB stack) in order for
    MUSB HCD to continue working.

    Signed-off-by: Felipe Balbi
    Cc: stable
    Cc: Alan Stern
    Tested-by: Michael Jones
    Tested-by: Alexander Holler
    Signed-off-by: Greg Kroah-Hartman

    Felipe Balbi
     
  • Commit 074037e (PM / Wakeup: Introduce wakeup source objects and
    event statistics (v3)) caused ACPI wakeup to only work if
    CONFIG_PM_SLEEP is set, but it also worked for CONFIG_PM_SLEEP unset
    before. This can be fixed by making device_set_wakeup_enable(),
    device_init_wakeup() and device_may_wakeup() work in the same way
    as before commit 074037e when CONFIG_PM_SLEEP is unset.

    Reported-and-tested-by: Justin Maggard
    Cc: stable@kernel.org
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • After disabling, we're meant to teardown the bo used for the contexts,
    not recurse into ourselves again and preventing module unload.

    Reported-and-tested-by: Ben Widawsky
    Signed-off-by: Chris Wilson

    Chris Wilson
     
  • The new implementation of bd_link_disk_holder() added by 49731baa41d
    (block: restore multiple bd_link_disk_holder() support) didn't get an
    extra reference for the holder_dir kobject of the slave bdev; however,
    bdev kills holder_dir on removal, not release, so if the slave bdev is
    removed while there are holder links, the holder_dir will be destroyed
    while there still are holder links, which leads to oops later when
    bd_unlink_disk_order() tries to remove those links.

    Make bd_link_disk_holder() grab an extra reference for the slave's
    holder_dir and put it in bd_unlink_disk_holder().

    Signed-off-by: Tejun Heo
    Reported-by: "Hawrylewicz Czarnowski, Przemyslaw"
    Tested-by: "Hawrylewicz Czarnowski, Przemyslaw"
    Cc: Neil Brown
    Cc: Jens Axboe
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • Grab a reference to bdev before calling blkdev_get(), which expects
    the refcount to be already incremented and either returns success or
    decrements the refcount and returns an error.

    The bug was introduced by e525fd89 (block: make blkdev_get/put()
    handle exclusive access), which didn't take into account this behavior
    of blkdev_get().

    Acked-by: Tejun Heo
    Signed-off-by: Miklos Szeredi
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Adam Kovari and others reported that disconnecting an USB drive with
    an ntfs-3g filesystem would cause "kernel BUG at fs/inode.c:1421!" to
    be triggered.

    The BUG could be traced back to ioctl(BLKBSZSET), which would
    erroneously decrement the refcount on the bdev. This is because
    blkdev_get() expects the refcount to be already incremented and either
    returns success or decrements the refcount and returns an error.

    The bug was introduced by e525fd89 (block: make blkdev_get/put()
    handle exclusive access), which didn't take into account this behavior
    of blkdev_get().

    This fixes
    https://bugzilla.kernel.org/show_bug.cgi?id=29202
    (and likely 29792 too)

    Reported-by: Adam Kovari
    Acked-by: Tejun Heo
    Signed-off-by: Miklos Szeredi
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    Unlock vfsmount_lock in do_umount

    Linus Torvalds