Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tao Ma and committed by
Linus Torvalds
72a2ebd8 584cff54

+4 -1
+4 -1
fs/buffer.c
··· 213 213 * elsewhere, don't buffer_error if we had some unmapped buffers 214 214 */ 215 215 if (all_mapped) { 216 + char b[BDEVNAME_SIZE]; 217 + 216 218 printk("__find_get_block_slow() failed. " 217 219 "block=%llu, b_blocknr=%llu\n", 218 220 (unsigned long long)block, 219 221 (unsigned long long)bh->b_blocknr); 220 222 printk("b_state=0x%08lx, b_size=%zu\n", 221 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 } 224 227 out_unlock: 225 228 spin_unlock(&bd_mapping->private_lock);