06 Mar, 2016

1 commit


05 Feb, 2016

1 commit

  • If MODE SELECT returns with sense '05/91/36' (command lock violation)
    it should always be retried without counting the number of retries.
    During an HBA upgrade or similar circumstances one might see a flood
    of MODE SELECT command from various HBAs, which will easily trigger
    the sense code and exceed the retry count.

    Cc:
    Signed-off-by: Hannes Reinecke
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     

29 Aug, 2015

2 commits

  • Add a ->handler and a ->handler_data field to struct scsi_device and kill
    this indirection. Also move struct scsi_device_handler to scsi_dh.h so that
    changes to it don't require rebuilding every SCSI LLDD.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Signed-off-by: James Bottomley

    Christoph Hellwig
     
  • Add a single list of devices that need non-ALUA device handlers to the core
    scsi_dh code so that we can autoload the modules for them at probe time.

    While this is a little ugly in terms of architecture it actually
    significantly simplifies the code in addition to the new autoloading
    functionality.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Acked-by: Mike Snitzer
    Signed-off-by: James Bottomley

    Christoph Hellwig
     

12 Nov, 2014

4 commits


29 Aug, 2014

1 commit

  • The blk_get_request function may fail in low-memory conditions or during
    device removal (even if __GFP_WAIT is set). To distinguish between these
    errors, modify the blk_get_request call stack to return the appropriate
    ERR_PTR. Verify that all callers check the return status and consider
    IS_ERR instead of a simple NULL pointer check.

    For consistency, make a similar change to the blk_mq_alloc_request leg
    of blk_get_request. It may fail if the queue is dead, or the caller was
    unwilling to wait.

    Signed-off-by: Joe Lawrence
    Acked-by: Jiri Kosina [for pktdvd]
    Acked-by: Boaz Harrosh [for osd]
    Reviewed-by: Jeff Moyer
    Signed-off-by: Jens Axboe

    Joe Lawrence
     

06 Jun, 2014

1 commit

  • With the optimizations around not clearing the full request at alloc
    time, we are leaving some of the needed init for REQ_TYPE_BLOCK_PC
    up to the user allocating the request.

    Add a blk_rq_set_block_pc() that sets the command type to
    REQ_TYPE_BLOCK_PC, and properly initializes the members associated
    with this type of request. Update callers to use this function instead
    of manipulating rq->cmd_type directly.

    Includes fixes from Christoph Hellwig for my half-assed
    attempt.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

25 Oct, 2013

1 commit


24 Sep, 2012

3 commits


23 Feb, 2012

