17 Dec, 2011

1 commit

  • * 'for-linus' of git://git.kernel.dk/linux-block:
    block: don't kick empty queue in blk_drain_queue()
    block/swim3: Locking fixes
    loop: Fix discard_alignment default setting
    cfq-iosched: fix cfq_cic_link() race confition
    cfq-iosched: free cic_index if blkio_alloc_blkg_stats fails
    cciss: fix flush cache transfer length
    cciss: Add IRQF_SHARED back in for the non-MSI(X) interrupt handler
    loop: fix loop block driver discard and encryption comment
    block: initialize request_queue's numa node during

    Linus Torvalds
     

14 Dec, 2011

1 commit


12 Dec, 2011

1 commit

  • The old PowerMac swim3 driver has some "interesting" locking issues,
    using a private lock and failing to lock the queue before completing
    requests, which triggered WARN_ONs among others.

    This rips out the private lock, makes everything operate under the
    block queue lock, and generally makes things simpler.

    We used to also share a queue between the two possible instances which
    was problematic since we might pick the wrong controller in some cases,
    so make the queue and the current request per-instance and use
    queuedata to point to our private data which is a lot cleaner.

    We still share the queue lock but then, it's nearly impossible to actually
    use 2 swim3's simultaneously: one would need to have a Wallstreet
    PowerBook, the only machine afaik with two of these on the motherboard,
    and populate both hotswap bays with a floppy drive (the machine ships
    only with one), so nobody cares...

    While at it, add a little fix to clear up stale interrupts when loading
    the driver or plugging a floppy drive in a bay.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Jens Axboe

    Benjamin Herrenschmidt
     

08 Dec, 2011

2 commits


02 Dec, 2011

1 commit


29 Nov, 2011

2 commits


25 Nov, 2011

1 commit


16 Nov, 2011

4 commits

  • Smatch has a new check for Rosenberg type information leaks where structs
    are copied to the user with uninitialized stack data in them. i In this
    case, the pg_write_hdr struct has a hole in it.

    struct pg_write_hdr {
    char magic; /* 0 1 */
    char func; /* 1 1 */
    /* XXX 2 bytes hole, try to pack */
    int dlen; /* 4 4 */

    Signed-off-by: Dan Carpenter
    Cc: Tim Waugh
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Dan Carpenter
     
  • A long time ago, probably in 2002, one of the distros, or maybe more than
    one, loaded block drivers prior to loading the SCSI mid layer. This meant
    that the cciss driver, being a block driver, could not engage the SCSI mid
    layer at init time without panicking, and relied on being poked by a
    userland program after the system was up (and the SCSI mid layer was
    therefore present) to engage the SCSI mid layer.

    This is no longer the case, and cciss can safely rely on the SCSI mid
    layer being present at init time and engage the SCSI mid layer straight
    away. This means that users will see their tape drives and medium
    changers at driver load time without need for a script in /etc/rc.d that
    does this:

    for x in /proc/driver/cciss/cciss*
    do
    echo "engage scsi" > $x
    done

    However, if no tape drives or medium changers are detected, the SCSI mid
    layer will not be engaged. If a tape drive or medium change is later
    hot-added to the system it will then be necessary to use the above script
    or similar for the device(s) to be acceesible.

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     
  • 1) Anyone who has read access to loopdev has permission to call set_status
    and may change important parameters such as lo_offset, lo_sizelimit and
    so on, which contradicts to read access pattern and definitely equals
    to write access pattern.
    2) Add lo_offset over i_size check to prevent blkdev_size overflow.
    ##Testcase_bagin
    #dd if=/dev/zero of=./file bs=1k count=1
    #losetup /dev/loop0 ./file
    /* userspace_application */
    struct loop_info64 loinf;
    fd = open("/dev/loop0", O_RDONLY);
    ioctl(fd, LOOP_GET_STATUS64, &loinf);
    /* Set offset to any value which is bigger than i_size, and sizelimit
    * to nonzero value*/
    loinf.lo_offset = 4096*1024;
    loinf.lo_sizelimit = 1024;
    ioctl(fd, LOOP_SET_STATUS64, &loinf);
    /* After this loop device will have size similar to 0x7fffffffffxxxx */
    #blockdev --getsz /dev/loop0
    ##OUTPUT: 36028797018955968
    ##Testcase_end

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Dmitry Monakhov
     
  • If read was not fully successful we have to fail whole bio to prevent
    information leak of old pages

    ##Testcase_begin
    dd if=/dev/zero of=./file bs=1M count=1
    losetup /dev/loop0 ./file -o 4096
    truncate -s 0 ./file
    # OOps loop offset is now beyond i_size, so read will silently fail.
    # So bio's pages would not be cleared, may which result in information leak.
    hexdump -C /dev/loop0
    ##testcase_end

    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Dmitry Monakhov
     

