blktrace: Show requests without sector
authorJan Kara <jack@suse.cz>
Thu, 7 Feb 2019 10:55:39 +0000 (11:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:57 +0000 (15:37 +0100)
commit479d9460a2919e1900d5147a1271837201ffdfda
treebede37a522a8b8119d5257f29b3970f96ef16edc
parentbbd45bd490f0a71a59c364d6fc664c1086771721
blktrace: Show requests without sector

[ Upstream commit 0803de78049fe1b0baf44bcddc727b036fb9139b ]

Currently, blktrace will not show requests that don't have any data as
rq->__sector is initialized to -1 which is out of device range and thus
discarded by act_log_check(). This is most notably the case for cache
flush requests sent to the device. Fix the problem by making
blk_rq_trace_sector() return 0 for requests without initialized sector.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/blktrace_api.h