1 commit

  • This patch fixes an unbalanced refcount issue.

    Elevating the lock for both kref_put and also for controller node deletion.
    Previously, controller deletion was protected but the not the kref_put. This
    was causing the other thread to pick up the controller structure which was
    already kref'd zero.

    This was causing the following WARN_ON and also sometimes panic.

    WARNING: at lib/kref.c:43 kref_get+0x2d/0x30() (Not tainted)
    Hardware name: IBM System x3655 -[7985AC1]-
    Modules linked in: fuse scsi_dh_rdac autofs4 nfs lockd fscache nfs_acl
    auth_rpcgss sunrpc 8021q garp stp llc ipv6 ib_srp(U) scsi_transport_srp
    scsi_tgt ib_cm(U) ib_sa(U) ib_uverbs(U) ib_umad(U) mlx4_ib(U) mlx4_core(U)
    ib_mthca(U) ib_mad(U) ib_core(U) dm_mirror dm_region_hash dm_log dm_round_robin
    dm_multipath uinput bnx2 ses enclosure sg ibmpex ibmaem ipmi_msghandler
    serio_raw k8temp hwmon amd64_edac_mod edac_core edac_mce_amd shpchp i2c_piix4
    ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif sata_svw pata_acpi ata_generic
    pata_serverworks aacraid radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core
    dm_mod [last unloaded: freq_table]
    Pid: 13735, comm: srp_daemon Not tainted 2.6.32-71.el6.x86_64 #1
    Call Trace:
    [] warn_slowpath_common+0x87/0xc0
    [] warn_slowpath_null+0x1a/0x20
    [] kref_get+0x2d/0x30
    [] rdac_bus_attach+0x459/0x580 [scsi_dh_rdac]
    [] scsi_dh_handler_attach+0x2a/0x80
    [] scsi_dh_notifier+0x9b/0xa0
    [] notifier_call_chain+0x55/0x80
    [] __blocking_notifier_call_chain+0x5a/0x80
    [] blocking_notifier_call_chain+0x16/0x20
    [] device_add+0x515/0x640
    [] ? attribute_container_device_trigger+0xc4/0xe0
    [] scsi_sysfs_add_sdev+0x89/0x2c0
    [] scsi_probe_and_add_lun+0xea6/0xed0
    [] ? scsi_alloc_target+0x292/0x2d0
    [] __scsi_scan_target+0x121/0x750
    [] ? sysfs_create_file+0x26/0x30
    [] ? device_create_file+0x19/0x20
    [] ? attribute_container_add_attrs+0x78/0x90
    [] ? klist_next+0x4c/0xf0
    [] ? transport_configure+0x0/0x20
    [] ? attribute_container_device_trigger+0xc4/0xe0
    [] scsi_scan_target+0xd0/0xe0
    [] srp_create_target+0x75a/0x890 [ib_srp]
    [] dev_attr_store+0x20/0x30
    [] sysfs_write_file+0xe5/0x170
    [] vfs_write+0xb8/0x1a0
    [] ? audit_syscall_entry+0x272/0x2a0
    [] sys_write+0x51/0x90
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: Babu Moger
    Acked-by: Mike Snitzer
    Signed-off-by: James Bottomley

    Moger, Babu
     

11 Jan, 2012

1 commit


15 Dec, 2011

1 commit


01 Nov, 2011

1 commit


22 Sep, 2011

2 commits


28 Jul, 2011

1 commit

  • rdac hardware handler assumes that there is one-to-one relation ship
    between the host and the controller w.r.t lun. IOW, it does not
    support "multiple storage partitions" within a storage.

    Example:
    HBA1 and HBA2 see lun 0 and 1 in storage A (1)
    HBA3 and HBA4 see lun 0 and 1 in storage A (2)
    HBA5 and HBA6 see lun 0 and 1 in storage A (3)

    luns 0 and 1 in (1), (2) and (3) are totally different.

    But, rdac handler treats the lun 0s (and lun 1s) as the same when
    sending a mode select to the controller, which is wrong.

    This patch makes the rdac hardware handler associate HBA and the
    storage w.r.t lun (and not the host itself).

    Signed-off-by: Chandra Seetharaman
    Signed-off-by: James Bottomley

    Chandra Seetharaman
     

27 Jul, 2011

1 commit

  • rdac hardware handler uses "Subsystem Identifier" from C4 inquiry page
    to uniquely identify a storage. The problem with that is that if any
    any of the bytes are non-ascii, subsys_id will all be spaces (hex
    0x20). This creates lot of problems especially when there are multiple
    rdac storages are connected to the server.

    Use "Storage Array Unique Identifier" from C8 inquiry page, which is the
    world wide unique identifier for the storage array, to uniquely identify
    the storage.

    Signed-off-by: Chandra Seetharaman
    Signed-off-by: James Bottomley

    Chandra Seetharaman
     

21 Jul, 2011

