1. 12 1月, 2008 9 次提交
    • O
      [SCSI] libiscsi, iscsi_tcp: iscsi pool cleanup · 6320377f
      Olaf Kirch 提交于
      iscsi_pool_init simplified
      
      iscsi_pool_init currently has a lot of duplicate kfree() calls it does
      when some allocation fails. This patch simplifies the code a little by
      using iscsi_pool_free to tear down the pool in case of an error.
      
      iscsi_pool_init also returns a copy of the item array to the caller.
      Not all callers use this array, so we make it optional.
      
      Instead of allocating a second array and return that, allocate just one
      array, of twice the size.
      
      Update users of iscsi_pool_{init,free}
      
      This patch drops the (now useless) second argument to
      iscsi_pool_free, and updates all callers.
      
      It also removes the ctask->r2ts array, which was never
      used anyway. Since the items argument to iscsi_pool_init
      is now optional, we can pass NULL instead.
      Signed-off-by: NOlaf Kirch <olaf.kirch@oracle.com>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      6320377f
    • B
      [SCSI] iscsi_tcp, libiscsi: initial AHS Support · 004d6530
      Boaz Harrosh 提交于
        at libiscsi generic code
        - currently code assumes a storage space of pdu header is allocated
          at llds ctask and is pointed to by iscsi_cmd_task->hdr. Here I add
          a hdr_max field pertaining to that storage, and an hdr_len that
          accumulates the current use of the pdu-header.
      
        - Add an iscsi_next_hdr() inline which returns the next free space
          to write new Header at. Also iscsi_next_hdr() is used to retrieve
          the address at which to write the header-digest.
      
        - Add iscsi_add_hdr(length). What the user do is calls iscsi_next_hdr()
          for address of the new header, than calls iscsi_add_hdr(length) with
          the size of the new header. iscsi_add_hdr() will check if space is
          available and update to the new size. length must be padded according
          to standard.
      
        - Add 2 padding inline helpers thanks to Olaf. Current patch does not
          use them but Following patches will.
          Also moved definition of ISCSI_PAD_LEN to iscsi_proto.h which had
          PAD_WORD_LEN that was never used anywhere.
      
        - Let iscsi_prep_scsi_cmd_pdu() signal an Error return since now  it is
          possible that it will fail.
      
        - I was tired of yet again writing a "this is a digest" comment next to
          sizeof(__u32) so I defined a new ISCSI_DIGEST_SIZE. Now I don't need
          any comments. Changed all places that used sizeof(__u32) or "4" in
          connection to a digest.
      
        iscsi_tcp specific code
        - At struct iscsi_tcp_cmd_task allocate maximum space allowed in
          standard for all headers following the iscsi_cmd header. and mark
          it so in iscsi_tcp_session_create()
        - At iscsi_send_cmd_hdr() retrieve the correct headers size and
          write header digest at iscsi_next_hdr().
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NOlaf Kirch <olaf.kirch@oracle.com>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      004d6530
    • O
      [SCSI] iscsi_tcp: rewrite recv path · da32dd68
      Olaf Kirch 提交于
      Rewrite recv path. Fixes:
      - data digest processing and error handling.
      - ahs support.
      
      Some fixups by Mike Christie
      Signed-off-by: NOlaf Kirch <olaf.kirch@oracle.com>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      da32dd68
    • M
      [SCSI] libiscsi, iscsi_tcp: add device support · 843c0a8a
      Mike Christie 提交于
      This patch adds logical unit reset support. This should work for ib_iser,
      but I have not finished testing that driver so it is not hooked in yet.
      
      This patch also temporarily reverts the iscsi_tcp r2t write out patch.
      That code is completely rewritten in this patchset.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      843c0a8a
    • J
      [SCSI] sd,sr: add early detection of medium not present · 001aac25
      James Bottomley 提交于
      The current scsi_test_unit_ready() is updated to return sense code
      information (in struct scsi_sense_hdr).  The sd and sr drivers are
      changed to interpret the sense code return asc 0x3a as no media and
      adjust the device status accordingly.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      001aac25
    • T
      [SCSI] move single_lun flag from scsi_device to scsi_target · 25d7c363
      Tony Battersby 提交于
      Some SCSI tape medium changers that need the BLIST_SINGLELUN flag have
      the medium changer at one LUN and the tape drive at a different LUN.
      The inquiry string of the tape drive may be different from that of the
      medium changer.  In order for single_lun to be effective, every
      scsi_device under a given scsi_target must have it set.  This means that
      there needs to be a blacklist entry for BOTH the medium changer AND the
      tape drive, which is impractical because some medium changers may be
      paired with a variety of different tape drive models.  It makes more
      sense to put the single_lun flag in scsi_target instead of scsi_device,
      which causes every device at a given target ID to inherit the single_lun
      flag from one LUN.  This makes it possible to blacklist just the medium
      changer and not the tape drive.
      Signed-off-by: NTony Battersby <tonyb@cybernetics.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      25d7c363
    • D
      [SCSI] libsas: Fix various sparse complaints · 8ee24023
      Darrick J. Wong 提交于
      Annotate sas_queuecommand with locking details, and clean up a few
      more sparse warnings about static/non-static declarations.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      8ee24023
    • D
      [SCSI] libsas: Convert sas_proto users to sas_protocol · 5929faf3
      Darrick J. Wong 提交于
      sparse complains about the mixing of enums in libsas.  Since the
      underlying numeric values of both enums are the same, combine them
      to get rid of the warning.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      5929faf3
    • K
      [SCSI] sr,sd: send media state change modification events · 285e9670
      Kay Sievers 提交于
      This will send for a card reader slot (remove/add media):
        UEVENT[1187091572.155884] change   /devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host7/target7:0:0/7:0:0:0 (scsi)
        UEVENT[1187091572.162314] remove   /block/sdb/sdb1 (block)
        UEVENT[1187091572.172464] add      /block/sdb/sdb1 (block)
        UEVENT[1187091572.175408] change   /devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host7/target7:0:0/7:0:0:0 (scsi)
      
      and for a DVD drive (add/eject media):
        UEVENT[1187091590.189159] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
        UEVENT[1187091590.957124] add      /module/isofs (module)
        UEVENT[1187091604.468207] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
      
      Userspace gets events, even for unpartitioned media. This unifies
      the event handling for asynchronoous events (AN) and events caused by
      perodical polling the device from userspace.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      
      [jejb: modified for new event API]
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      285e9670
  2. 07 1月, 2008 1 次提交
    • L
      Revert "scsi: revert "[SCSI] Get rid of scsi_cmnd->done"" · 7b3d9545
      Linus Torvalds 提交于
      This reverts commit ac40532e, which gets
      us back the original cleanup of 6f5391c2.
      
      It turns out that the bug that was triggered by that commit was
      apparently not actually triggered by that commit at all, and just the
      testing conditions had changed enough to make it appear to be due to it.
      
      The real problem seems to have been found by Peter Osterlund:
      
        "pktcdvd sets it [block device size] when opening the /dev/pktcdvd
         device, but when the drive is later opened as /dev/scd0, there is
         nothing that sets it back.  (Btw, 40944 is possible if the disk is a
         CDRW that was formatted with "cdrwtool -m 10236".)
      
         The problem is that pktcdvd opens the cd device in non-blocking mode
         when pktsetup is run, and doesn't close it again until pktsetup -d is
         run.  The effect is that if you meanwhile open the cd device,
         blkdev.c:do_open() doesn't call bd_set_size() because
         bdev->bd_openers is non-zero."
      
      In particular, to repeat the bug (regardless of whether commit
      6f5391c2 is applied or not):
      
        " 1. Start with an empty drive.
          2. pktsetup 0 /dev/scd0
          3. Insert a CD containing an isofs filesystem.
          4. mount /dev/pktcdvd/0 /mnt/tmp
          5. umount /mnt/tmp
          6. Press the eject button.
          7. Insert a DVD containing a non-writable filesystem.
          8. mount /dev/scd0 /mnt/tmp
          9. find /mnt/tmp -type f -print0 | xargs -0 sha1sum >/dev/null
          10. If the DVD contains data beyond the physical size of a CD, you
              get I/O errors in the terminal, and dmesg reports lots of
              "attempt to access beyond end of device" errors."
      
      which in turn is because the nested open after the media change won't
      cause the size to be set properly (because the original open still holds
      the block device, and we only do the bd_set_size() when we don't have
      other people holding the device open).
      
      The proper fix for that is probably to just do something like
      
      	bdev->bd_inode->i_size = (loff_t)get_capacity(disk)<<9;
      
      in fs/block_dev.c:do_open() even for the cases where we're not the
      original opener (but *not* call bd_set_size(), since that will also
      change the block size of the device).
      
      Cc: Peter Osterlund <petero2@telia.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7b3d9545
  3. 03 1月, 2008 1 次提交
  4. 11 12月, 2007 1 次提交
  5. 04 11月, 2007 1 次提交
  6. 02 11月, 2007 1 次提交
  7. 18 10月, 2007 1 次提交
  8. 17 10月, 2007 1 次提交
  9. 16 10月, 2007 5 次提交
  10. 13 10月, 2007 15 次提交
  11. 16 8月, 2007 1 次提交
  12. 04 8月, 2007 1 次提交
  13. 27 7月, 2007 1 次提交
  14. 26 7月, 2007 1 次提交