11 Oct, 2011

2 commits


07 Oct, 2011

8 commits


23 Sep, 2011

1 commit

  • The md_notify_reboot() method includes a call to mdelay(1000),
    to deal with "exotic SCSI devices" which are too volatile on
    reboot. The delay is unconditional. Even if the machine does
    not have any block devices, let alone MD devices, the kernel
    shutdown sequence is slowed down.

    1 second does not matter much with physical hardware, but with
    certain virtualization use cases any wasted time in the bootup
    & shutdown sequence counts for alot.

    * drivers/md/md.c: md_notify_reboot() - only impose a delay if
    there was at least one MD device to be stopped during reboot

    Signed-off-by: Daniel P. Berrange
    Signed-off-by: NeilBrown

    Daniel P. Berrange
     

21 Sep, 2011

4 commits

  • Signed-off-by: Wang Sheng-Hui
    Signed-off-by: NeilBrown

    Wang Sheng-Hui
     
  • The 'allclean' flag is used to cache the fact that there is nothing to
    do, so we can avoid waking up and scanning the bitmap regularly.

    The two sorts of pages that might need the attention of the bitmap
    daemon are BITMAP_PAGE_PENDING and BITMAP_PAGE_NEEDWRITE pages.

    So make sure allclean reflects exactly when there are none of those.
    So:
    set it before scanning all pages with either bit set.
    clear it whenever these bits are set
    clear it when we desire not to clear one of these bits.
    don't clear it any other time.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • The flag 'BITMAP_PAGE_CLEAN' has a confusing name as it doesn't mean
    that the page is clean, but rather that there are counters in the page
    which allow bits in the bitmap to be cleared - i.e. maybe cleaning can
    happen.

    So change it to BITMAP_PAGE_PENDING and fix some irregularities:
    - Don't set it in bitmap_init_from_disk as bitmap_set_memory_bits
    sets it when needed
    - in bitmap_daemon_work, if we find a counter that is '1', but
    need_sync is set, then set BITMAP_PAGE_PENDING again (it was
    recently cleared) to ensure we don't forget about this bit.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • Two related problems:

    1/ some error paths call "md_unregister_thread(mddev->thread)"
    without subsequently clearing ->thread. A subsequent call
    to mddev_unlock will try to wake the thread, and crash.

    2/ Most calls to md_wakeup_thread are protected against the thread
    disappeared either by:
    - holding the ->mutex
    - having an active request, so something else must be keeping
    the array active.
    However mddev_unlock calls md_wakeup_thread after dropping the
    mutex and without any certainty of an active request, so the
    ->thread could theoretically disappear.
    So we need a spinlock to provide some protections.

    So change md_unregister_thread to take a pointer to the thread
    pointer, and ensure that it always does the required locking, and
    clears the pointer properly.

    Reported-by: "Moshe Melnikov"
    Signed-off-by: NeilBrown
    cc: stable@kernel.org

    NeilBrown
     

10 Sep, 2011

