diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2018-06-27 23:09:05 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-07-09 18:07:52 +0300 |
commit | 1954e9a998d59d08520d7d4bebeafb8f66ba0d0f (patch) | |
tree | 21b939cb0603a693fe8bc6ee64ced7f1fe945fda /block/blk-core.c | |
parent | d05d199883b09cd34937ebb045adbed9098e9780 (diff) | |
download | linux-1954e9a998d59d08520d7d4bebeafb8f66ba0d0f.tar.xz |
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 f9d03f96b988 ("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>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 947e7a4abd8c..2ff8e131a892 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -3056,6 +3056,10 @@ EXPORT_SYMBOL_GPL(blk_steal_bios); * Passing the result of blk_rq_bytes() as @nr_bytes guarantees * %false return from this function. * + * Note: + * The RQF_SPECIAL_PAYLOAD flag is ignored on purpose in both + * blk_rq_bytes() and in blk_update_request(). + * * Return: * %false - this request doesn't have any more data * %true - this request has more data |