mirror of https://gitee.com/openkylin/linux.git
writeback: don't access page->mapping directly in track_foreign_dirty TP
page->mapping may encode different values in it and page_mapping()
should always be used to access the mapping pointer.
track_foreign_dirty tracepoint was incorrectly accessing page->mapping
directly. Use page_mapping() instead. Also, add NULL checks while at
it.
Fixes: 3a8e9ac89e
("writeback: add tracepoints for cgroup foreign writebacks")
Reported-by: Jan Kara <jack@suse.cz>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
8f5914bcee
commit
0feacaa216
|
@ -251,9 +251,12 @@ TRACE_EVENT(track_foreign_dirty,
|
|||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct address_space *mapping = page_mapping(page);
|
||||
struct inode *inode = mapping ? mapping->host : NULL;
|
||||
|
||||
strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
|
||||
__entry->bdi_id = wb->bdi->id;
|
||||
__entry->ino = page->mapping->host->i_ino;
|
||||
__entry->ino = inode ? inode->i_ino : 0;
|
||||
__entry->memcg_id = wb->memcg_css->id;
|
||||
__entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
|
||||
__entry->page_cgroup_ino = page->mem_cgroup->css.cgroup->kn->id.ino;
|
||||
|
|
Loading…
Reference in New Issue