1. 09 10月, 2008 5 次提交
    • T
      block: allow disk to have extended device number · 3e1a7ff8
      Tejun Heo 提交于
      Now that disk and partition handlings are mostly unified, it's easy to
      allow disk to have extended device number.  This patch makes
      add_disk() use extended device number if disk->minors is zero.  Both
      sd and ide-disk are updated to use this.
      
      * sd_format_disk_name() is implemented which can generically determine
        the drive name.  This removes disk number restriction stemming from
        limited device names.
      
      * If sd index goes over SD_MAX_DISKS (which can be increased now BTW),
        sd simply doesn't initialize minors letting block layer choose
        extended device number.
      
      * If CONFIG_DEBUG_EXT_DEVT is set, both sd and ide-disk always set
        minors to 0 and use extended device numbers.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      3e1a7ff8
    • T
      block: replace @ext_minors with GENHD_FL_EXT_DEVT · 689d6fac
      Tejun Heo 提交于
      With previous changes, it's meaningless to limit the number of
      partitions.  Replace @ext_minors with GENHD_FL_EXT_DEVT such that
      setting the flag allows the disk to have maximum number of allowed
      partitions (only limited by the number of entries in parsed_partitions
      as determined by MAX_PART constant).
      
      This kills not-too-pretty alloc_disk_ext[_node]() functions and makes
      @minors parameter to alloc_disk[_node]() unnecessary.  The parameter
      is left alone to avoid disturbing the users.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      689d6fac
    • T
      block: implement CONFIG_DEBUG_BLOCK_EXT_DEVT · 870d6656
      Tejun Heo 提交于
      Extended devt introduces non-contiguos device numbers.  This patch
      implements a debug option which forces most devt allocations to be
      from the extended area and spreads them out.  This is enabled by
      default if DEBUG_KERNEL is set and achieves...
      
      1. Detects code paths in kernel or userland which expect predetermined
         consecutive device numbers.
      
      2. When something goes wrong, avoid corruption as adding to the minor
         of earlier partition won't lead to the wrong but valid device.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      870d6656
    • T
      sd/ide-disk: apply extended minors to sd and ide · f615b48c
      Tejun Heo 提交于
      Update sd and ide-disk such that they can take advantage of extended
      minors.
      
      ide-disk already has 64 minors per device and currently doesn't use
      extended minors although after this patch it can be turned on by
      simply tweaking constants.
      
      sd only had 16 minors per device causing problems on certain peculiar
      configurations.  This patch lifts the restriction and enables it to
      use upto 64 minors.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      f615b48c
    • T
      block: don't depend on consecutive minor space · f331c029
      Tejun Heo 提交于
      * Implement disk_devt() and part_devt() and use them to directly
        access devt instead of computing it from ->major and ->first_minor.
      
        Note that all references to ->major and ->first_minor outside of
        block layer is used to determine devt of the disk (the part0) and as
        ->major and ->first_minor will continue to represent devt for the
        disk, converting these users aren't strictly necessary.  However,
        convert them for consistency.
      
      * Implement disk_max_parts() to avoid directly deferencing
        genhd->minors.
      
      * Update bdget_disk() such that it doesn't assume consecutive minor
        space.
      
      * Move devt computation from register_disk() to add_disk() and make it
        the only one (all other usages use the initially determined value).
      
      These changes clean up the code and will help disk->part dereference
      fix and extended block device numbers.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      f331c029
  2. 29 9月, 2008 2 次提交
  3. 24 9月, 2008 1 次提交
    • J
      [SCSI] Fix hang with split requests · 44ea91c5
      James Bottomley 提交于
      Sometimes, particularly for USB devices with the last sector bug,
      requests get completed in chunks.  There's a bug in this in that if
      one of the chunks gets an error, we complete that chunk with an error
      but never move on to the remaining ones, leading to the request
      hanging (because it's not fully completed).
      
      Fix this by completing all remaining chunks if an error is encountered.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      44ea91c5
  4. 14 9月, 2008 1 次提交
    • A
      [SCSI] qla2xxx: Defer enablement of RISC interrupts until ISP initialization completes. · 048feec5
      Andrew Vasquez 提交于
      Josip Rodin noted
      (http://article.gmane.org/gmane.linux.ports.sparc/10152) the
      driver oopsing during registration of an rport to the
      FC-transport layer with a backtrace indicating a dereferencing of
      an shost->shost_data equal to NULL.  David Miller identified a
      small window in driver logic where this could happen:
      
          > Look at how the driver registers the IRQ handler before the host has
          > been registered with the SCSI layer.
          >
          > That leads to a window of time where the shost hasn't been setup
          > fully, yet ISRs can come in and trigger DPC thread events, such as
          > loop resyncs, which expect the transport area to be setup.
          >
          > But it won't be setup, because scsi_add_host() hasn't finished yet.
          >
          > Note that in Josip's crash log, we don't even see the
          >
          >         qla_printk(KERN_INFO, ha, "\n"
          >             " QLogic Fibre Channel HBA Driver: %s\n"
          >             "  QLogic %s - %s\n"
          >             "  ISP%04X: %s @ %s hdma%c, host#=%ld, fw=%s\n",
          >  ...
          >
          > message yet.
          >
          > Which means that the crash occurs between qla2x00_request_irqs()
          > and printing that message.
      
      Close this window by enabling RISC interrupts after the host has
      been registered with the SCSI midlayer.
      Reported-by: NJosip Rodin <joy@entuzijast.net>
      Cc: Stable Tree <stable@kernel.org>
      Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      048feec5
  5. 11 9月, 2008 1 次提交
  6. 29 8月, 2008 5 次提交
  7. 27 8月, 2008 2 次提交
    • F
      sg: restore command permission for TYPE_SCANNER · 14e507b8
      FUJITA Tomonori 提交于
      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: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      14e507b8
    • F
      block: move cmdfilter from gendisk to request_queue · abf54393
      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: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      abf54393
  8. 24 8月, 2008 1 次提交
  9. 16 8月, 2008 21 次提交
  10. 12 8月, 2008 1 次提交