27 Aug, 2008

1 commit

  • cmd_filter works only for the block layer SG_IO with SCSI block
    devices. It breaks scsi/sg.c, bsg, and the block layer SG_IO with SCSI
    character devices (such as st). We hit a kernel crash with them.

    The problem is that cmd_filter code accesses to gendisk (having struct
    blk_scsi_cmd_filter) via inode->i_bdev->bd_disk. It works for only
    SCSI block device files. With character device files, inode->i_bdev
    leads you to struct cdev. inode->i_bdev->bd_disk->blk_scsi_cmd_filter
    isn't safe.

    SCSI ULDs don't expose gendisk; they keep it private. bsg needs to be
    independent on any protocols. We shouldn't change ULDs to expose their
    gendisk.

    This patch moves struct blk_scsi_cmd_filter from gendisk to
    request_queue, a common object, which eveyone can access to.

    The user interface doesn't change; users can change the filters via
    /sys/block/. gendisk has a pointer to request_queue so the cmd_filter
    code accesses to struct blk_scsi_cmd_filter.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     

22 Jul, 2008

1 commit


16 Jul, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (102 commits)
    [SCSI] scsi_dh: fix kconfig related build errors
    [SCSI] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of
    [SCSI] scsi_cmnd.h: remove double inclusion of linux/blkdev.h
    [SCSI] make struct scsi_{host,target}_type static
    [SCSI] fix locking in host use of blk_plug_device()
    [SCSI] zfcp: Cleanup external header file
    [SCSI] zfcp: Cleanup code in zfcp_erp.c
    [SCSI] zfcp: zfcp_fsf cleanup.
    [SCSI] zfcp: consolidate sysfs things into one file.
    [SCSI] zfcp: Cleanup of code in zfcp_aux.c
    [SCSI] zfcp: Cleanup of code in zfcp_scsi.c
    [SCSI] zfcp: Move status accessors from zfcp to SCSI include file.
    [SCSI] zfcp: Small QDIO cleanups
    [SCSI] zfcp: Adapter reopen for large number of unsolicited status
    [SCSI] zfcp: Fix error checking for ELS ADISC requests
    [SCSI] zfcp: wait until adapter is finished with ERP during auto-port
    [SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver
    [SCSI] sg: Add target reset support
    [SCSI] lib: Add support for the T10 (SCSI) Data Integrity Field CRC
    [SCSI] sd: Move scsi_disk() accessor function to sd.h
    ...

    Linus Torvalds
     

15 Jul, 2008

3 commits

  • * 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits)
    IB/umad: BKL is not needed for ib_umad_open()
    IB/uverbs: BKL is not needed for ib_uverbs_open()
    bf561-coreb: BKL unneeded for open()
    Call fasync() functions without the BKL
    snd/PCM: fasync BKL pushdown
    ipmi: fasync BKL pushdown
    ecryptfs: fasync BKL pushdown
    Bluetooth VHCI: fasync BKL pushdown
    tty_io: fasync BKL pushdown
    tun: fasync BKL pushdown
    i2o: fasync BKL pushdown
    mpt: fasync BKL pushdown
    Remove BKL from remote_llseek v2
    Make FAT users happier by not deadlocking
    x86-mce: BKL pushdown
    vmwatchdog: BKL pushdown
    vmcp: BKL pushdown
    via-pmu: BKL pushdown
    uml-random: BKL pushdown
    uml-mmapper: BKL pushdown
    ...

    Linus Torvalds
     
  • Jonathan Corbet
     
  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block: (37 commits)
    splice: fix generic_file_splice_read() race with page invalidation
    ramfs: enable splice write
    drivers/block/pktcdvd.c: avoid useless memset
    cdrom: revert commit 22a9189 (cdrom: use kmalloced buffers instead of buffers on stack)
    scsi: sr avoids useless buffer allocation
    block: blk_rq_map_kern uses the bounce buffers for stack buffers
    block: add blk_queue_update_dma_pad
    DAC960: push down BKL
    pktcdvd: push BKL down into driver
    paride: push ioctl down into driver
    block: use get_unaligned_* helpers
    block: extend queue_flag bitops
    block: request_module(): use format string
    Add bvec_merge_data to handle stacked devices and ->merge_bvec()
    block: integrity flags can't use bit ops on unsigned short
    cmdfilter: extend default read filter
    sg: fix odd style (extra parenthesis) introduced by cmd filter patch
    block: add bounce support to blk_rq_map_user_iov
    cfq-iosched: get rid of enable_idle being unused warning
    allow userspace to modify scsi command filter on per device basis
    ...

    Linus Torvalds
     

12 Jul, 2008

