]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nbd: fix partial sending
authorMing Lei <ming.lei@redhat.com>
Tue, 29 Oct 2024 01:19:41 +0000 (09:19 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Jan 2025 14:46:20 +0000 (07:46 -0700)
commit8337b029f788272f5273887ccefb8226404658ce
tree062a3cbda68ad525f2cc7d4683c1e4f2eb2e35f1
parent7c0be4ead1f8f5f8be0803f347de0de81e3b8e1c
nbd: fix partial sending

nbd driver sends request header and payload with multiple call of
sock_sendmsg, and partial sending can't be avoided. However, nbd driver
returns BLK_STS_RESOURCE to block core in this situation. This way causes
one issue: request->tag may change in the next run of nbd_queue_rq(), but
the original old tag has been sent as part of header cookie, this way
confuses nbd driver reply handling, since the real request can't be
retrieved any more with the obsolete old tag.

Fix it by retrying sending directly in per-socket work function,
meantime return BLK_STS_OK to block layer core.

Cc: vincent.chen@sifive.com
Cc: Leon Schuermann <leon@is.currently.online>
Cc: Bart Van Assche <bvanassche@acm.org>
Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Link: https://lore.kernel.org/r/20241029011941.153037-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c