Skip to content

Commit 3e99b3b

Browse files
Ming Leimartinkpetersen
authored andcommitted
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 <[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]>
1 parent b79d9a0 commit 3e99b3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@
4343
* Size of integrity metadata is usually small, 1 inline sg should
4444
* cover normal cases.
4545
*/
46+
#ifdef CONFIG_ARCH_NO_SG_CHAIN
47+
#define SCSI_INLINE_PROT_SG_CNT 0
48+
#define SCSI_INLINE_SG_CNT 0
49+
#else
4650
#define SCSI_INLINE_PROT_SG_CNT 1
47-
4851
#define SCSI_INLINE_SG_CNT 2
52+
#endif
4953

5054
static struct kmem_cache *scsi_sdb_cache;
5155
static struct kmem_cache *scsi_sense_cache;

0 commit comments

Comments
 (0)