4 commits

  • 0.90 metadata uses an unsigned 32bit number to count the number of
    kilobytes used from each device.
    This should allow up to 4TB per device.
    However we multiply this by 2 (to get sectors) before casting to a
    larger type, so sizes above 2TB get truncated.

    Also we allow rdev->sectors to be larger than 4TB, so it is possible
    for the array to be resized larger than the metadata can handle.
    So make sure rdev->sectors never exceeds 4TB when 0.90 metadata is in
    used.

    Also the sanity check at the end of super_90_load should include level
    1 as it used ->size too. (RAID0 and Linear don't use ->size at all).

    Reported-by: Pim Zandbergen
    Cc: stable@kernel.org
    Signed-off-by: NeilBrown

    NeilBrown
     
  • A single request to RAID1 or RAID10 might result in multiple
    requests if there are known bad blocks that need to be avoided.

    To detect if we need to submit another write request we test:
    if (sectors_handled < (bio->bi_size >> 9)) {

    However this is after we call **_write_done() so the 'bio' no longer
    belongs to us - the writes could have completed and the bio freed.

    So move the **_write_done call until after the test against
    bio->bi_size.

    This addresses https://bugzilla.kernel.org/show_bug.cgi?id=41862

    Reported-by: Bruno Wolff III
    Tested-by: Bruno Wolff III
    Signed-off-by: NeilBrown

    NeilBrown
     
  • A write can complete at two different places:
    1/ when the last member-device write completes, through
    raid10_end_write_request
    2/ in make_request() when we remove the initial bias from ->remaining.

    These two should do exactly the same thing and the comment says they
    do, but they don't.

    So factor the correct code out into a function and call it in both
    places. This makes the code much more similar to RAID1.

    The difference is only significant if there is an error, and they
    usually take a while, so it is unlikely that there will be an error
    already when make_request is completing, so this is unlikely to cause
    real problems.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • On the last close of an 'md' device which as been stopped, the device
    is destroyed and in particular the request_queue is freed. The free
    is done in a separate thread so it might happen a short time later.

    __blkdev_put calls bdev_inode_switch_bdi *after* ->release has been
    called.

    Since commit f758eeabeb96f878c860e8f110f94ec8820822a9
    bdev_inode_switch_bdi will dereference the 'old' bdi, which lives
    inside a request_queue, to get a spin lock. This causes the last
    close on an md device to sometime take a spin_lock which lives in
    freed memory - which results in an oops.

    So move the called to bdev_inode_switch_bdi before the call to
    ->release.

    Cc: Christoph Hellwig
    Cc: Hugh Dickins
    Cc: Andrew Morton
    Cc: Wu Fengguang
    Acked-by: Wu Fengguang
    Cc: stable@kernel.org
    Signed-off-by: NeilBrown

    NeilBrown
     

31 Aug, 2011

1 commit

  • Waiting for a 'blocked' rdev to become unblocked in the raid5d thread
    cannot work with internal metadata as it is the raid5d thread which
    will clear the blocked flag.
    This wasn't a problem in 3.0 and earlier as we only set the blocked
    flag when external metadata was used then.
    However we now set it always, so we need to be more careful.

    Signed-off-by: NeilBrown

    NeilBrown
     

30 Aug, 2011

1 commit


25 Aug, 2011

4 commits


24 Aug, 2011

7 commits

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

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86-32, vdso: On system call restart after SYSENTER, use int $0x80
    x86, UV: Remove UV delay in starting slave cpus
    x86, olpc: Wait for last byte of EC command to be accepted

    Linus Torvalds
     
  • When we enter a 32-bit system call via SYSENTER or SYSCALL, we shuffle
    the arguments to match the int $0x80 calling convention. This was
    probably a design mistake, but it's what it is now. This causes
    errors if the system call as to be restarted.

    For SYSENTER, we have to invoke the instruction from the vdso as the
    return address is hardcoded. Accordingly, we can simply replace the
    jump in the vdso with an int $0x80 instruction and use the slower
    entry point for a post-restart.

    Suggested-by: Linus Torvalds
    Signed-off-by: H. Peter Anvin
    Link: http://lkml.kernel.org/r/CA%2B55aFztZ=r5wa0x26KJQxvZOaQq8s2v3u50wCyJcA-Sc4g8gQ@mail.gmail.com
    Cc:

    H. Peter Anvin
     
  • Fixes fallout due to the removal of the cast in commit aa462abe8aaf
    ("mm: fix __page_to_pfn for a const struct page argument")

    Signed-off-by: Ian Campbell
    Cc: Andrew Morton
    Acked-by: Geert Uytterhoeven
    Cc: linux-m68k@lists.linux-m68k.org
    Signed-off-by: Linus Torvalds

    Ian Campbell
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    xfs: fix tracing builds inside the source tree
    xfs: remove subdirectories
    xfs: don't expect xfs headers to be in subdirectories

    Linus Torvalds
     
  • * git://git.infradead.org/users/cbou/battery-3.1:
    s3c-adc-battery: Fix compilation error due to missing header (module.h)
    max8997_charger: Needs module.h
    max8998_charger: Needs module.h

    Linus Torvalds
     
  • * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/radeon: Extended DDC Probing for Toshiba L300D Radeon Mobility X1100 HDMI-A Connector
    drm/ttm: ensure ttm for new node is bound before calling move_notify()
    drm/ttm: unbind ttm before destroying node in accel move cleanup
    drm/ttm: fix ttm_bo_add_ttm(user) failure path
    drm/radeon: Make vramlimit parameter actually work.
    drm/radeon: Explicitly print GTT/VRAM offsets on test failure.
    drm/radeon: Take IH ring into account for test size calculation.
    drm/radeon/alpha: Add Alpha support to Radeon DRM code

    Linus Torvalds
     
  • This reverts commit f3637a5f2e2eb391ff5757bc83fb5de8f9726464.

    It turns out that this breaks several drivers, one example being OMAP
    boards which use the on-board OMAP UARTs and the omap-serial driver that
    will not boot to userspace after the commit.

    Paul Walmsley reports that enabling CONFIG_DEBUG_SHIRQ reveals 'IRQ
    handler type mismatch' errors:

    IRQ handler type mismatch for IRQ 74
    current handler: serial idle
    ...

    and the reason is that setting IRQF_ONESHOT will now result in those
    interrupt handlers having different IRQF flags, and thus being
    unsharable. So the commit log in the reverted commit:

    "Since it is required for those users and
    there is no difference for others it makes sense to add this flag
    unconditionally."

    is simply not true: there may not be any difference from a "actions at
    irq time", but there is a *big* difference wrt this flag testing irq
    management (see __setup_irq() in kernel/irq/manage.c).

    One solution may be to stop verifying IRQF_ONESHOT in __setup_irq(), but
    right now the safe course of action is to revert the change. Let's
    revisit this in a later merge window.

    Reported-by: Paul Walmsley
    Cc: Sebastian Andrzej Siewior
    Requested-by: Alan Cox
    Acked-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

23 Aug, 2011

8 commits