12 Nov, 2011

1 commit


07 Nov, 2011

2 commits

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     
  • * 'stable/vmalloc-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    net: xen-netback: use API provided by xenbus module to map rings
    block: xen-blkback: use API provided by xenbus module to map rings
    xen: use generic functions instead of xen_{alloc, free}_vm_area()

    Linus Torvalds
     

05 Nov, 2011

2 commits

  • * '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
     
  • * 'for-3.2/core' of git://git.kernel.dk/linux-block: (29 commits)
    block: don't call blk_drain_queue() if elevator is not up
    blk-throttle: use queue_is_locked() instead of lockdep_is_held()
    blk-throttle: Take blkcg->lock while traversing blkcg->policy_list
    blk-throttle: Free up policy node associated with deleted rule
    block: warn if tag is greater than real_max_depth.
    block: make gendisk hold a reference to its queue
    blk-flush: move the queue kick into
    blk-flush: fix invalid BUG_ON in blk_insert_flush
    block: Remove the control of complete cpu from bio.
    block: fix a typo in the blk-cgroup.h file
    block: initialize the bounce pool if high memory may be added later
    block: fix request_queue lifetime handling by making blk_queue_cleanup() properly shutdown
    block: drop @tsk from attempt_plug_merge() and explain sync rules
    block: make get_request[_wait]() fail if queue is dead
    block: reorganize throtl_get_tg() and blk_throtl_bio()
    block: reorganize queue draining
    block: drop unnecessary blk_get/put_queue() in scsi_cmd_ioctl() and blk_get_tg()
    block: pass around REQ_* flags instead of broken down booleans during request alloc/free
    block: move blk_throtl prototypes to block/blk.h
    block: fix genhd refcounting in blkio_policy_parse_and_set()
    ...

    Fix up trivial conflicts due to "mddev_t" -> "struct mddev" conversion
    and making the request functions be of type "void" instead of "int" in
    - drivers/md/{faulty.c,linear.c,md.c,md.h,multipath.c,raid0.c,raid1.c,raid10.c,raid5.c}
    - drivers/staging/zram/zram_drv.c

    Linus Torvalds
     

02 Nov, 2011

1 commit

  • Based on a patch by Mark Wu

    Current index allocation in virtio-blk is based on a monotonically
    increasing variable "index". This means we'll run out of numbers
    after a while. It also could cause confusion about the disk
    name in the case of hot-plugging disks.
    Change virtio-blk to use ida to allocate index, instead.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     

01 Nov, 2011

2 commits


31 Oct, 2011

1 commit

  • Based on a patch by Mark Wu

    Current index allocation in virtio-blk is based on a monotonically
    increasing variable "index". This means we'll run out of numbers
    after a while. It also could cause confusion about the disk
    name in the case of hot-plugging disks.
    Change virtio-blk to use ida to allocate index, instead.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Jens Axboe

    Michael S. Tsirkin
     

29 Oct, 2011

1 commit

  • * 'for-linus' of git://ceph.newdream.net/git/ceph-client:
    libceph: fix double-free of page vector
    ceph: fix 32-bit ino numbers
    libceph: force resend of osd requests if we skip an osdmap
    ceph: use kernel DNS resolver
    ceph: fix ceph_monc_init memory leak
    ceph: let the set_layout ioctl set single traits
    Revert "ceph: don't truncate dirty pages in invalidate work thread"
    ceph: replace leading spaces with tabs
    libceph: warn on msg allocation failures
    libceph: don't complain on msgpool alloc failures
    libceph: always preallocate mon connection
    libceph: create messenger with client
    ceph: document ioctls
    ceph: implement (optional) max read size
    ceph: rename rsize -> rasize
    ceph: make readpages fully async

    Linus Torvalds
     

26 Oct, 2011

2 commits


