aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-10-31 20:09:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-31 20:30:49 -0400
commit72a2ebd8bc62e6658513d3b2a1119e91c3ea6810 (patch)
treefb786e71f96ebb04bedc77f4eb3bbac41c15c6c5 /fs/buffer.c
parent584cff54e1ff8f59d5109dc8093efedff8bcc375 (diff)
fs/buffer.c: add device information for error output in __find_get_block_slow()
On the ext4 mailing list[1], we got some report about errors in __find_get_block_slow(), but the information is very limited. If the device information is given, we can know the name of the sick volume. Futhermore, we can get the corresponding status of that block(group, inode block etc) by analyzing the disk layout. [1] http://marc.info/?l=linux-ext4&m=131379831421147&w=2 Signed-off-by: Tao Ma <boyu.mt@taobao.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 936d6035f6e2..70a19745cb61 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -213,13 +213,16 @@ __find_get_block_slow(struct block_device *bdev, sector_t block)
213 * elsewhere, don't buffer_error if we had some unmapped buffers 213 * elsewhere, don't buffer_error if we had some unmapped buffers
214 */ 214 */
215 if (all_mapped) { 215 if (all_mapped) {
216 char b[BDEVNAME_SIZE];
217
216 printk("__find_get_block_slow() failed. " 218 printk("__find_get_block_slow() failed. "
217 "block=%llu, b_blocknr=%llu\n", 219 "block=%llu, b_blocknr=%llu\n",
218 (unsigned long long)block, 220 (unsigned long long)block,
219 (unsigned long long)bh->b_blocknr); 221 (unsigned long long)bh->b_blocknr);
220 printk("b_state=0x%08lx, b_size=%zu\n", 222 printk("b_state=0x%08lx, b_size=%zu\n",
221 bh->b_state, bh->b_size); 223 bh->b_state, bh->b_size);
222 printk("device blocksize: %d\n", 1 << bd_inode->i_blkbits); 224 printk("device %s blocksize: %d\n", bdevname(bdev, b),
225 1 << bd_inode->i_blkbits);
223 } 226 }
224out_unlock: 227out_unlock:
225 spin_unlock(&bd_mapping->private_lock); 228 spin_unlock(&bd_mapping->private_lock);