12 Aug, 2013

1 commit

  • commit b7649158a0d241f8d53d13ff7441858539e16656 upstream.

    In blkif_queue_request blkfront iterates over the scatterlist in order
    to set the segments of the request, and in blkif_completion blkfront
    iterates over the raw request, which makes it hard to know the exact
    position of the source and destination memory positions.

    This can be solved by allocating a scatterlist for each request, that
    will be keep until the request is finished, allowing us to copy the
    data back to the original memory without having to iterate over the
    raw request.

    Oracle-Bug: 16660413 - LARGE ASYNCHRONOUS READS APPEAR BROKEN ON 2.6.39-400
    CC: stable@vger.kernel.org
    Signed-off-by: Roger Pau Monné
    Reported-and-Tested-by: Anne Milicia
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Greg Kroah-Hartman

    Roger Pau Monne
     

07 May, 2013

1 commit


20 Mar, 2013

2 commits

  • We already have the frame (pfn of the grant page) stored inside struct
    grant, so there's no need to keep an aditional list of mapped frames
    for a specific request. This reduces memory usage in blkfront.

    Signed-off-by: Roger Pau Monné
    Cc: Konrad Rzeszutek Wilk
    Cc: xen-devel@lists.xen.org
    Signed-off-by: Konrad Rzeszutek Wilk

    Roger Pau Monne
     
  • This prevents us from having to call alloc_page while we are preparing
    the request. Since blkfront was calling alloc_page with a spinlock
    held we used GFP_ATOMIC, which can fail if we are requesting a lot of
    pages since it is using the emergency memory pools.

    Allocating all the pages at init prevents us from having to call
    alloc_page, thus preventing possible failures.

    Signed-off-by: Roger Pau Monné
    Cc: Konrad Rzeszutek Wilk
    Cc: xen-devel@lists.xen.org
    Signed-off-by: Konrad Rzeszutek Wilk

    Roger Pau Monne
     

19 Mar, 2013

2 commits

  • The git commit f84adf4921ae3115502f44ff467b04bf2f88cf04
    (xen-blkfront: drop the use of llist_for_each_entry_safe)

    was a stop-gate to fix a GCC4.1 bug. The appropiate way
    is to actually use an list instead of using an llist.

    As such this patch replaces the usage of llist with an
    list.

    Since we always manipulate the list while holding the io_lock, there's
    no need for additional locking (llist used previously is safe to use
    concurrently without additional locking).

    Signed-off-by: Roger Pau Monné
    CC: stable@vger.kernel.org
    [v1: Redid the git commit description]
    Signed-off-by: Konrad Rzeszutek Wilk

    Roger Pau Monne
     
  • The benefits are:
    * code is cleaner
    * kmemdup adds additional debugging info useful for tracking the real
    place where memory was allocated (CONFIG_DEBUG_SLAB).

    Signed-off-by: Mihnea Dobrescu-Balaur
    Signed-off-by: Konrad Rzeszutek Wilk

    Mihnea Dobrescu-Balaur
     

20 Feb, 2013

1 commit

  • Replace llist_for_each_entry_safe with a while loop.

    llist_for_each_entry_safe can trigger a bug in GCC 4.1, so it's best
    to remove it and use a while loop and do the deletion manually.

    Specifically this bug can be triggered by hot-unplugging a disk, either
    by doing xm block-detach or by save/restore cycle.

    BUG: unable to handle kernel paging request at fffffffffffffff0
    IP: [] blkif_free+0x63/0x130 [xen_blkfront]
    The crash call trace is:
    ...
    bad_area_nosemaphore+0x13/0x20
    do_page_fault+0x25e/0x4b0
    page_fault+0x25/0x30
    ? blkif_free+0x63/0x130 [xen_blkfront]
    blkfront_resume+0x46/0xa0 [xen_blkfront]
    xenbus_dev_resume+0x6c/0x140
    pm_op+0x192/0x1b0
    device_resume+0x82/0x1e0
    dpm_resume+0xc9/0x1a0
    dpm_resume_end+0x15/0x30
    do_suspend+0x117/0x1e0

    When drilling down to the assembler code, on newer GCC it does
    .L29:
    cmpq $-16, %r12 #, persistent_gnt check
    je .L30 #, out of the loop
    .L25:
    ... code in the loop
    testq %r13, %r13 # n
    je .L29 #, back to the top of the loop
    cmpq $-16, %r12 #, persistent_gnt check
    movq 16(%r12), %r13 # .node.next, n
    jne .L25 #, back to the top of the loop
    .L30:

    While on GCC 4.1, it is:
    L78:
    ... code in the loop
    testq %r13, %r13 # n
    je .L78 #, back to the top of the loop
    movq 16(%rbx), %r13 # .node.next, n
    jmp .L78 #, back to the top of the loop

    Which basically means that the exit loop condition instead of
    being:

    &(pos)->member != NULL;

    is:
    ;

    which makes the loop unbound.

    Since xen-blkfront is the only user of the llist_for_each_entry_safe
    macro remove it from llist.h.

    Orabug: 16263164
    CC: stable@vger.kernel.org
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

