1. 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
  2. 03 1月, 2008 1 次提交
  3. 18 10月, 2007 1 次提交
  4. 13 10月, 2007 6 次提交
  5. 18 7月, 2007 1 次提交
    • R
      Freezer: make kernel threads nonfreezable by default · 83144186
      Rafael J. Wysocki 提交于
      Currently, the freezer treats all tasks as freezable, except for the kernel
      threads that explicitly set the PF_NOFREEZE flag for themselves.  This
      approach is problematic, since it requires every kernel thread to either
      set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
      care for the freezing of tasks at all.
      
      It seems better to only require the kernel threads that want to or need to
      be frozen to use some freezer-related code and to remove any
      freezer-related code from the other (nonfreezable) kernel threads, which is
      done in this patch.
      
      The patch causes all kernel threads to be nonfreezable by default (ie.  to
      have PF_NOFREEZE set by default) and introduces the set_freezable()
      function that should be called by the freezable kernel threads in order to
      unset PF_NOFREEZE.  It also makes all of the currently freezable kernel
      threads call set_freezable(), so it shouldn't cause any (intentional)
      change of behaviour to appear.  Additionally, it updates documentation to
      describe the freezing of tasks more accurately.
      
      [akpm@linux-foundation.org: build fixes]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NNigel Cunningham <nigel@nigel.suspend2.net>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      83144186
  6. 24 5月, 2007 1 次提交
  7. 06 5月, 2007 1 次提交
    • B
      [SCSI] use sysfs configured timeout for EH Start Unit timeout · e555db93
      Brian King 提交于
      Use the sysfs configurable timeout when issuing a START_UNIT
      command from the scsi error handler. This is needed for devices which
      take longer than thirty seconds to respond to the start
      unit. The problem was observed when sending a start unit
      to a disk array device in an ipr RAID adapter, which results
      in the adapter firmware sending potentially multiple commands
      to physical devices as a result of this command, which ended
      up timing out sometimes. This patch does not change the default
      value used for this command.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      e555db93
  8. 18 4月, 2007 1 次提交
    • B
      [SCSI] scsi_error.c: Add EH Start Unit retry · ed773e66
      Brian King 提交于
      Currently, the scsi error handler will issue a START_UNIT
      command if the drive indicates it needs its motor started
      and the allow_restart flag is set in the scsi_device. If,
      after the scsi error handler invokes a host adapter reset
      due to error recovery, a device is in a unit attention
      state AND also needs a START_UNIT, that device will be placed
      offline. The disk array devices on an ipr RAID adapter
      will do exactly this when in a dual initiator configuration.
      This patch adds a single retry to the EH initiated
      START_UNIT.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      
      Patch modified and
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      ed773e66
  9. 03 4月, 2007 1 次提交
    • D
      [SCSI]: Fix scsi_send_eh_cmnd scatterlist handling · 8cc574a3
      David S. Miller 提交于
      This fixes a regression caused by commit:
      
      2dc611de
      
      The sense buffer code in scsi_send_eh_cmnd was changed to use
      alloc_page() and a scatter list, but the sense data copy was not
      updated to match so what we actually get in the sense buffer is total
      grabage starting with the kernel address of the struct page we got.
      Basically the stack frame of scsi_send_eh_cmd() is what ends up
      in the sense buffer.
      
      Depending upon how pointers look on a given platform, you can
      end up getting sr_ioctl.c errors when you mount a cdrom.  If
      the CDROM gives a check condition for GPCMD_GET_CONFIGURATION issued
      by drivers/cdrom/cdrom.c:cdrom_mmc_profile(), sr_ioctl will
      spit out this error message in sr_do_ioctl() with the way pointers
      are on sparc64:
      
      		default:
      			printk(KERN_ERR "%s: CDROM (ioctl) error, command: ", cd->cdi.name);
      			__scsi_print_command(cgc->cmd);
      			scsi_print_sense_hdr("sr", &sshdr);
      			err = -EIO;
      
      This is the error Tom Callaway reported in:
      
      http://marc.info/?l=linux-sparc&m=117407453208101&w=2
      
      Anyways, fix this by using page_address(sgl.page) which is OK
      because we know this is low-mem due to GFP_ATOMIC.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      8cc574a3
  10. 20 3月, 2007 1 次提交
  11. 03 2月, 2007 1 次提交
  12. 01 2月, 2007 1 次提交
  13. 28 1月, 2007 1 次提交
  14. 16 11月, 2006 1 次提交
  15. 11 10月, 2006 1 次提交
  16. 13 9月, 2006 1 次提交
  17. 26 8月, 2006 1 次提交
    • M
      [SCSI] fix scsi_send_eh_cmnd regression · 0db99e33
      Mike Christie 提交于
      The callers of scsi_send_eh_cmnd are setting the cmnd buffer,
      and then scsi_send_eh_cmnd is copying that updated buffer to
      the old_cmnd variable. Then after the command runs, we end up
      copying that old_cmnd var which has the new cmnd to the scsi
      command buffer. When this command gets recent, all types of fun
      things happen like getting TUR or START_STOP commands with
      data and scatterlists.
      
      This patch made against scsi-rc-fixes, has the callers of
      scsi_send_eh_cmnd pass in the command so scsi_send_eh_cmnd
      can do the right thing. This should go into 2.6.18 since this
      fixes a regression added when we removed some of the scsi_cmnd
      fields and replaced them with local variables.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      0db99e33
  18. 10 7月, 2006 1 次提交
    • C
      [SCSI] hide EH backup data outside the scsi_cmnd · 631c228c
      Christoph Hellwig 提交于
      Currently struct scsi_cmnd has various fields that are used to backup
      original data after the corresponding fields have been overridden for
      EH commands.  This means drivers can easily get at it and misuse it.
      Due to the old_ naming this doesn't happen for most of them, but two
      that have different names have been used wrong a lot (see previous
      patch).  Another downside is that they unessecarily bloat the scsi_cmnd
      size.
      
      This patch moves them onstack in scsi_send_eh_cmnd to fix those two
      issues aswell as allowing future EH fixes like moving the EH command
      submissions to use SG lists like everything else.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      631c228c
  19. 27 6月, 2006 1 次提交
  20. 11 6月, 2006 2 次提交
  21. 20 5月, 2006 1 次提交
  22. 15 5月, 2006 1 次提交
    • T
      [PATCH] SCSI: implement shost->host_eh_scheduled · ee7863bc
      Tejun Heo 提交于
      libata needs to invoke EH without scmd.  This patch adds
      shost->host_eh_scheduled to implement such behavior.
      
      Currently the only user of this feature is libata and no general
      interface is defined.  This patch simply adds handling for
      host_eh_scheduled where needed and exports scsi_eh_wakeup() to
      modules.  The rest is upto libata.  This is the result of the
      following discussion.
      
      http://thread.gmane.org/gmane.linux.scsi/23853/focus=9760
      
      In short, SCSI host is not supposed to know about exceptions unrelated
      to specific device or command.  Such exceptions should be handled by
      transport layer proper.  However, the distinction is not essential to
      ATA and libata is planning to depart from SCSI, so, for the time
      being, libata will be using SCSI EH to handle such exceptions.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      ee7863bc
  23. 11 4月, 2006 1 次提交
  24. 13 3月, 2006 1 次提交
  25. 28 2月, 2006 1 次提交
  26. 27 1月, 2006 2 次提交
  27. 15 12月, 2005 1 次提交
    • M
      [SCSI] Convert SCSI mid-layer to scsi_execute_async · 6e68af66
      Mike Christie 提交于
      Add scsi helpers to create really-large-requests and convert
      scsi-ml to scsi_execute_async().
      
      Per Jens's previous comments, I placed this function in scsi_lib.c.
      I made it follow all the queue's limits - I think I did at least :), so
      I removed the warning on the function header.
      
      I think the scsi_execute_* functions should eventually take a request_queue
      and be placed some place where the dm-multipath hw_handler can use them
      if that failover code is going to stay in the kernel. That conversion
      patch will be sent in another mail though.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      6e68af66
  28. 08 12月, 2005 1 次提交
    • M
      [SCSI] fix OOPS due to clearing eh_action prior to aborting eh command · 85631672
      Michael Reed 提交于
      The eh_action semaphore in scsi_eh_send_command is cleared after a
      command timeout.  The command is subsequently aborted and the abort
      will try to call scsi_done() on it.  Unfortunately, the scsi_eh_done()
      routine unconditinally completes the semaphore (which is now null).
      Fix this race by makiong the scsi_eh_done() routine check that the
      semaphore is non null before completing it (mirroring the ordinary
      command done/timeout logic).
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      85631672
  29. 07 11月, 2005 3 次提交
  30. 29 10月, 2005 2 次提交