2 commits

  • If you do a modremove of any sas driver, you run into an oops on
    shutdown when the host is removed (coming from the host bsg device).
    The root cause seems to be that there's a use after free of the
    bsg_class_device: In bsg_kref_release_function, this is used (to do a
    put_device(bcg->parent) after bcg->release has been called. In sas (and
    possibly many other things) bcd->release frees the queue which contains
    the bsg_class_device, so we get a put_device on unreferenced memory.
    Fix this by taking a copy of the pointer to the parent before releasing
    bsg.

    Acked-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    James Bottomley
     
  • We don't need to hold bsg_mutex during bsg_complete_all_commands(). It
    leads to a problem that we block bsg_unregister_queue during
    bsg_complete_all_commands (untill all the outstanding commands
    complete).

    Thanks to Pete Wyckoff for finding the bug and testing the patch.

    The detailed bug report is:

    http://marc.info/?l=linux-scsi&m=121182137132145&w=2

    Tested-by: Pete Wyckoff
    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     

03 Jul, 2008

1 commit


19 May, 2008

1 commit


03 May, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6:
    [SCSI] aic94xx: fix section mismatch
    [SCSI] u14-34f: Fix 32bit only problem
    [SCSI] dpt_i2o: sysfs code
    [SCSI] dpt_i2o: 64 bit support
    [SCSI] dpt_i2o: move from virt_to_bus/bus_to_virt to dma_alloc_coherent
    [SCSI] dpt_i2o: use standard __init / __exit code
    [SCSI] megaraid_sas: fix suspend/resume sections
    [SCSI] aacraid: Add Power Management support
    [SCSI] aacraid: Fix jbod operations scan issues
    [SCSI] aacraid: Fix warning about macro side-effects
    [SCSI] add support for variable length extended commands
    [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer
    [SCSI] bsg: add large command support
    [SCSI] aacraid: Fix down_interruptible() to check the return value correctly
    [SCSI] megaraid_sas; Update the Version and Changelog
    [SCSI] ibmvscsi: Handle non SCSI error status
    [SCSI] bug fix for free list handling
    [SCSI] ipr: Rename ipr's state scsi host attribute to prevent collisions
    [SCSI] megaraid_mbox: fix Dell CERC firmware problem

    Linus Torvalds
     

02 May, 2008

1 commit


01 May, 2008

1 commit


23 Apr, 2008

1 commit

  • This patch adds release callback support, which is called when a bsg
    device goes away. bsg_register_queue() takes a pointer to a callback
    function. This feature is useful for stuff like sas_host that can't
    use the release callback in struct device.

    If a caller doesn't need bsg's release callback, it can call
    bsg_register_queue() with NULL pointer (e.g. scsi devices can use
    release callback in struct device so they don't need bsg's callback).

    With this patch, bsg uses kref for refcounts on bsg devices instead of
    get/put_device in fops->open/release. bsg calls put_device and the
    caller's release callback (if it was registered) in kref_put's
    release.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     

20 Apr, 2008

1 commit


19 Apr, 2008

5 commits


04 Mar, 2008

1 commit

  • The meaning of rq->data_len was changed to the length of an allocated
    buffer from the true data length. It breaks SG_IO friends and
    bsg. This patch restores the meaning of rq->data_len to the true data
    length and adds rq->extra_len to store an extended length (due to
    drain buffer and padding).

    This patch also removes the code to update bio in blk_rq_map_user
    introduced by the commit 40b01b9bbdf51ae543a04744283bf2d56c4a6afa.
    The commit adjusts bio according to memory alignment
    (queue_dma_alignment). However, memory alignment is NOT padding
    alignment. This adjustment also breaks SG_IO friends and bsg. Padding
    alignment needs to be fixed in a proper way (by a separate patch).

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     

19 Feb, 2008

1 commit

  • With padding and draining moved into it, block layer now may extend
    requests as directed by queue parameters, so now a request has two
    sizes - the original request size and the extended size which matches
    the size of area pointed to by bios and later by sgs. The latter size
    is what lower layers are primarily interested in when allocating,
    filling up DMA tables and setting up the controller.

    Both padding and draining extend the data area to accomodate
    controller characteristics. As any controller which speaks SCSI can
    handle underflows, feeding larger data area is safe.

    So, this patch makes the primary data length field, request->data_len,
    indicate the size of full data area and add a separate length field,
    request->raw_data_len, for the unmodified request size. The latter is
    used to report to higher layer (userland) and where the original
    request size should be fed to the controller or device.

    Signed-off-by: Tejun Heo
    Cc: James Bottomley
    Signed-off-by: Jens Axboe

    Tejun Heo
     

31 Jan, 2008

1 commit


12 Jan, 2008

1 commit

  • Currently in BSG, errors returned in req->errors aren't passed back to
    the calling programme (either via SG_IO or via read/write). Fix this,
    while preserving the SCSI convention of returning status in
    req->errors.

    Now update libsas to return errors correctly instead of to ignore
    them.

    Acked-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    James Bottomley
     

16 Oct, 2007

1 commit

  • struct file_operations is generally const (to avoid false sharing and get compile time errors on accidental writing to this shared structure); bsg recently added one of these without the const keyword. Patch below marks it const....

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Jens Axboe

    Arjan van de Ven
     

13 Oct, 2007

1 commit


31 Jul, 2007

1 commit

  • This updates sg_io_v4 structure (based on Doug's RFC, release 1.3).

    The major changes are:

    - add dout_resid field
    - increase tag size to 64 bits to comply with SAM-4 and SRP
    - add dout_iovec_count and din_iovec_count

    dout_iovec_count and din_iovec_count aren't supported now. I'm not
    sure whether they will be supported or not but they were added for the
    possible future changes.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     

30 Jul, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (28 commits)
    [SCSI] mpt fusion: Changes in mptctl.c for logging support
    [SCSI] mpt fusion: Changes in mptfc.c mptlan.c mptsas.c and mptspi.c for logging support
    [SCSI] mpt fusion: Changes in mptscsih.c for logging support
    [SCSI] mpt fusion: Changes in mptbase.c for logging support
    [SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h
    [SCSI] libsas: Fix potential NULL dereference in sas_smp_get_phy_events()
    [SCSI] bsg: Fix build for CONFIG_BLOCK=n
    [SCSI] aacraid: fix Sunrise Lake reset handling
    [SCSI] aacraid: add SCSI SYNCHONIZE_CACHE range checking
    [SCSI] add easyRAID to the no report luns blacklist
    [SCSI] advansys: lindent and other large, uninteresting changes
    [SCSI] aic79xx, aic7xxx: Fix incorrect width setting
    [SCSI] qla2xxx: fix to honor ignored parameters in sysfs attributes
    [SCSI] aacraid: draw line in sand, sundry cleanup and version update
    [SCSI] iscsi_tcp: Turn off bounce buffers
    [SCSI] libiscsi: fix cmd seqeunce number checking
    [SCSI] iscsi_tcp, ib_iser Enable module refcounting for iscsi host template
    [SCSI] libiscsi: make sure session is not blocked when removing host
    [SCSI] libsas: Remove PCI dependencies
    [SCSI] simscsi: convert to use the data buffer accessors
    ...

    Linus Torvalds
     

24 Jul, 2007

3 commits


23 Jul, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (60 commits)
    [SCSI] libsas: make ATA functions selectable by a config option
    [SCSI] bsg: unexport sg v3 helper functions
    [SCSI] bsg: fix bsg_unregister_queue
    [SCSI] bsg: make class backlinks
    [SCSI] 3w-9xxx: add support for 9690SA
    [SCSI] bsg: fix bsg_register_queue error path
    [SCSI] ESP: Increase ESP_BUS_TIMEOUT to 275.
    [SCSI] libsas: fix scr_read/write users and update the libata documentation
    [SCSI] mpt fusion: update Kconfig help
    [SCSI] scsi_transport_sas: add destructor for bsg
    [SCSI] iscsi_tcp: buggered kmalloc()
    [SCSI] qla2xxx: Update version number to 8.02.00-k2.
    [SCSI] qla2xxx: Add ISP25XX support.
    [SCSI] qla2xxx: Use pci_try_set_mwi().
    [SCSI] qla2xxx: Use PCI-X/PCI-Express read control interfaces.
    [SCSI] qla2xxx: Re-factor isp_operations to static structures.
    [SCSI] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
    [SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration.
    [SCSI] qla2xxx: Generalize iIDMA support.
    [SCSI] qla2xxx: Generalize FW-Interface-2 support.
    ...

    Linus Torvalds
     

21 Jul, 2007

3 commits

  • scsi_sysfs_add_sdev ignores the bsg_register_queue failure, so
    bsg_unregister_queue must check whether the queue has a bsg device.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     
  • Currently, bsg doesn't make class backlinks (a process whereby you'd get
    a link to bsg in the device directory in the same way you get one for
    sg). This is because the bsg device is uninitialised, so the class
    device has nothing it can attach to. The fix is to make the bsg device
    point to the cdevice of the entity creating the bsg, necessitating
    changing the bsg_register_queue() prototype into a form that takes the
    generic device.

    Acked-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    James Bottomley
     
  • unfortunately, if IS_ERR(class_dev) is true, that means class_dev isn't
    null and the check in the error leg is pointless ... it's also asking
    for trouble to request unregistration of a device we haven't actually
    created (although it works currently). Fix by using explicit gotos and
    unregisters.

    Acked-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    James Bottomley
     

20 Jul, 2007

2 commits

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • This patch moves the bsg registration into SCSI so that bsg no longer
    has a dependency on the scsi_interface_register API.

    This can be viewed as a temporary expedient until we can get universal
    bsg binding sorted out properly. Also use the sdev bus_id as the
    generic bsg name (to avoid clashes with the queue name).

    Acked-by: FUJITA Tomonori
    Acked-by: Jens Axboe
    Signed-off-by: James Bottomley

    James Bottomley
     

17 Jul, 2007

3 commits