From: Yu Kuai yukuai3@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65K8D CVE: NA
--------------------------------
Use cmpxchg64() in some 32bit platform will cause compile error, because it might not be implemented, for example PCC32. Hence only compile it in 64bit platform.
Fixes: 9981c33db4da ("blk-mq: don't access request_wrapper if request is not allocated from block layer") Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- block/blk-core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/blk-core.c b/block/blk-core.c index df24a463f2ef..71c5cf508127 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1306,10 +1306,11 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes)
static void blk_account_io_latency(struct request *req, u64 now, const int sgrp) { +#ifdef CONFIG_64BIT u64 stat_time; struct request_wrapper *rq_wrapper;
- if (!IS_ENABLED(CONFIG_64BIT) || !(req->rq_flags & RQF_FROM_BLOCK)) { + if (!(req->rq_flags & RQF_FROM_BLOCK)) { part_stat_add(req->part, nsecs[sgrp], now - req->start_time_ns); return; } @@ -1328,6 +1329,10 @@ static void blk_account_io_latency(struct request *req, u64 now, const int sgrp)
part_stat_add(req->part, nsecs[sgrp], duration); } +#else + part_stat_add(req->part, nsecs[sgrp], now - req->start_time_ns); + +#endif }
void blk_account_io_done(struct request *req, u64 now)