diff options
author | Oscar Salvador <osalvador@suse.de> | 2019-03-28 20:44:01 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-03 06:27:37 +0200 |
commit | 2b57282beb606fc14ff67ff569bf0280cf0eb9c4 (patch) | |
tree | 08e3845c8f878847dffa3303769e65e204c93201 /scripts/Makefile.build | |
parent | 8b2f31de5d159d93cd8c1bf7491c2fcc0e9b4777 (diff) | |
download | blackbird-obmc-linux-2b57282beb606fc14ff67ff569bf0280cf0eb9c4.tar.gz blackbird-obmc-linux-2b57282beb606fc14ff67ff569bf0280cf0eb9c4.zip |
mm/debug.c: fix __dump_page when mapping->host is not set
commit 5ae2efb1dea9f537453e841714e3ee2757595aec upstream.
While debugging something, I added a dump_page() into do_swap_page(),
and I got the splat from below. The issue happens when dereferencing
mapping->host in __dump_page():
...
else if (mapping) {
pr_warn("%ps ", mapping->a_ops);
if (mapping->host->i_dentry.first) {
struct dentry *dentry;
dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias);
pr_warn("name:\"%pd\" ", dentry);
}
}
...
Swap address space does not contain an inode information, and so
mapping->host equals NULL.
Although the dump_page() call was added artificially into
do_swap_page(), I am not sure if we can hit this from any other path, so
it looks worth fixing it. We can easily do that by checking
mapping->host first.
Link: http://lkml.kernel.org/r/20190318072931.29094-1-osalvador@suse.de
Fixes: 1c6fb1d89e73c ("mm: print more information about mapping in __dump_page")
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/Makefile.build')
0 files changed, 0 insertions, 0 deletions