15 Jan, 2012

1 commit

  • Introduce a wrapper around scsi_cmd_ioctl that takes a block device.

    The function will then be enhanced to detect partition block devices
    and, in that case, subject the ioctls to whitelisting.

    Cc: linux-scsi@vger.kernel.org
    Cc: Jens Axboe
    Cc: James Bottomley
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Linus Torvalds

    Paolo Bonzini
     

12 Jan, 2012

4 commits


07 Nov, 2011

1 commit

  • * '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
     

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

1 commit


30 May, 2011

2 commits

  • It is easier to figure out the context by reading SCSI_SENSE_BUFFERSIZE
    instead of plain '96'.

    Signed-off-by: Liu Yuan
    Signed-off-by: Rusty Russell

    Liu Yuan
     
  • Wire up the virtio_driver config_changed method to get notified about
    config changes raised by the host. For now we just re-read the device
    size to support online resizing of devices, but once we add more
    attributes that might be changeable they could be added as well.

    Note that the config_changed method is called from irq context, so
    we'll have to use the workqueue infrastructure to provide us a proper
    user context for our changes.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Rusty Russell

    Christoph Hellwig
     

23 Oct, 2010

1 commit

  • * 'for-2.6.37/barrier' of git://git.kernel.dk/linux-2.6-block: (46 commits)
    xen-blkfront: disable barrier/flush write support
    Added blk-lib.c and blk-barrier.c was renamed to blk-flush.c
    block: remove BLKDEV_IFL_WAIT
    aic7xxx_old: removed unused 'req' variable
    block: remove the BH_Eopnotsupp flag
    block: remove the BLKDEV_IFL_BARRIER flag
    block: remove the WRITE_BARRIER flag
    swap: do not send discards as barriers
    fat: do not send discards as barriers
    ext4: do not send discards as barriers
    jbd2: replace barriers with explicit flush / FUA usage
    jbd2: Modify ASYNC_COMMIT code to not rely on queue draining on barrier
    jbd: replace barriers with explicit flush / FUA usage
    nilfs2: replace barriers with explicit flush / FUA usage
    reiserfs: replace barriers with explicit flush / FUA usage
    gfs2: replace barriers with explicit flush / FUA usage
    btrfs: replace barriers with explicit flush / FUA usage
    xfs: replace barriers with explicit flush / FUA usage
    block: pass gfp_mask and flags to sb_issue_discard
    dm: convey that all flushes are processed as empty
    ...

    Linus Torvalds
     

21 Oct, 2010

1 commit

  • Remove the BKL usage added in "block: push down BKL into .locked_ioctl".
    Virtio-blk doesn't use the BKL for anything, and doesn't implement any
    ioctl command by itself, but only uses the generic scsi_cmd_ioctl
    which is fine without the BKL.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Rusty Russell

    Christoph Hellwig
     

19 Oct, 2010

1 commit


10 Oct, 2010

1 commit


10 Sep, 2010

3 commits

  • Remove now unused REQ_HARDBARRIER support. virtio_blk already
    supports REQ_FLUSH and the usefulness of REQ_FUA for virtio_blk is
    questionable at this point, so there's nothing else to do to support
    new REQ_FLUSH/FUA interface.

    Signed-off-by: Tejun Heo
    Cc: Michael S. Tsirkin
    Cc: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Barrier is deemed too heavy and will soon be replaced by FLUSH/FUA
    requests. Deprecate barrier. All REQ_HARDBARRIERs are failed with
    -EOPNOTSUPP and blk_queue_ordered() is replaced with simpler
    blk_queue_flush().

    blk_queue_flush() takes combinations of REQ_FLUSH and FUA. If a
    device has write cache and can flush it, it should set REQ_FLUSH. If
    the device can handle FUA writes, it should also set REQ_FUA.

    All blk_queue_ordered() users are converted.

    * ORDERED_DRAIN is mapped to 0 which is the default value.
    * ORDERED_DRAIN_FLUSH is mapped to REQ_FLUSH.
    * ORDERED_DRAIN_FLUSH_FUA is mapped to REQ_FLUSH | REQ_FUA.

    Signed-off-by: Tejun Heo
    Acked-by: Boaz Harrosh
    Cc: Christoph Hellwig
    Cc: Nick Piggin
    Cc: Michael S. Tsirkin
    Cc: Jeremy Fitzhardinge
    Cc: Chris Wright
    Cc: FUJITA Tomonori
    Cc: Geert Uytterhoeven
    Cc: David S. Miller
    Cc: Alasdair G Kergon
    Cc: Pierre Ossman
    Cc: Stefan Weinhuber
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Nobody is making meaningful use of ORDERED_BY_TAG now and queue
    draining for barrier requests will be removed soon which will render
    the advantage of tag ordering moot. Kill ORDERED_BY_TAG. The
    following users are affected.

    * brd: converted to ORDERED_DRAIN.
    * virtio_blk: ORDERED_TAG path was already marked deprecated. Removed.
    * xen-blkfront: ORDERED_TAG case dropped.

    Signed-off-by: Tejun Heo
    Cc: Christoph Hellwig
    Cc: Nick Piggin
    Cc: Michael S. Tsirkin
    Cc: Jeremy Fitzhardinge
    Cc: Chris Wright
    Signed-off-by: Jens Axboe

    Tejun Heo
     

