Commit 7b03c93d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen
Browse files

scsi: sg: Don't use GFP_ATOMIC in sg_start_req()



sg_start_req() is called from normal user context and can sleep when
waiting for memory.  Switch it to use GFP_KERNEL, which fixes allocation
failures seen with the bio_alloc rework.

Fixes: b520c4ee ("block: split bio_alloc_bioset more clearly into a fast and slowpath")
Reported-by: default avatarShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260415060813.807659-2-hch@lst.de


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 772a896a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1801,7 +1801,7 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
	}

	res = blk_rq_map_user_io(rq, md, hp->dxferp, hp->dxfer_len,
			GFP_ATOMIC, iov_count, iov_count, 1, rw);
			GFP_KERNEL, iov_count, iov_count, 1, rw);
	if (!res) {
		srp->bio = rq->bio;