27 Aug, 2008

2 commits

  • sg allowed any command for TYPE_SCANNER. The cmd_filter patchset
    doesn't. We can't change sg's permission since it might break the
    existing software.

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

    FUJITA Tomonori
     
  • 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
     

05 Aug, 2008

1 commit

  • Converting page lock to new locking bitops requires a change of page flag
    operation naming, so we might as well convert it to something nicer
    (!TestSetPageLocked_Lock => trylock_page, SetPageLocked => set_page_locked).

    This also facilitates lockdeping of page lock.

    Signed-off-by: Nick Piggin
    Acked-by: KOSAKI Motohiro
    Acked-by: Peter Zijlstra
    Acked-by: Andrew Morton
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

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

2 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
     

12 Jul, 2008

1 commit


03 Jul, 2008

3 commits


21 Jun, 2008

1 commit


21 May, 2008

1 commit

  • There is a race from when a device is created with device_create() and
    then the drvdata is set with a call to dev_set_drvdata() in which a
    sysfs file could be open, yet the drvdata will be NULL, causing all
    sorts of bad things to happen.

    This patch fixes the problem by using the new function,
    device_create_drvdata(). It fixes the problem in all of the scsi
    drivers that need it.

    Cc: Kay Sievers
    Cc: Doug Gilbert
    Cc: James E.J. Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

29 Apr, 2008

1 commit

  • Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to
    main tree.

    Add correct ->owner to proc_fops to fix reading/module unloading race.

    Signed-off-by: Denis V. Lunev
    Cc: Greg Kroah-Hartman
    Cc: Alexey Dobriyan
    Cc: "Eric W. Biederman"
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denis V. Lunev
     

20 Apr, 2008

1 commit


08 Feb, 2008

1 commit


28 Jan, 2008

1 commit

  • Since the SCSI layer uses the request queues from the block layer, blktrace can
    also be used to trace the requests to all SCSI devices (like SCSI tape drives),
    not only disks. The only missing part is the ioctl interface to start and stop
    tracing.

    This patch adds the SETUP, START, STOP and TEARDOWN ioctls from blktrace to the
    sg device files. With this change, blktrace can be used for SCSI devices like
    for disks, e.g.: blktrace -d /dev/sg1 -o - | blkparse -i -

    Signed-off-by: Christof Schmitt
    Signed-off-by: Jens Axboe

    Christof Schmitt
     

24 Jan, 2008

4 commits

  • The patch "[SCSI] sg: use idr to replace static arrays" in 2.6.24-rc1
    causes a bogus line to appear in /proc/scsi/sg/devices containing
    "-1 -1 -1 -1 -1 -1 -1 -1 -1" when there are no SCSI devices in the
    system. In 2.6.23, /proc/scsi/sg/devices is empty when there are no
    SCSI devices in the system. A similar problem exists with
    /proc/scsi/sg/device_strs. The following patch restores the behavior
    of 2.6.23.

    Signed-off-by: Tony Battersby
    Acked-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • Signed-off-by: FUJITA Tomonori
    Acked-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     
  • If cdev_add fails in sg_add, sg_remove crashes since class_data is
    bogus.

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

    FUJITA Tomonori
     
  • When I use cdparanoia my logs get spammed a lot by

    printk: 464 messages suppressed.
    sg_write: data in/out 30576/30576 bytes for SCSI command 0xbe--guessing data in;
    program cdparanoia not setting count and/or reply_len properly
    printk: 1078 messages suppressed.

    and many more of those. With this patch the message is only printed once
    for a command in a row.

    v1->v2: Prevent rate limit messages too (pointed out by jejb)

    Signed-off-by: Andi Kleen
    Acked-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    Andi Kleen
     

29 Oct, 2007

1 commit

  • After turning on DEBUG_SG I hit a fail:

    kernel BUG at include/linux/scatterlist.h:50!

    sg_build_indirect
    sg_build_reserve
    sg_open
    chrdev_open
    __dentry_open
    do_filp_open
    do_sys_open

    We should initialise the sg list when we allocate it in sg_build_sgat.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Jens Axboe

    Anton Blanchard
     

24 Oct, 2007

1 commit


23 Oct, 2007

1 commit


16 Oct, 2007

1 commit


13 Oct, 2007

2 commits

  • sg uses a scheme to reallocate a single contiguous array of all its
    pointers for lookup and management. This didn't matter too much when sg
    could only attach 256 nodes, but now the maximum has been bumped up to
    32k we're starting to push the limits of the maximum allocatable
    contiguous memory. The solution to this is to eliminate the static
    array and do everything via idr, which this patch does.

    Acked-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    James Bottomley
     
  • unsigned short is too small for sizeof(struct scatterlist) *
    min(q->max_hw_segments, q->max_phys_segments).

    This fixes memory leak with 4096 segments since 16 (likely sg size
    with x86) * 4096 sets sglist_len to zero.

    This might not happen without sg chaining support.

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

    FUJITA Tomonori
     

28 May, 2007

