diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2016-08-02 17:05:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-02 19:35:19 -0400 |
commit | 39a9dcca61a3d1375b9440676cbfc541804cd217 (patch) | |
tree | f70ccb6a9c342fb18d29d2dd7740eb89ac379463 | |
parent | d6517deb014954d3229910e46f3b85b7ad80db3e (diff) |
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>
-rw-r--r-- | fs/nilfs2/btree.c | 3 | ||||
-rw-r--r-- | fs/nilfs2/gcinode.c | 9 | ||||
-rw-r--r-- | fs/nilfs2/mdt.c | 6 |
3 files changed, 16 insertions, 2 deletions
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index 2c52693a69a4..2e315f9f2e51 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c | |||
@@ -517,6 +517,9 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr, | |||
517 | 517 | ||
518 | out_no_wait: | 518 | out_no_wait: |
519 | if (!buffer_uptodate(bh)) { | 519 | if (!buffer_uptodate(bh)) { |
520 | nilfs_msg(btree->b_inode->i_sb, KERN_ERR, | ||
521 | "I/O error reading b-tree node block (ino=%lu, blocknr=%llu)", | ||
522 | btree->b_inode->i_ino, (unsigned long long)ptr); | ||
520 | brelse(bh); | 523 | brelse(bh); |
521 | return -EIO; | 524 | return -EIO; |
522 | } | 525 | } |
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, | |||
148 | int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh) | 148 | int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh) |
149 | { | 149 | { |
150 | wait_on_buffer(bh); | 150 | wait_on_buffer(bh); |
151 | if (!buffer_uptodate(bh)) | 151 | if (!buffer_uptodate(bh)) { |
152 | struct inode *inode = bh->b_page->mapping->host; | ||
153 | |||
154 | nilfs_msg(inode->i_sb, KERN_ERR, | ||
155 | "I/O error reading %s block for GC (ino=%lu, vblocknr=%llu)", | ||
156 | buffer_nilfs_node(bh) ? "node" : "data", | ||
157 | inode->i_ino, (unsigned long long)bh->b_blocknr); | ||
152 | return -EIO; | 158 | return -EIO; |
159 | } | ||
153 | if (buffer_dirty(bh)) | 160 | if (buffer_dirty(bh)) |
154 | return -EEXIST; | 161 | return -EEXIST; |
155 | 162 | ||
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index 0d7b71fbeff8..d56d3a5bea88 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c | |||
@@ -207,8 +207,12 @@ static int nilfs_mdt_read_block(struct inode *inode, unsigned long block, | |||
207 | 207 | ||
208 | out_no_wait: | 208 | out_no_wait: |
209 | err = -EIO; | 209 | err = -EIO; |
210 | if (!buffer_uptodate(first_bh)) | 210 | if (!buffer_uptodate(first_bh)) { |
211 | nilfs_msg(inode->i_sb, KERN_ERR, | ||
212 | "I/O error reading meta-data file (ino=%lu, block-offset=%lu)", | ||
213 | inode->i_ino, block); | ||
211 | goto failed_bh; | 214 | goto failed_bh; |
215 | } | ||
212 | out: | 216 | out: |
213 | *out_bh = first_bh; | 217 | *out_bh = first_bh; |
214 | return 0; | 218 | return 0; |