Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19190f5e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "This is quite a bumper crop of fixes: three from Arnd correcting
  various build issues in some configurations, a lock recursion in
  qla2xxx.  Two potentially exploitable issues in hpsa and mvsas, a
  potential null deref in st, a revert of a bdi registration fix that
  turned out to cause even more problems, a set of fixes to allow people
  who only defined MPT2SAS to still work after the mpt2/mpt3sas merger
  and a couple of fixes for issues turned up by the hyper-v storvsc
  driver"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  mpt3sas: fix Kconfig dependency problem for mpt2sas back compatibility
  Revert "scsi: Fix a bdi reregistration race"
  mpt3sas: Add dummy Kconfig option for backwards compatibility
  Fix a memory leak in scsi_host_dev_release()
  block/sd: Fix device-imposed transfer length limits
  scsi_debug: fix prevent_allow+verify regressions
  MAINTAINERS: Add myself as co-maintainer of the SCSI subsystem.
  sd: Make discard granularity match logical block size when LBPRZ=1
  scsi: hpsa: select CONFIG_SCSI_SAS_ATTR
  scsi: advansys needs ISA dma api for ISA support
  scsi_sysfs: protect against double execution of __scsi_remove_device()
  st: fix potential null pointer dereference.
  scsi: report 'INQUIRY result too short' once per host
  advansys: fix big-endian builds
  qla2xxx: Fix rwlock recursion
  hpsa: logical vs bitwise AND typo
  mvsas: don't allow negative timeouts
  mpt3sas: Fix use sas_is_tlr_enabled API before enabling MPI2_SCSIIO_CONTROL_TLR_ON flag
parents a2dbb7b5 be9e2f77
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -9427,8 +9427,10 @@ F: include/scsi/sg.h


SCSI SUBSYSTEM
SCSI SUBSYSTEM
M:	"James E.J. Bottomley" <JBottomley@odin.com>
M:	"James E.J. Bottomley" <JBottomley@odin.com>
L:	linux-scsi@vger.kernel.org
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
M:	"Martin K. Petersen" <martin.petersen@oracle.com>
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
L:	linux-scsi@vger.kernel.org
S:	Maintained
S:	Maintained
F:	drivers/scsi/
F:	drivers/scsi/
F:	include/scsi/
F:	include/scsi/
+16 −20
Original line number Original line Diff line number Diff line
@@ -91,7 +91,8 @@ void blk_set_default_limits(struct queue_limits *lim)
	lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
	lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
	lim->virt_boundary_mask = 0;
	lim->virt_boundary_mask = 0;
	lim->max_segment_size = BLK_MAX_SEGMENT_SIZE;
	lim->max_segment_size = BLK_MAX_SEGMENT_SIZE;
	lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS;
	lim->max_sectors = lim->max_dev_sectors = lim->max_hw_sectors =
		BLK_SAFE_MAX_SECTORS;
	lim->chunk_sectors = 0;
	lim->chunk_sectors = 0;
	lim->max_write_same_sectors = 0;
	lim->max_write_same_sectors = 0;
	lim->max_discard_sectors = 0;
	lim->max_discard_sectors = 0;
@@ -127,6 +128,7 @@ void blk_set_stacking_limits(struct queue_limits *lim)
	lim->max_hw_sectors = UINT_MAX;
	lim->max_hw_sectors = UINT_MAX;
	lim->max_segment_size = UINT_MAX;
	lim->max_segment_size = UINT_MAX;
	lim->max_sectors = UINT_MAX;
	lim->max_sectors = UINT_MAX;
	lim->max_dev_sectors = UINT_MAX;
	lim->max_write_same_sectors = UINT_MAX;
	lim->max_write_same_sectors = UINT_MAX;
}
}
EXPORT_SYMBOL(blk_set_stacking_limits);
EXPORT_SYMBOL(blk_set_stacking_limits);
@@ -214,8 +216,8 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 max_addr)
EXPORT_SYMBOL(blk_queue_bounce_limit);
EXPORT_SYMBOL(blk_queue_bounce_limit);


/**
/**
 * blk_limits_max_hw_sectors - set hard and soft limit of max sectors for request
 * blk_queue_max_hw_sectors - set max sectors for a request for this queue
 * @limits: the queue limits
 * @q:  the request queue for the device
 * @max_hw_sectors:  max hardware sectors in the usual 512b unit
 * @max_hw_sectors:  max hardware sectors in the usual 512b unit
 *
 *
 * Description:
 * Description:
@@ -224,13 +226,19 @@ EXPORT_SYMBOL(blk_queue_bounce_limit);
 *    the device driver based upon the capabilities of the I/O
 *    the device driver based upon the capabilities of the I/O
 *    controller.
 *    controller.
 *
 *
 *    max_dev_sectors is a hard limit imposed by the storage device for
 *    READ/WRITE requests. It is set by the disk driver.
 *
 *    max_sectors is a soft limit imposed by the block layer for
 *    max_sectors is a soft limit imposed by the block layer for
 *    filesystem type requests.  This value can be overridden on a
 *    filesystem type requests.  This value can be overridden on a
 *    per-device basis in /sys/block/<device>/queue/max_sectors_kb.
 *    per-device basis in /sys/block/<device>/queue/max_sectors_kb.
 *    The soft limit can not exceed max_hw_sectors.
 *    The soft limit can not exceed max_hw_sectors.
 **/
 **/