18 Dec, 2012

2 commits

  • Currently blkfront fails to handle cases in blkif_completion like the
    following:

    1st loop in rq_for_each_segment
    * bv_offset: 3584
    * bv_len: 512
    * offset += bv_len
    * i: 0

    2nd loop:
    * bv_offset: 0
    * bv_len: 512
    * i: 0

    In the second loop i should be 1, since we assume we only wanted to
    read a part of the previous page. This patches fixes this cases where
    only a part of the shared page is read, and blkif_completion assumes
    that if the bv_offset of a bvec is less than the previous bv_offset
    plus the bv_size we have to switch to the next shared page.

    Reported-by: Konrad Rzeszutek Wilk
    Signed-off-by: Roger Pau Monné
    Cc: linux-kernel@vger.kernel.org
    Cc: Konrad Rzeszutek Wilk
    Signed-off-by: Konrad Rzeszutek Wilk

    Roger Pau Monne
     
  • Implement a safe version of llist_for_each_entry, and use it in
    blkif_free. Previously grants where freed while iterating the list,
    which lead to dereferences when trying to fetch the next item.

    Reported-by: Dan Carpenter
    Signed-off-by: Roger Pau Monné
    Acked-by: Andrew Morton
    [v2: Move the llist_for_each_entry_safe in llist.h]
    Signed-off-by: Konrad Rzeszutek Wilk

    Roger Pau Monne
     

27 Nov, 2012

1 commit


04 Nov, 2012

1 commit

  • This patch contains fixes for persistent grants implementation v2:

    * handle == 0 is a valid handle, so initialize grants in blkback
    setting the handle to BLKBACK_INVALID_HANDLE instead of 0. Reported
    by Konrad Rzeszutek Wilk.

    * new_map is a boolean, use "true" or "false" instead of 1 and 0.
    Reported by Konrad Rzeszutek Wilk.

    * blkfront announces the persistent-grants feature as
    feature-persistent-grants, use feature-persistent instead which is
    consistent with blkback and the public Xen headers.

    * Add a consistency check in blkfront to make sure we don't try to
    access segments that have not been set.

    Reported-by: Konrad Rzeszutek Wilk
    Signed-off-by: Roger Pau Monne
    [v1: The new_map int->bool had already been changed]
    Signed-off-by: Konrad Rzeszutek Wilk

    Roger Pau Monne
     

30 Oct, 2012

