kyber: fix wrong strlcpy() size in trace_kyber_latency()
When copying to the latency type, we should be passing LATENCY_TYPE_LEN,
not DOMAIN_LEN (this isn't a problem in practice because we only pass
"total" or "I/O"). Fix it by changing all of the strlcpy() calls to use
sizeof().
Fixes: 6c3b7af1c9
("kyber: add tracepoints")
Reported-by: Jordan Glover <Golden_Miller83@protonmail.ch>
Tested-by: Jordan Glover <Golden_Miller83@protonmail.ch>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
de7b75d82f
commit
18e962ac07
@ -31,8 +31,8 @@ TRACE_EVENT(kyber_latency,
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent)));
|
||||
strlcpy(__entry->domain, domain, DOMAIN_LEN);
|
||||
strlcpy(__entry->type, type, DOMAIN_LEN);
|
||||
strlcpy(__entry->domain, domain, sizeof(__entry->domain));
|
||||
strlcpy(__entry->type, type, sizeof(__entry->type));
|
||||
__entry->percentile = percentile;
|
||||
__entry->numerator = numerator;
|
||||
__entry->denominator = denominator;
|
||||
@ -60,7 +60,7 @@ TRACE_EVENT(kyber_adjust,
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent)));
|
||||
strlcpy(__entry->domain, domain, DOMAIN_LEN);
|
||||
strlcpy(__entry->domain, domain, sizeof(__entry->domain));
|
||||
__entry->depth = depth;
|
||||
),
|
||||
|
||||
@ -82,7 +82,7 @@ TRACE_EVENT(kyber_throttled,
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent)));
|
||||
strlcpy(__entry->domain, domain, DOMAIN_LEN);
|
||||
strlcpy(__entry->domain, domain, sizeof(__entry->domain));
|
||||
),
|
||||
|
||||
TP_printk("%d,%d %s", MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
|
Loading…
Reference in New Issue
Block a user