]> git.baikalelectronics.ru Git - kernel.git/commit
block: Document how blk_update_request() handles RQF_SPECIAL_PAYLOAD requests
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 27 Jun 2018 20:09:05 +0000 (13:09 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Jul 2018 15:07:52 +0000 (09:07 -0600)
commit010b4e93f13365dfb25983e5a3c952633f92e840
tree21b939cb0603a693fe8bc6ee64ced7f1fe945fda
parentf25fb923123d08b934bf57401c8aed00e49d5935
block: Document how blk_update_request() handles RQF_SPECIAL_PAYLOAD requests

The payload of struct request is stored in the request.bio chain if
the RQF_SPECIAL_PAYLOAD flag is not set and in request.special_vec if
RQF_SPECIAL_PAYLOAD has been set. However, blk_update_request()
iterates over req->bio whether or not RQF_SPECIAL_PAYLOAD has been
set. Additionally, the RQF_SPECIAL_PAYLOAD flag is ignored by
blk_rq_bytes() which means that the value returned by that function
is incorrect if the RQF_SPECIAL_PAYLOAD flag has been set. It is not
clear to me whether this is an oversight or whether this happened on
purpose. Anyway, document that it is known that both functions ignore
RQF_SPECIAL_PAYLOAD. See also commit a6df521cda4c ("block: improve
handling of the magic discard payload").

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c