summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/gcinode.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2016-08-02 14:05:17 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-02 19:35:19 -0400
commit39a9dcca61a3d1375b9440676cbfc541804cd217 (patch)
treef70ccb6a9c342fb18d29d2dd7740eb89ac379463 /fs/nilfs2/gcinode.c
parentd6517deb014954d3229910e46f3b85b7ad80db3e (diff)
downloadlinux-39a9dcca61a3d1375b9440676cbfc541804cd217.tar.gz
linux-39a9dcca61a3d1375b9440676cbfc541804cd217.tar.bz2
linux-39a9dcca61a3d1375b9440676cbfc541804cd217.zip
nilfs2: emit error message when I/O error is detected
When nilfs returned -EIO as an error code, it's not always clear if it came from the underlying block device or not. This will mend the issue by having low level I/O routines of nilfs output an error message when they detected an I/O error. Link: http://lkml.kernel.org/r/1464875891-5443-7-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/gcinode.c')
-rw-r--r--fs/nilfs2/gcinode.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nilfs2/gcinode.c b/fs/nilfs2/gcinode.c
index e9148f94d696..853a831dcde0 100644
--- a/fs/nilfs2/gcinode.c
+++ b/fs/nilfs2/gcinode.c
@@ -148,8 +148,15 @@ int nilfs_gccache_submit_read_node(struct inode *inode, sector_t pbn,
int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh)
{
wait_on_buffer(bh);
- if (!buffer_uptodate(bh))
+ if (!buffer_uptodate(bh)) {
+ struct inode *inode = bh->b_page->mapping->host;
+
+ nilfs_msg(inode->i_sb, KERN_ERR,
+ "I/O error reading %s block for GC (ino=%lu, vblocknr=%llu)",
+ buffer_nilfs_node(bh) ? "node" : "data",
+ inode->i_ino, (unsigned long long)bh->b_blocknr);
return -EIO;
+ }
if (buffer_dirty(bh))
return -EEXIST;