Skip to content

Commit

Permalink
scsi: core: don't preallocate small SGL in case of NO_SG_CHAIN
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Bart Van Assche <[email protected]>
Cc: Ewan D. Milne <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Guenter Roeck <[email protected]>
Reported-by: Guenter Roeck <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
Ming Lei authored and martinkpetersen committed Jun 20, 2019
1 parent b79d9a0 commit 3e99b3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3e99b3b

Please sign in to comment.