void blk_limits_max_hw_sectors(struct queue_limits *limits, unsigned int max_hw_sectors)
void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
{
{
	struct queue_limits *limits = &q->limits;
	unsigned int max_sectors;

	if ((max_hw_sectors << 9) < PAGE_CACHE_SIZE) {
	if ((max_hw_sectors << 9) < PAGE_CACHE_SIZE) {
		max_hw_sectors = 1 << (PAGE_CACHE_SHIFT - 9);
		max_hw_sectors = 1 << (PAGE_CACHE_SHIFT - 9);
		printk(KERN_INFO "%s: set to minimum %d\n",
		printk(KERN_INFO "%s: set to minimum %d\n",
@@ -238,22 +246,9 @@ void blk_limits_max_hw_sectors(struct queue_limits *limits, unsigned int max_hw_
	}
	}


	limits->max_hw_sectors = max_hw_sectors;
	limits->max_hw_sectors = max_hw_sectors;
	limits->max_sectors = min_t(unsigned int, max_hw_sectors,
	max_sectors = min_not_zero(max_hw_sectors, limits->max_dev_sectors);
				    BLK_DEF_MAX_SECTORS);
	max_sectors = min_t(unsigned int, max_sectors, BLK_DEF_MAX_SECTORS);
}
	limits->max_sectors = max_sectors;
EXPORT_SYMBOL(blk_limits_max_hw_sectors);

/**
 * blk_queue_max_hw_sectors - set max sectors for a request for this queue
 * @q:  the request queue for the device
 * @max_hw_sectors:  max hardware sectors in the usual 512b unit
 *
 * Description:
 *    See description for blk_limits_max_hw_sectors().
 **/
void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
{
	blk_limits_max_hw_sectors(&q->limits, max_hw_sectors);
}
}
EXPORT_SYMBOL(blk_queue_max_hw_sectors);
EXPORT_SYMBOL(blk_queue_max_hw_sectors);


@@ -527,6 +522,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,


	t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
	t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
	t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
	t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
	t->max_dev_sectors = min_not_zero(t->max_dev_sectors, b->max_dev_sectors);
	t->max_write_same_sectors = min(t->max_write_same_sectors,
	t->max_write_same_sectors = min(t->max_write_same_sectors,
					b->max_write_same_sectors);
					b->max_write_same_sectors);
	t->bounce_pfn = min_not_zero(t->bounce_pfn, b->bounce_pfn);
	t->bounce_pfn = min_not_zero(t->bounce_pfn, b->bounce_pfn);
+3 −0
Original line number Original line Diff line number Diff line
@@ -205,6 +205,9 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
	if (ret < 0)
	if (ret < 0)
		return ret;
		return ret;


	max_hw_sectors_kb = min_not_zero(max_hw_sectors_kb, (unsigned long)
					 q->limits.max_dev_sectors >> 1);

	if (max_sectors_kb > max_hw_sectors_kb || max_sectors_kb < page_kb)
	if (max_sectors_kb > max_hw_sectors_kb || max_sectors_kb < page_kb)
		return -EINVAL;
		return -EINVAL;


+2 −0
Original line number Original line Diff line number Diff line
@@ -364,6 +364,7 @@ config SCSI_HPSA
	tristate "HP Smart Array SCSI driver"
	tristate "HP Smart Array SCSI driver"
	depends on PCI && SCSI
	depends on PCI && SCSI
	select CHECK_SIGNATURE
	select CHECK_SIGNATURE
	select SCSI_SAS_ATTRS
	help
	help
	  This driver supports HP Smart Array Controllers (circa 2009).
	  This driver supports HP Smart Array Controllers (circa 2009).
	  It is a SCSI alternative to the cciss driver, which is a block
	  It is a SCSI alternative to the cciss driver, which is a block
@@ -499,6 +500,7 @@ config SCSI_ADVANSYS
	tristate "AdvanSys SCSI support"
	tristate "AdvanSys SCSI support"
	depends on SCSI
	depends on SCSI
	depends on ISA || EISA || PCI
	depends on ISA || EISA || PCI
	depends on ISA_DMA_API || !ISA
	help
	help
	  This is a driver for all SCSI host adapters manufactured by
	  This is a driver for all SCSI host adapters manufactured by
	  AdvanSys. It is documented in the kernel source in
	  AdvanSys. It is documented in the kernel source in
+1 −1
Original line number Original line Diff line number Diff line
@@ -7803,7 +7803,7 @@ adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
		return ASC_BUSY;
		return ASC_BUSY;
	}
	}
	scsiqp->sense_addr = cpu_to_le32(sense_addr);
	scsiqp->sense_addr = cpu_to_le32(sense_addr);
	scsiqp->sense_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE);
	scsiqp->sense_len = SCSI_SENSE_BUFFERSIZE;


	/* Build ADV_SCSI_REQ_Q */
	/* Build ADV_SCSI_REQ_Q */


Loading