1. 30 Jan, 2016 2 commits
    • Himanshu Madhani's avatar
      qla2xxx: Fix warning reported by static checker · dacb5822
      Himanshu Madhani authored
      This patch fixes following warning
      
      drivers/scsi/qla2xxx/qla_target.c:3587 qlt_do_ctio_completion()
      warn: impossible condition '(logged_out == 41) => (0-1 == 41)'
      
      drivers/scsi/qla2xxx/qla_target.c
       3580                  case CTIO_PORT_LOGGED_OUT:
       3581                  case CTIO_PORT_UNAVAILABLE:
       3582                  {
       3583                          bool logged_out = (status & 0xFFFF);
       3584                          ql_dbg(ql_dbg_tgt_mgt, vha, 0xf059,
       3585                              "qla_target(%d): CTIO with %s status %x "
       3586                              "received (state %x, se_cmd %p)\n", vha->vp_idx,
       3587                              (logged_out == CTIO_PORT_LOGGED_OUT) ?
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                          Bool cannot equal 0x26.
       3588                              "PORT LOGGED OUT" : "PORT UNAVAILABLE",
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      dacb5822
    • Mike Christie's avatar
      target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors · 8a9ebe71
      Mike Christie authored
      In a couple places we are not converting to/from the Linux
      block layer 512 bytes sectors.
      
      1.
      
      The request queue values and what we do are a mismatch of
      things:
      
      max_discard_sectors - This is in linux block layer 512 byte
      sectors. We are just copying this to max_unmap_lba_count.
      
      discard_granularity - This is in bytes. We are converting it
      to Linux block layer 512 byte sectors.
      
      discard_alignment - This is in bytes. We are just copying
      this over.
      
      The problem is that the core LIO code exports these values in
      spc_emulate_evpd_b0 and we use them to test request arguments
      in sbc_execute_unmap, but we never convert to the block size
      we export to the initiator. If we are not using 512 byte sectors
      then we are exporting the wrong values or are checks are off.
      And, for the discard_alignment/bytes case we are just plain messed
      up.
      
      2.
      
      blkdev_issue_discard's start and number of sector arguments
      are supposed to be in linux block layer 512 byte sectors. We are
      currently passing in the values we get from the initiator which
      might be based on some other sector size.
      
      There is a similar problem in iblock_execute_write_same where
      the bio functions want values in 512 byte sectors but we are
      passing in what we got from the initiator.
      Signed-off-by: default avatarMike Christie <mchristi@redhat.com>
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      8a9ebe71
  2. 24 Jan, 2016 38 commits