summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2019-06-06 16:34:09 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2019-06-20 15:22:57 -0400
commit3e99b3b13a1fc8f7354edaee4c04f73a07faba69 (patch)
tree7936efe53e27851c52abaf41bbf023d83ab31c0f
parentb79d9a09ae23c7047bdce3a15e284398334198ea (diff)
downloadlinux-stable-3e99b3b13a1fc8f7354edaee4c04f73a07faba69.tar.gz
linux-stable-3e99b3b13a1fc8f7354edaee4c04f73a07faba69.tar.bz2
linux-stable-3e99b3b13a1fc8f7354edaee4c04f73a07faba69.zip
scsi: core: don't preallocate small SGL in case of NO_SG_CHAIN
The preallocated small SGL depends on SG_CHAIN so if the ARCH doesn't support SG_CHAIN, preallocation of small SGL can't work at all. Fix this issue by not using small preallocation in case of NO_SG_CHAIN. Cc: Christoph Hellwig <hch@lst.de> Cc: Bart Van Assche <bvanassche@acm.org> Cc: Ewan D. Milne <emilne@redhat.com> Cc: Hannes Reinecke <hare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Reported-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/scsi_lib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 45b43e97505c..30cbea57ea08 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -43,9 +43,13 @@
* Size of integrity metadata is usually small, 1 inline sg should
* cover normal cases.
*/
+#ifdef CONFIG_ARCH_NO_SG_CHAIN
+#define SCSI_INLINE_PROT_SG_CNT 0
+#define SCSI_INLINE_SG_CNT 0
+#else
#define SCSI_INLINE_PROT_SG_CNT 1
-
#define SCSI_INLINE_SG_CNT 2
+#endif
static struct kmem_cache *scsi_sdb_cache;
static struct kmem_cache *scsi_sense_cache;