1 commit

  • All these are instances of
    #define NAME value;
    or
    #define NAME(params_opt) value;

    These of course fail to build when used in contexts like
    if(foo $OP NAME)
    while(bar $OP NAME)
    and may silently generate the wrong code in contexts such as
    foo = NAME + 1; /* foo = value; + 1; */
    bar = NAME - 1; /* bar = value; - 1; */
    baz = NAME & quux; /* baz = value; & quux; */

    Reported on comp.lang.c,
    Message-ID:
    Initial analysis of the dangers provided by Keith Thompson in that thread.

    There are many more instances of more complicated macros having unnecessary
    trailing semicolons, but this pile seems to be all of the cases of simple
    values suffering from the problem. (Thus things that are likely to be found
    in one of the contexts above, more complicated ones aren't.)

    Signed-off-by: Phil Carmody
    Signed-off-by: Jiri Kosina

    Phil Carmody
     

01 May, 2011

3 commits

  • Based on the operating modes, handler decides whether to send mode
    select or not. Purpose here is to reduce io-shipping as much as
    possible whenever there is an option.

    Signed-off-by: Babu Moger
    Reviewed-by: Yanling Qi
    Reviewed-by: Sudhir Dachepalli
    Reviewed-by: Somasundaram Krishnasamy
    Reviewed-by: Bob Stankey
    Reviewed-by: Vijay Chauhan
    Signed-off-by: James Bottomley

    Moger, Babu
     
  • This patch detects different operating RDAC modes during the
    discovery. It also collects the information about the preferred path.

    Signed-off-by: Babu Moger
    Reviewed-by: Yanling Qi
    Reviewed-by: Sudhir Dachepalli
    Reviewed-by: Somasundaram Krishnasamy
    Reviewed-by: Bob Stankey
    Reviewed-by: Vijay Chauhan
    Signed-off-by: James Bottomley

    Moger, Babu
     
  • This patch adds definitions to support for different operating modes
    for LSI rdac storage. Currently, rdac support 3 operation modes.

    1. RDAC mode(legacy)
    2. AVT mode
    3. IOSHIP mode

    These definitions are used while activating the path(rdac_activate).

    Signed-off-by: Babu Moger
    Reviewed-by: Yanling Qi
    Reviewed-by: Sudhir Dachepalli
    Reviewed-by: Somasundaram Krishnasamy
    Reviewed-by: Bob Stankey
    Reviewed-by: Vijay Chauhan
    Signed-off-by: James Bottomley

    Moger, Babu
     

15 Mar, 2011

1 commit


13 Feb, 2011

3 commits

  • Adding MODULE_VERSION for scsi_dh_rdac. This will be helpful sometimes
    to get the code level without looking at the code.

    Signed-off-by: Babu Moger
    Signed-off-by: James Bottomley

    Moger, Babu
     
  • instead of doing sizeof(struct X) it's better to do sizeof(*v) where v
    is the variable pointing to struct X.

    Signed-off-by: Hillf Danton
    Signed-off-by: Babu Moger
    Signed-off-by: James Bottomley

    Hillf Danton
     
  • During one of our testing, we noticed that mode select command sent
    from the host did not have the lun_table updated.

    Problem is root caused to the way lun table is updated. Lun table
    update was done after the call to blk_rq_map_kern is made. This was
    causing problem because kernel uses bounce buffer(bio_copy_kern) if
    the address is not aligned. The command buffer updated after the
    call(blk_rq_map_kern) was not going on the wire. Moved the code to
    update the lun_table before the call to fix the problem.

    Signed-off-by: Babu Moger
    Signed-off-by: Somasundaram Krishnasamy
    Signed-off-by: Yanling Qi
    Signed-off-by: James Bottomley

    Moger, Babu
     

26 Oct, 2010

1 commit


28 Jul, 2010

1 commit


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
     

10 Dec, 2009

1 commit


05 Dec, 2009

2 commits

  • Batch up MODE_SELECT in rdac device handler.

    LSI RDAC storage has the capability of handling mode selects for
    multiple luns in a same command. Make use of that ability to send
    as few MODE SELECTs as possible to the storage controller as possible.

    This patch creates a work queue and queues up activate requests
    when a MODE SELECT is sent down the wire. When that MODE SELECT
    completes, it compiles queued up activate requests for multiple
    luns into a single MODE SELECT.

    This reduces the time to do failover/failback of large number of LUNS.

    Signed-off-by: Babu Moger
    Signed-off-by: Chandra Seetharaman
    Signed-off-by: James Bottomley

    Chandra Seetharaman
     
  • Make scsi_dh_activate() function asynchronous, by taking in two additional
    parameters, one is the callback function and the other is the data to call
    the callback function with.

    Signed-off-by: Chandra Seetharaman
    Signed-off-by: James Bottomley

    Chandra Seetharaman
     

02 Oct, 2009

1 commit


12 Sep, 2009

3 commits