Commit 3e99b3b13a1fc8f7354edaee4c04f73a07faba69

Authored by Ming Lei
Committed by Martin K. Petersen
1 parent b79d9a09ae

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>

Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff

drivers/scsi/scsi_lib.c
... ... @@ -43,9 +43,13 @@
43 43 * Size of integrity metadata is usually small, 1 inline sg should
44 44 * cover normal cases.
45 45 */
  46 +#ifdef CONFIG_ARCH_NO_SG_CHAIN
  47 +#define SCSI_INLINE_PROT_SG_CNT 0
  48 +#define SCSI_INLINE_SG_CNT 0
  49 +#else
46 50 #define SCSI_INLINE_PROT_SG_CNT 1
47   -
48 51 #define SCSI_INLINE_SG_CNT 2
  52 +#endif
49 53  
50 54 static struct kmem_cache *scsi_sdb_cache;
51 55 static struct kmem_cache *scsi_sense_cache;