mirror of
https://github.com/crash-utility/crash
synced 2025-02-23 08:56:48 +00:00
Fix for the "files" command in Linux 4.17 and later kernels that
contain commit b93b016313b3ba8003c3b8bb71f569af91f19fc7, titled "page cache: use xa_lock". Without the patch, the "files -c" option fails with the message "files: -c option not supported or applicable on this architecture or kernel", and the "files -p <inode>" option fails in a similar manner. (k-hagio@ab.jp.nec.com)
This commit is contained in:
parent
55f9a294c8
commit
2f57a96ce2
@ -2207,6 +2207,11 @@ dump_inode_page_cache_info(ulong inode)
|
||||
RJUST|LONG_DEC,
|
||||
MKSTR(nrpages)));
|
||||
|
||||
FREEBUF(inode_buf);
|
||||
|
||||
if (!nrpages)
|
||||
return;
|
||||
|
||||
root_rnode = i_mapping + OFFSET(address_space_page_tree);
|
||||
rtp.index = 0;
|
||||
rtp.value = (void *)&dump_inode_page;
|
||||
@ -2217,7 +2222,6 @@ dump_inode_page_cache_info(ulong inode)
|
||||
error(INFO, "page_tree count: %ld nrpages: %ld\n",
|
||||
count, nrpages);
|
||||
|
||||
FREEBUF(inode_buf);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2275,7 +2279,7 @@ cmd_files(void)
|
||||
return;
|
||||
|
||||
case 'c':
|
||||
if (VALID_MEMBER(address_space_page_tree) &&
|
||||
if (VALID_MEMBER(address_space_nrpages) &&
|
||||
VALID_MEMBER(inode_i_mapping))
|
||||
open_flags |= PRINT_NRPAGES;
|
||||
else
|
||||
|
2
memory.c
2
memory.c
@ -487,6 +487,8 @@ vm_init(void)
|
||||
MEMBER_OFFSET_INIT(block_device_bd_disk, "block_device", "bd_disk");
|
||||
MEMBER_OFFSET_INIT(inode_i_mapping, "inode", "i_mapping");
|
||||
MEMBER_OFFSET_INIT(address_space_page_tree, "address_space", "page_tree");
|
||||
if (INVALID_MEMBER(address_space_page_tree))
|
||||
MEMBER_OFFSET_INIT(address_space_page_tree, "address_space", "i_pages");
|
||||
MEMBER_OFFSET_INIT(address_space_nrpages, "address_space", "nrpages");
|
||||
if (INVALID_MEMBER(address_space_nrpages))
|
||||
MEMBER_OFFSET_INIT(address_space_nrpages, "address_space", "__nrpages");
|
||||
|
Loading…
Reference in New Issue
Block a user