From: Naoya Horiguchi Date: Fri, 9 Nov 2012 03:04:20 +0000 (+1100) Subject: mm: print out information of file affected by memory error X-Git-Tag: next-20121113~6^2~189 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c0230ec53fd4ee1842cc22b96ac3c10eb41bc22f;p=karo-tx-linux.git mm: print out information of file affected by memory error Printing out the information about which file can be affected by a memory error in generic_error_remove_page() is helpful for user to estimate the impact of the error. Signed-off-by: Naoya Horiguchi Cc: Jan Kara Cc: Andi Kleen Cc: Tony Luck Cc: "Jun'ichi Nomura" Signed-off-by: Andrew Morton --- diff --git a/mm/truncate.c b/mm/truncate.c index d51ce92d6e83..db1b21666b09 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -151,14 +151,20 @@ int truncate_inode_page(struct address_space *mapping, struct page *page) */ int generic_error_remove_page(struct address_space *mapping, struct page *page) { + struct inode *inode; + if (!mapping) return -EINVAL; + inode = mapping->host; /* * Only punch for normal data pages for now. * Handling other types like directories would need more auditing. */ - if (!S_ISREG(mapping->host->i_mode)) + if (!S_ISREG(inode->i_mode)) return -EIO; + pr_info("MCE %#lx: file info pgoff:%lu, inode:%lu, dev:%s\n", + page_to_pfn(page), page_index(page), + inode->i_ino, inode->i_sb->s_id); return truncate_inode_page(mapping, page); } EXPORT_SYMBOL(generic_error_remove_page);