1 commit

  • coverity spotted this (cid #758). All callers dereference sfp, so we dont
    need this check. In addition to this, we dereference it earlier in the
    function.

    Signed-off-by: Eric Sesterhenn
    Acked-by: Douglas Gilbert
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Eric Sesterhenn
     

09 May, 2007

1 commit


18 Apr, 2007

1 commit

  • This patch (as857) modifies the SG_GET_RESERVED_SIZE and
    SG_SET_RESERVED_SIZE ioctls in the sg driver, capping the values at
    the device's request_queue's max_sectors value. This will permit
    cdrecord to obtain a legal value for the maximum transfer length,
    fixing Bugzilla #7026.

    The patch also caps the initial reserved_size value. There's no
    reason to have a reserved buffer larger than max_sectors, since it
    would be impossible to use the extra space.

    The corresponding ioctls in the block layer are modified similarly,
    and the initial value for the reserved_size is set as large as
    possible. This will effectively make it default to max_sectors.
    Note that the actual value is meaningless anyway, since block devices
    don't have a reserved buffer.

    Finally, the BLKSECTGET ioctl is added to sg, so that there will be a
    uniform way for users to determine the actual max_sectors value for
    any raw SCSI transport.

    Signed-off-by: Alan Stern
    Acked-by: Jens Axboe
    Acked-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    Alan Stern
     

09 Nov, 2006

1 commit

  • For certain LLDs the sg driver can cause on oops
    when the transfer length is large and not a
    multiple of PAGE_SIZE.

    ChangeLog:
    - correct the length of the last scatter gather
    list element.
    - fix some printk()s that have the wrong function
    name.

    Signed-off-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    Douglas Gilbert
     

27 Sep, 2006

1 commit

  • This sg driver patch addresses the problem with larger
    page sizes reported by Brian King in this post:
    http://marc.theaimsgroup.com/?l=linux-scsi&m=115867718623631&w=2
    Some other related matters are also addressed. Some of these
    prevent oopses when the SG_SCATTER_SZ or scatter_elem_sz are
    set to inappropriate values.

    The scatter_elem_sz has been tested up to 4 MB which should
    make the largest data transfer with one SCSI command, 32 MB
    less one block, achievable with a relatively small number
    of elements in the scatter gather list.

    ChangeLog:
    - add scatter_elem_sz boot time parameter and sysfs module
    parameter that is initialized to SG_SCATTER_SZ
    - the driver will then adjust scatter_elem_sz to be the
    max(given(scatter_elem_sz), PAGE_SIZE)
    It will also round it up, if necessary, to be a power
    of two
    - clean up sg.h header, correct bad urls and some statements
    that are no longer valid
    - make the def_reserved_size sysfs module attribute writable

    Signed-off-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    Douglas Gilbert
     

26 Aug, 2006

1 commit

  • There's a problem where sg is executing a ->nopage operation on a
    compound page, it actually calls get_page() on the first page in the
    compound rather than the page which is being mapped. The fix is to
    select the correct page by indexing into the compound.

    Signed-off-by: James Bottomley

    Douglas Gilbert
     

03 Jul, 2006

1 commit


01 Jul, 2006

2 commits

  • I got a NULL derefrence in cdev_del+1 when called from sg_remove. By looking at
    the code of sg_add, sg_alloc and sg_remove (all in drivers/scsi/sg.c) I found
    out that sg_add is calling sg_alloc but if it fails afterwards it does not
    deallocate the space that was allocated in sg_alloc and the redundant entry has
    NULL in cdev. When sg_remove is being called, it tries to perform cdev_del to
    this NULL cdev and fails.

    Signed-off-by: Ishai Rabinovitz
    Acked-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    Ishai Rabinovitz
     
  • Signed-off-by: Jörn Engel
    Signed-off-by: Adrian Bunk

    Jörn Engel
     

10 Jun, 2006

1 commit


13 Apr, 2006

3 commits

  • when the sg driver is unable to setup direct IO, free that scatter
    gather list prior to falling back to indirect IO

    Further to this thread started by Bryan Holty:
    http://marc.theaimsgroup.com/?l=linux-scsi&m=114306885116728&w=2

    Here is the reworked patch again. This time it has been
    tested with a program provided by Bryan.

    Signed-off-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    Douglas Gilbert
     
  • Doug found a bug where if scsi_execute_async fails, we are leaking
    sg resources. scsi_do_req never failed so we did not have to handle
    that case before.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     
  • We currently have two implementations of this obsolete ioctl, one in
    the block layer and one in the scsi code. Both of them have drawbacks.

    This patch kills the scsi layer version after updating the block version
    with the missing bits:

    - argument checking
    - use scatterlist I/O
    - set number of retries based on the submitted command

    This is the last user of non-S/G I/O except for the gdth driver, so
    getting this in ASAP and through the scsi tree would be nie to kill
    the non-S/G I/O path. Jens, what do you think about adding a check
    for non-S/G I/O in the midlayer?

    Thanks to Or Gerlitz for testing this patch.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Christoph Hellwig
     

23 Mar, 2006

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (138 commits)
    [SCSI] libata: implement minimal transport template for ->eh_timed_out
    [SCSI] eliminate rphy allocation in favour of expander/end device allocation
    [SCSI] convert mptsas over to end_device/expander allocations
    [SCSI] allow displaying and setting of cache type via sysfs
    [SCSI] add scsi_mode_select to scsi_lib.c
    [SCSI] 3ware 9000 add big endian support
    [SCSI] qla2xxx: update MAINTAINERS
    [SCSI] scsi: move target_destroy call
    [SCSI] fusion - bump version
    [SCSI] fusion - expander hotplug suport in mptsas module
    [SCSI] fusion - exposing raid components in mptsas
    [SCSI] fusion - memory leak, and initializing fields
    [SCSI] fusion - exclosure misspelled
    [SCSI] fusion - cleanup mptsas event handling functions
    [SCSI] fusion - removing target_id/bus_id from the VirtDevice structure
    [SCSI] fusion - static fix's
    [SCSI] fusion - move some debug firmware event debug msgs to verbose level
    [SCSI] fusion - loginfo header update
    [SCSI] add scsi_reprobe_device
    [SCSI] megaraid_sas: fix extended timeout handling
    ...

    Linus Torvalds