11 Aug, 2010

1 commit

  • * 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits)
    block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n
    xen-blkfront: fix missing out label
    blkdev: fix blkdev_issue_zeroout return value
    block: update request stacking methods to support discards
    block: fix missing export of blk_types.h
    writeback: fix bad _bh spinlock nesting
    drbd: revert "delay probes", feature is being re-implemented differently
    drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
    drbd: Disable delay probes for the upcomming release
    writeback: cleanup bdi_register
    writeback: add new tracepoints
    writeback: remove unnecessary init_timer call
    writeback: optimize periodic bdi thread wakeups
    writeback: prevent unnecessary bdi threads wakeups
    writeback: move bdi threads exiting logic to the forker thread
    writeback: restructure bdi forker loop a little
    writeback: move last_active to bdi
    writeback: do not remove bdi from bdi_list
    writeback: simplify bdi code a little
    writeback: do not lose wake-ups in bdi threads
    ...

    Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and
    drivers/scsi/scsi_error.c as per Jens.

    Linus Torvalds
     

08 Aug, 2010

5 commits

  • As a preparation for the removal of the big kernel
    lock in the block layer, this removes the BKL
    from the common ioctl handling code, moving it
    into every single driver still using it.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • This removes q->prepare_flush_fn completely (changes the
    blk_queue_ordered API).

    Signed-off-by: FUJITA Tomonori
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     
  • use REQ_FLUSH flag instead.

    Signed-off-by: FUJITA Tomonori
    Cc: Rusty Russell
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     
  • On compilation, gcc correctly detects that we do not handle
    all types:

    In function ‘blk_done’:
    warning: enumeration value ‘REQ_TYPE_FS’ not handled in switch
    warning: enumeration value ‘REQ_TYPE_SENSE’ not handled in switch
    warning: enumeration value ‘REQ_TYPE_PM_SUSPEND’ not handled in switch
    warning: enumeration value ‘REQ_TYPE_PM_RESUME’ not handled in switch
    warning: enumeration value ‘REQ_TYPE_PM_SHUTDOWN’ not handled in switch
    warning: enumeration value ‘REQ_TYPE_LINUX_BLOCK’ not handled in switch
    warning: enumeration value ‘REQ_TYPE_ATA_TASKFILE’ not handled in switch
    warning: enumeration value ‘REQ_TYPE_ATA_PC’ not handled in switch

    which is a bit pointless since this is at the end of the request
    processessing. Add a default case that just breaks out.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
    struct requests. This allows much easier grepping for different request
    types instead of unwinding through macros.

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

    Christoph Hellwig
     

05 Aug, 2010

3 commits

  • With the availablility of a sysfs device attribute for examining disk serial
    numbers the ioctl is no longer needed. The user-space changes for this aren't
    upstream yet so we don't have any users to worry about.

    Signed-off-by: Ryan Harper
    Signed-off-by: Rusty Russell

    Ryan Harper
     
  • Create a new attribute for virtio-blk devices that will fetch the serial number
    of the block device. This attribute can be used by udev to create disk/by-id
    symlinks for devices that don't have a UUID (filesystem) associated with them.

    ATA_IDENTIFY strings are special in that they can be up to 20 chars long
    and aren't required to be nul-terminated. The buffer is also zero-padded
    meaning that if the serial is 19 chars or less that we get a nul-terminated
    string. When copying this value into a string buffer, we must be careful to
    copy up to the nul (if it present) and only 20 if it is longer and not to
    attempt to nul terminate; this isn't needed.

    Changes since v1:
    - Added BUILD_BUG_ON() for PAGE_SIZE check
    - Removed min() since BUILD_BUG_ON() handles the check
    - Replaced serial_sysfs() by copying id directly to buffer

    Signed-off-by: Ryan Harper
    Signed-off-by: john cooper
    Signed-off-by: Rusty Russell

    Ryan Harper
     
  • If we want to support barriers with the cache=writethrough mode in qemu
    we need to tell the block layer that we only need queue drains to
    implement a barrier. Follow the model set by SCSI and IDE and assume
    that there is no volatile write cache if the host doesn't advertize it.
    While this might imply working barriers on old qemu versions or other
    hypervisors that actually have a volatile write cache this is only a
    cosmetic issue - these hypervisors don't guarantee any data integrity
    with or without this patch, but with the patch we at least provide
    data ordering.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Rusty Russell

    Christoph Hellwig
     

03 Jun, 2010

1 commit


19 May, 2010

4 commits


10 Apr, 2010