25 Oct, 2011

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (59 commits)
    MAINTAINERS: linux-m32r is moderated for non-subscribers
    linux@lists.openrisc.net is moderated for non-subscribers
    Drop default from "DM365 codec select" choice
    parisc: Kconfig: cleanup Kernel page size default
    Kconfig: remove redundant CONFIG_ prefix on two symbols
    cris: remove arch/cris/arch-v32/lib/nand_init.S
    microblaze: add missing CONFIG_ prefixes
    h8300: drop puzzling Kconfig dependencies
    MAINTAINERS: microblaze-uclinux@itee.uq.edu.au is moderated for non-subscribers
    tty: drop superfluous dependency in Kconfig
    ARM: mxc: fix Kconfig typo 'i.MX51'
    Fix file references in Kconfig files
    aic7xxx: fix Kconfig references to READMEs
    Fix file references in drivers/ide/
    thinkpad_acpi: Fix printk typo 'bluestooth'
    bcmring: drop commented out line in Kconfig
    btmrvl_sdio: fix typo 'btmrvl_sdio_sd6888'
    doc: raw1394: Trivial typo fix
    CIFS: Don't free volume_info->UNC until we are entirely done with it.
    treewide: Correct spelling of successfully in comments
    ...

    Linus Torvalds
     
  • ….org/pub/scm/linux/kernel/git/konrad/xen

    * 'stable/bug.fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen/p2m/debugfs: Make type_name more obvious.
    xen/p2m/debugfs: Fix potential pointer exception.
    xen/enlighten: Fix compile warnings and set cx to known value.
    xen/xenbus: Remove the unnecessary check.
    xen/irq: If we fail during msi_capability_init return proper error code.
    xen/events: Don't check the info for NULL as it is already done.
    xen/events: BUG() when we can't allocate our event->irq array.

    * 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen: Fix selfballooning and ensure it doesn't go too far
    xen/gntdev: Fix sleep-inside-spinlock
    xen: modify kernel mappings corresponding to granted pages
    xen: add an "highmem" parameter to alloc_xenballooned_pages
    xen/p2m: Use SetPagePrivate and its friends for M2P overrides.
    xen/p2m: Make debug/xen/mmu/p2m visible again.
    Revert "xen/debug: WARN_ON when identity PFN has no _PAGE_IOMAP flag set."

    Linus Torvalds
     

24 Oct, 2011

1 commit


21 Oct, 2011

1 commit


20 Oct, 2011

1 commit


19 Oct, 2011

1 commit


18 Oct, 2011

1 commit


17 Oct, 2011

1 commit

  • Currently the loop device tries to call directly into write_begin/write_end
    instead of going through ->write if it can. This is a fairly nasty shortcut
    as write_begin and write_end are only callbacks for the generic write code
    and expect to be called with filesystem specific locks held.

    This code currently causes various issues for clustered filesystems as it
    doesn't take the required cluster locks, and it also causes issues for XFS
    as it doesn't properly lock against the swapext ioctl as called by the
    defragmentation tools. This in case causes data corruption if
    defragmentation hits a busy loop device in the wrong time window, as
    reported by RH QA.

    The reason why we have this shortcut is that it saves a data copy when
    doing a transformation on the loop device, which is the technical term
    for using cryptoloop (or an XOR transformation). Given that cryptoloop
    has been deprecated in favour of dm-crypt my opinion is that we should
    simply drop this shortcut instead of finding complicated ways to to
    introduce a formal interface for this shortcut.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

15 Oct, 2011

1 commit

  • The patch titled: "xen/blkback: Fix the inhibition to map pages
    when discarding sector ranges." had the right idea except that
    it used the wrong comparison operator. It had == instead of !=.

    This fixes the bug where all (except discard) operations would
    have been ignored.

    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

13 Oct, 2011

6 commits

  • The 'operation' parameters are the ones provided to the bio layer while
    the req->operation are the ones passed in between the backend and
    frontend. We used the wrong 'operation' value to squash the
    call to map pages when processing the discard operation resulting
    in an hypercall that did nothing. Lets guard against going in the
    mapping function by checking for the proper operation type.

    CC: Li Dongyang
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • We did not increment the amount of sectors written to disk
    b/c we tested for the == WRITE which is incorrect - as the
    operations are more of WRITE_FLUSH, WRITE_ODIRECT. This patch
    fixes it by doing a & WRITE check.

    CC: stable@kernel.org
    Reported-by: Andy Burns
    Suggested-by: Ian Campbell
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • We emulate the barrier requests by draining the outstanding bio's
    and then sending the WRITE_FLUSH command. To drain the I/Os
    we use the refcnt that is used during disconnect to wait for all
    the I/Os before disconnecting from the frontend. We latch on its
    value and if it reaches either the threshold for disconnect or when
    there are no more outstanding I/Os, then we have drained all I/Os.

    Suggested-by: Christopher Hellwig
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • ... 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
     
  • This fixes the problem of three of those four memset()-s having
    improper size arguments passed: Sizeof a pointer-typed expression
    returns the size of the pointer, not that of the pointed to data.

    It also reverts using kmalloc() instead of kzalloc() for the allocation
    of the pending grant handles array, as that array gets fully
    initialized in a subsequent loop.

    Reported-by: Julia Lawall
    Signed-off-by: Jan Beulich
    Signed-off-by: Konrad Rzeszutek Wilk

    Jan Beulich