]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: print out information of file affected by memory error
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Fri, 9 Nov 2012 03:04:20 +0000 (14:04 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Nov 2012 04:17:05 +0000 (15:17 +1100)
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 <n-horiguchi@ah.jp.nec.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/truncate.c

index d51ce92d6e83fefd08c2594d3ef8d25b1575f577..db1b21666b09793ce54b4c83f3135da5b2e92f01 100644 (file)
@@ -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);