1 commit

  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block: (34 commits)
    cfq-iosched: Fix the incorrect timeslice accounting with forced_dispatch
    loop: Update mtime when writing using aops
    block: expose the statistics in blkio.time and blkio.sectors for the root cgroup
    backing-dev: Handle class_create() failure
    Block: Fix block/elevator.c elevator_get() off-by-one error
    drbd: lc_element_by_index() never returns NULL
    cciss: unlock on error path
    cfq-iosched: Do not merge queues of BE and IDLE classes
    cfq-iosched: Add additional blktrace log messages in CFQ for easier debugging
    i2o: Remove the dangerous kobj_to_i2o_device macro
    block: remove 16 bytes of padding from struct request on 64bits
    cfq-iosched: fix a kbuild regression
    block: make CONFIG_BLK_CGROUP visible
    Remove GENHD_FL_DRIVERFS
    block: Export max number of segments and max segment size in sysfs
    block: Finalize conversion of block limits functions
    block: Fix overrun in lcm() and move it to lib
    vfs: improve writeback_inodes_wb()
    paride: fix off-by-one test
    drbd: fix al-to-on-disk-bitmap for 4k logical_block_size
    ...

    Linus Torvalds
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

15 Mar, 2010

1 commit


02 Mar, 2010

1 commit

  • * 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block: (38 commits)
    block: don't access jiffies when initialising io_context
    cfq: remove 8 bytes of padding from cfq_rb_root on 64 bit builds
    block: fix for "Consolidate phys_segment and hw_segment limits"
    cfq-iosched: quantum check tweak
    blktrace: perform cleanup after setup error
    blkdev: fix merge_bvec_fn return value checks
    cfq-iosched: requests "in flight" vs "in driver" clarification
    cciss: Fix problem with scatter gather elements in the scsi half of the driver
    cciss: eliminate unnecessary pointer use in cciss scsi code
    cciss: do not use void pointer for scsi hba data
    cciss: factor out scatter gather chain block mapping code
    cciss: fix scatter gather chain block dma direction kludge
    cciss: simplify scatter gather code
    cciss: factor out scatter gather chain block allocation and freeing
    cciss: detect bad alignment of scsi commands at build time
    cciss: clarify command list padding calculation
    cfq-iosched: rethink seeky detection for SSDs
    cfq-iosched: rework seeky detection
    block: remove padding from io_context on 64bit builds
    block: Consolidate phys_segment and hw_segment limits
    ...

    Linus Torvalds
     

24 Feb, 2010

1 commit

  • Allow reading various alignment values from the config page. This
    allows the guest to much better align I/O requests depending on the
    storage topology.

    Note that the formats for the config values appear a bit messed up,
    but we follow the formats used by ATA and SCSI so they are expected in
    the storage world.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Rusty Russell

    Christoph Hellwig
     

11 Jan, 2010

1 commit

  • The id_table field of the struct virtio_driver is constant in
    so it is worth to make id_table also constant.

    The semantic match that finds this kind of pattern is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    disable decl_init,const_decl_init;
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Márton Németh
    Cc: Julia Lawall
    Cc: cocci@diku.dk
    Signed-off-by: Jens Axboe

    Márton Németh
     

22 Oct, 2009

3 commits

  • This reverts "Add serial number support for virtio_blk, V4a".

    Turns out that virtio_pci, lguest and s/390 all have an 8 bit limit
    on virtio config space, so noone could ever use this.

    This is coming back later in a cleaner form.

    Signed-off-by: Rusty Russell
    Cc: john cooper
    Cc: Jens Axboe

    Rusty Russell
     
  • Rusty,

    commit 3ca4f5ca73057a617f9444a91022d7127041970a
    virtio: add virtio IDs file
    moved all device IDs into a single file. While the change itself is
    a very good one, it can break userspace applications. For example
    if a userspace tool wanted to get the ID of virtio_net it used to
    include virtio_net.h. This does no longer work, since virtio_net.h
    does not include virtio_ids.h.
    This patch moves all "#include " from the C
    files into the header files, making the header files compatible with
    the old ones.

    In addition, this patch exports virtio_ids.h to userspace.

    CC: Fernando Luis Vazquez Cao
    Signed-off-by: Christian Borntraeger
    Signed-off-by: Rusty Russell

    Christian Borntraeger
     
  • It seems like the addition of QUEUE_FLAG_VIRT caueses major performance
    regressions for Fedora users:

    https://bugzilla.redhat.com/show_bug.cgi?id=509383
    https://bugzilla.redhat.com/show_bug.cgi?id=505695

    while I can't reproduce those extreme regressions myself I think the flag
    is wrong.

    Rationale:

    QUEUE_FLAG_VIRT expands to QUEUE_FLAG_NONROT which casus the queue
    unplugged immediately. This is not a good behaviour for at least
    qemu and kvm where we do have significant overhead for every
    I/O operations. Even with all the latested speeups (native AIO,
    MSI support, zero copy) we can only get native speed for up to 128kb
    I/O requests we already are down to 66% of native performance for 4kb
    requests even on my laptop running the Intel X25-M SSD for which the
    QUEUE_FLAG_NONROT was designed.
    If we ever get virtio-blk overhead low enough that this flag makes
    sense it should only be set based on a feature flag set by the host.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Rusty Russell

    Christoph Hellwig