1 commit

  • This patch implements persistent grants for the xen-blk{front,back}
    mechanism. The effect of this change is to reduce the number of unmap
    operations performed, since they cause a (costly) TLB shootdown. This
    allows the I/O performance to scale better when a large number of VMs
    are performing I/O.

    Previously, the blkfront driver was supplied a bvec[] from the request
    queue. This was granted to dom0; dom0 performed the I/O and wrote
    directly into the grant-mapped memory and unmapped it; blkfront then
    removed foreign access for that grant. The cost of unmapping scales
    badly with the number of CPUs in Dom0. An experiment showed that when
    Dom0 has 24 VCPUs, and guests are performing parallel I/O to a
    ramdisk, the IPIs from performing unmap's is a bottleneck at 5 guests
    (at which point 650,000 IOPS are being performed in total). If more
    than 5 guests are used, the performance declines. By 10 guests, only
    400,000 IOPS are being performed.

    This patch improves performance by only unmapping when the connection
    between blkfront and back is broken.

    On startup blkfront notifies blkback that it is using persistent
    grants, and blkback will do the same. If blkback is not capable of
    persistent mapping, blkfront will still use the same grants, since it
    is compatible with the previous protocol, and simplifies the code
    complexity in blkfront.

    To perform a read, in persistent mode, blkfront uses a separate pool
    of pages that it maps to dom0. When a request comes in, blkfront
    transmutes the request so that blkback will write into one of these
    free pages. Blkback keeps note of which grefs it has already
    mapped. When a new ring request comes to blkback, it looks to see if
    it has already mapped that page. If so, it will not map it again. If
    the page hasn't been previously mapped, it is mapped now, and a record
    is kept of this mapping. Blkback proceeds as usual. When blkfront is
    notified that blkback has completed a request, it memcpy's from the
    shared memory, into the bvec supplied. A record that the {gref, page}
    tuple is mapped, and not inflight is kept.

    Writes are similar, except that the memcpy is peformed from the
    supplied bvecs, into the shared pages, before the request is put onto
    the ring.

    Blkback stores a mapping of grefs=>{page mapped to by gref} in
    a red-black tree. As the grefs are not known apriori, and provide no
    guarantees on their ordering, we have to perform a search
    through this tree to find the page, for every gref we receive. This
    operation takes O(log n) time in the worst case. In blkfront grants
    are stored using a single linked list.

    The maximum number of grants that blkback will persistenly map is
    currently set to RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST, to
    prevent a malicios guest from attempting a DoS, by supplying fresh
    grefs, causing the Dom0 kernel to map excessively. If a guest
    is using persistent grants and exceeds the maximum number of grants to
    map persistenly the newly passed grefs will be mapped and unmaped.
    Using this approach, we can have requests that mix persistent and
    non-persistent grants, and we need to handle them correctly.
    This allows us to set the maximum number of persistent grants to a
    lower value than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST, although
    setting it will lead to unpredictable performance.

    In writing this patch, the question arrises as to if the additional
    cost of performing memcpys in the guest (to/from the pool of granted
    pages) outweigh the gains of not performing TLB shootdowns. The answer
    to that question is `no'. There appears to be very little, if any
    additional cost to the guest of using persistent grants. There is
    perhaps a small saving, from the reduced number of hypercalls
    performed in granting, and ending foreign access.

    Signed-off-by: Oliver Chick
    Signed-off-by: Roger Pau Monne
    Signed-off-by: Konrad Rzeszutek Wilk
    [v1: Fixed up the misuse of bool as int]

    Roger Pau Monne
     

21 Aug, 2012

1 commit

  • flush[_delayed]_work_sync() are now spurious. Mark them deprecated
    and convert all users to flush[_delayed]_work().

    If you're cc'd and wondering what's going on: Now all workqueues are
    non-reentrant and the regular flushes guarantee that the work item is
    not pending or running on any CPU on return, so there's no reason to
    use the sync flushes at all and they're going away.

    This patch doesn't make any functional difference.

    Signed-off-by: Tejun Heo
    Cc: Russell King
    Cc: Paul Mundt
    Cc: Ian Campbell
    Cc: Jens Axboe
    Cc: Mattia Dongili
    Cc: Kent Yoder
    Cc: David Airlie
    Cc: Jiri Kosina
    Cc: Karsten Keil
    Cc: Bryan Wu
    Cc: Benjamin Herrenschmidt
    Cc: Alasdair Kergon
    Cc: Mauro Carvalho Chehab
    Cc: Florian Tobias Schandinat
    Cc: David Woodhouse
    Cc: "David S. Miller"
    Cc: linux-wireless@vger.kernel.org
    Cc: Anton Vorontsov
    Cc: Sangbeom Kim
    Cc: "James E.J. Bottomley"
    Cc: Greg Kroah-Hartman
    Cc: Eric Van Hensbergen
    Cc: Takashi Iwai
    Cc: Steven Whitehouse
    Cc: Petr Vandrovec
    Cc: Mark Fasheh
    Cc: Christoph Hellwig
    Cc: Avi Kivity

    Tejun Heo
     

01 Aug, 2012

1 commit

  • Pull random subsystem patches from Ted Ts'o:
    "This patch series contains a major revamp of how we collect entropy
    from interrupts for /dev/random and /dev/urandom.

    The goal is to addresses weaknesses discussed in the paper "Mining
    your Ps and Qs: Detection of Widespread Weak Keys in Network Devices",
    by Nadia Heninger, Zakir Durumeric, Eric Wustrow, J. Alex Halderman,
    which will be published in the Proceedings of the 21st Usenix Security
    Symposium, August 2012. (See https://factorable.net for more
    information and an extended version of the paper.)"

    Fix up trivial conflicts due to nearby changes in
    drivers/{mfd/ab3100-core.c, usb/gadget/omap_udc.c}

    * tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random: (33 commits)
    random: mix in architectural randomness in extract_buf()
    dmi: Feed DMI table to /dev/random driver
    random: Add comment to random_initialize()
    random: final removal of IRQF_SAMPLE_RANDOM
    um: remove IRQF_SAMPLE_RANDOM which is now a no-op
    sparc/ldc: remove IRQF_SAMPLE_RANDOM which is now a no-op
    [ARM] pxa: remove IRQF_SAMPLE_RANDOM which is now a no-op
    board-palmz71: remove IRQF_SAMPLE_RANDOM which is now a no-op
    isp1301_omap: remove IRQF_SAMPLE_RANDOM which is now a no-op
    pxa25x_udc: remove IRQF_SAMPLE_RANDOM which is now a no-op
    omap_udc: remove IRQF_SAMPLE_RANDOM which is now a no-op
    goku_udc: remove IRQF_SAMPLE_RANDOM which was commented out
    uartlite: remove IRQF_SAMPLE_RANDOM which is now a no-op
    drivers: hv: remove IRQF_SAMPLE_RANDOM which is now a no-op
    xen-blkfront: remove IRQF_SAMPLE_RANDOM which is now a no-op
    n2_crypto: remove IRQF_SAMPLE_RANDOM which is now a no-op
    pda_power: remove IRQF_SAMPLE_RANDOM which is now a no-op
    i2c-pmcmsp: remove IRQF_SAMPLE_RANDOM which is now a no-op
    input/serio/hp_sdc.c: remove IRQF_SAMPLE_RANDOM which is now a no-op
    mfd: remove IRQF_SAMPLE_RANDOM which is now a no-op
    ...

    Linus Torvalds
     

19 Jul, 2012

1 commit

  • With the changes in the random tree, IRQF_SAMPLE_RANDOM is now a
    no-op; interrupt randomness is now collected unconditionally in a very
    low-overhead fashion; see commit 775f4b297b. The IRQF_SAMPLE_RANDOM
    flag was scheduled to be removed in 2009 on the
    feature-removal-schedule, so this patch is preparation for the final
    removal of this flag.

    Signed-off-by: "Theodore Ts'o"
    Cc: Konrad Rzeszutek Wilk
    Cc: Jeremy Fitzhardinge

    Theodore Ts'o
     

12 Jun, 2012

1 commit

  • Part of the ring structure is the 'id' field which is under
    control of the frontend. The frontend stamps it with "some"
    value (this some in this implementation being a value less
    than BLK_RING_SIZE), and when it gets a response expects
    said value to be in the response structure. We have a check
    for the id field when spolling new requests but not when
    de-spolling responses.

    We also add an extra check in add_id_to_freelist to make
    sure that the 'struct request' was not NULL - as we cannot
    pass a NULL to __blk_end_request_all, otherwise that crashes
    (and all the operations that the response is dealing with
    end up with __blk_end_request_all).

    Lastly we also print the name of the operation that failed.

    [v1: s/BUG/WARN/ suggested by Stefano]
    [v2: Add extra check in add_id_to_freelist]
    [v3: Redid op_name per Jan's suggestion]
    [v4: add const * and add WARN on failure returns]
    Acked-by: Jan Beulich
    Acked-by: Stefano Stabellini
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

12 May, 2012

2 commits


14 Apr, 2012

1 commit

  • Pull block driver bits from Jens Axboe:

    - A series of fixes for mtip32xx. Most from Asai at Micron, but also
    one from Greg, getting rid of the dependency on PCIE_HOTPLUG.

    - A few bug fixes for xen-blkfront, and blkback.

    - A virtio-blk fix for Vivek, making resize actually work.

    - Two fixes from Stephen, making larger transfers possible on cciss.
    This is needed for tape drive support.

    * 'for-3.4/drivers' of git://git.kernel.dk/linux-block:
    block: mtip32xx: remove HOTPLUG_PCI_PCIE dependancy
    mtip32xx: dump tagmap on failure
    mtip32xx: fix handling of commands in various scenarios
    mtip32xx: Shorten macro names
    mtip32xx: misc changes
    mtip32xx: Add new sysfs entry 'status'
    mtip32xx: make setting comp_time as common
    mtip32xx: Add new bitwise flag 'dd_flag'
    mtip32xx: fix error handling in mtip_init()
    virtio-blk: Call revalidate_disk() upon online disk resize
    xen/blkback: Make optional features be really optional.
    xen/blkback: Squash the discard support for 'file' and 'phy' type.
    mtip32xx: fix incorrect value set for drv_cleanup_done, and re-initialize and start port in mtip_restart_port()
    cciss: Fix scsi tape io with more than 255 scatter gather elements
    cciss: Initialize scsi host max_sectors for tape drive support
    xen-blkfront: make blkif_io_lock spinlock per-device
    xen/blkfront: don't put bdev right after getting it
    xen-blkfront: use bitmap_set() and bitmap_clear()
    xen/blkback: Enable blkback on HVM guests
    xen/blkback: use grant-table.c hypercall wrappers

    Linus Torvalds
     

07 Apr, 2012

2 commits

  • Pull xen fixes from Konrad Rzeszutek Wilk:
    "Two fixes for regressions:
    * one is a workaround that will be removed in v3.5 with proper fix in
    the tip/x86 tree,
    * the other is to fix drivers to load on PV (a previous patch made
    them only load in PVonHVM mode).

    The rest are just minor fixes in the various drivers and some cleanup
    in the core code."

    * tag 'stable/for-linus-3.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen/pcifront: avoid pci_frontend_enable_msix() falsely returning success
    xen/pciback: fix XEN_PCI_OP_enable_msix result
    xen/smp: Remove unnecessary call to smp_processor_id()
    xen/x86: Workaround 'x86/ioapic: Add register level checks to detect bogus io-apic entries'
    xen: only check xen_platform_pci_unplug if hvm

    Linus Torvalds
     
  • commit b9136d207f08
    xen: initialize platform-pci even if xen_emul_unplug=never

    breaks blkfront/netfront by not loading them because of
    xen_platform_pci_unplug=0 and it is never set for PV guest.

    Signed-off-by: Andrew Jones
    Signed-off-by: Igor Mammedov
    Signed-off-by: Konrad Rzeszutek Wilk

    Igor Mammedov
     

25 Mar, 2012

1 commit

  • Pull more xen updates from Konrad Rzeszutek Wilk:
    "One tiny feature that accidentally got lost in the initial git pull:
    * Add fast-EOI acking of interrupts (clear a bit instead of
    hypercall)
    And bug-fixes:
    * Fix CPU bring-up code missing a call to notify other subsystems.
    * Fix reading /sys/hypervisor even if PVonHVM drivers are not loaded.
    * In Xen ACPI processor driver: remove too verbose WARN messages, fix
    up the Kconfig dependency to be a module by default, and add
    dependency on CPU_FREQ.
    * Disable CPU frequency drivers from loading when booting under Xen
    (as we want the Xen ACPI processor to be used instead).
    * Cleanups in tmem code."

    * tag 'stable/for-linus-3.4-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen/acpi: Fix Kconfig dependency on CPU_FREQ
    xen: initialize platform-pci even if xen_emul_unplug=never
    xen/smp: Fix bringup bug in AP code.
    xen/acpi: Remove the WARN's as they just create noise.
    xen/tmem: cleanup
    xen: support pirq_eoi_map
    xen/acpi-processor: Do not depend on CPU frequency scaling drivers.
    xen/cpufreq: Disable the cpu frequency scaling drivers from loading.
    provide disable_cpufreq() function to disable the API.

    Linus Torvalds
     

22 Mar, 2012

1 commit

  • When xen_emul_unplug=never is specified on kernel command line
    reading files from /sys/hypervisor is broken (returns -EBUSY).
    It is caused by xen_bus dependency on platform-pci and
    platform-pci isn't initialized when xen_emul_unplug=never is
    specified.

    Fix it by allowing platform-pci to ignore xen_emul_unplug=never,
    and do not intialize xen_[blk|net]front instead.

    Signed-off-by: Igor Mammedov
    Acked-by: Stefano Stabellini
    Signed-off-by: Konrad Rzeszutek Wilk

    Igor Mammedov
     

20 Mar, 2012

3 commits

  • This patch moves the global blkif_io_lock to the per-device structure. The
    spinlock seems to exists for two reasons: to disable IRQs when in the interrupt
    handlers for blkfront, and to protect the blkfront VBDs when a detachment is
    requested.

    Having a global blkif_io_lock doesn't make sense given the use case, and it
    drastically hinders performance due to contention. All VBDs with pending IOs
    have to take the lock in order to get work done, which serializes everything
    pretty badly.

    Signed-off-by: Steven Noonan
    Signed-off-by: Konrad Rzeszutek Wilk

    Steven Noonan
     
  • We should hang onto bdev until we're done with it.

    Signed-off-by: Andrew Jones
    [v1: Fixed up git commit description]
    Signed-off-by: Konrad Rzeszutek Wilk

    Andrew Jones
     
  • Use bitmap_set and bitmap_clear rather than modifying individual bits
    in a memory region.

    Signed-off-by: Akinobu Mita
    Cc: Jeremy Fitzhardinge
    Cc: Konrad Rzeszutek Wilk
    Cc: xen-devel@lists.xensource.com
    Cc: virtualization@lists.linux-foundation.org
    Signed-off-by: Konrad Rzeszutek Wilk

    Akinobu Mita
     

16 Jan, 2012

1 commit

  • * 'for-3.3/drivers' of git://git.kernel.dk/linux-block:
    mtip32xx: do rebuild monitoring asynchronously
    xen-blkfront: Use kcalloc instead of kzalloc to allocate array
    mtip32xx: uninitialized variable in mtip_quiesce_io()
    mtip32xx: updates based on feedback
    xen-blkback: convert hole punching to discard request on loop devices
    xen/blkback: Move processing of BLKIF_OP_DISCARD from dispatch_rw_block_io
    xen/blk[front|back]: Enhance discard support with secure erasing support.
    xen/blk[front|back]: Squash blkif_request_rw and blkif_request_discard together
    mtip32xx: update to new ->make_request() API
    mtip32xx: add module.h include to avoid conflict with moduleh tree
    mtip32xx: mark a few more items static
    mtip32xx: ensure that all local functions are static
    mtip32xx: cleanup compat ioctl handling
    mtip32xx: fix warnings/errors on 32-bit compiles
    block: Add driver for Micron RealSSD pcie flash cards

    Linus Torvalds
     

05 Jan, 2012

1 commit

  • The 'name', 'owner', and 'mod_name' members are redundant with the
    identically named fields in the 'driver' sub-structure. Rather than
    switching each instance to specify these fields explicitly, introduce
    a macro to simplify this.

    Eliminate further redundancy by allowing the drvname argument to
    DEFINE_XENBUS_DRIVER() to be blank (in which case the first entry from
    the ID table will be used for .driver.name).

    Also eliminate the questionable xenbus_register_{back,front}end()
    wrappers - their sole remaining purpose was the checking of the
    'owner' field, proper setting of which shouldn't be an issue anymore
    when the macro gets used.

    v2: Restore DRV_NAME for the driver name in xen-pciback.

    Signed-off-by: Jan Beulich
    Cc: Jens Axboe
    Cc: Dmitry Torokhov
    Cc: Florian Tobias Schandinat
    Cc: Ian Campbell
    Cc: David S. Miller
    Signed-off-by: Konrad Rzeszutek Wilk

    Jan Beulich
     

17 Dec, 2011

1 commit

  • The advantage of kcalloc is, that will prevent integer overflows which could
    result from the multiplication of number of elements and size and it is also
    a bit nicer to read.

    The semantic patch that makes this change is available
    in https://lkml.org/lkml/2011/11/25/107

    Signed-off-by: Thomas Meyer
    [v1: Seperated the drivers/block/cciss_scsi.c out of this patch]
    Signed-off-by: Konrad Rzeszutek Wilk

    Thomas Meyer
     

19 Nov, 2011

2 commits


05 Nov, 2011

1 commit

  • * 'for-3.2/drivers' of git://git.kernel.dk/linux-block: (30 commits)
    virtio-blk: use ida to allocate disk index
    hpsa: add small delay when using PCI Power Management to reset for kump
    cciss: add small delay when using PCI Power Management to reset for kump
    xen/blkback: Fix two races in the handling of barrier requests.
    xen/blkback: Check for proper operation.
    xen/blkback: Fix the inhibition to map pages when discarding sector ranges.
    xen/blkback: Report VBD_WSECT (wr_sect) properly.
    xen/blkback: Support 'feature-barrier' aka old-style BARRIER requests.
    xen-blkfront: plug device number leak in xlblk_init() error path
    xen-blkfront: If no barrier or flush is supported, use invalid operation.
    xen-blkback: use kzalloc() in favor of kmalloc()+memset()
    xen-blkback: fixed indentation and comments
    xen-blkfront: fix a deadlock while handling discard response
    xen-blkfront: Handle discard requests.
    xen-blkback: Implement discard requests ('feature-discard')
    xen-blkfront: add BLKIF_OP_DISCARD and discard request struct
    drivers/block/loop.c: remove unnecessary bdev argument from loop_clr_fd()
    drivers/block/loop.c: emit uevent on auto release
    drivers/block/cpqarray.c: use pci_dev->revision
    loop: always allow userspace partitions and optionally support automatic scanning
    ...

    Fic up trivial header file includsion conflict in drivers/block/loop.c

    Linus Torvalds
     

13 Oct, 2011

4 commits

  • ... though after a failed xenbus_register_frontend() all may be lost.

    Acked-by: Ian Campbell
    Signed-off-by: Laszlo Ersek
    Signed-off-by: Konrad Rzeszutek Wilk

    Laszlo Ersek
     
  • Guard against issuing BLKIF_OP_WRITE_BARRIER or BLKIF_OP_FLUSH_CACHE
    by checking whether we successfully negotiated with the backend.
    The negotiation with the backend also sets the q->flush_flags which
    fortunately for us is also used when submitting an bio to us. If
    we don't support barriers or flushes it would be set to zero so
    we should never end up having to deal with REQ_FLUSH | REQ_FUA.

    However, other third party implementations of __make_request that
    might be stacked on top of us might not be so smart, so lets fix this up.

    Acked-by: Jan Beulich
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • When we get -EOPNOTSUPP response for a discard request, we will clear
    the discard flag on the request queue so we won't attempt to send discard
    requests to backend again, and this should be protected under rq->queue_lock.
    However, when we setup the request queue, we pass blkif_io_lock to
    blk_init_queue so rq->queue_lock is blkif_io_lock indeed, and this lock
    is already taken when we are in blkif_interrpt, so remove the
    spin_lock/spin_unlock when we clear the discard flag or we will end up
    with deadlock here

    Signed-off-by: Li Dongyang
    [v1: Updated description a bit and removed comment from source]
    Signed-off-by: Konrad Rzeszutek Wilk

    Li Dongyang
     
  • If the backend advertises 'feature-discard', then interrogate
    the backend for alignment and granularity. Setup the request
    queue with the appropiate values and send the discard operation
    as required.

    Signed-off-by: Li Dongyang
    [v1: Amended commit description]
    Signed-off-by: Konrad Rzeszutek Wilk

    Li Dongyang
     

15 Jul, 2011

2 commits


12 May, 2011

2 commits

  • If the backend supports the 'feature-flush-cache' mode, use that
    instead of the 'feature-barrier' support.

    Currently there are three backends that support the 'feature-flush-cache'
    mode: NetBSD, Solaris and Linux kernel. The 'flush' option is much
    light-weight version than the 'barrier' support so lets try to use as
    there are no filesystems in the kernel that use full barriers anymore.

    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • barrier variable is int, not long. This overflow caused another variable
    override: "err" (in PV code) and "binfo" (in xenlinux code -
    drivers/xen/blkfront/blkfront.c). The later caused incorrect device
    flags (RO/removable etc).

    Signed-off-by: Marek Marczykowski
    Acked-by: Ian Campbell
    [v1: Changed title]
    Signed-off-by: Konrad Rzeszutek Wilk

    Marek Marczykowski