Skip to content

Commit 72a2ebd

Browse files
taoma-tmtorvalds
authored andcommitted
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>
1 parent 584cff5 commit 72a2ebd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎fs/buffer.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,16 @@ __find_get_block_slow(struct block_device *bdev, sector_t block)
213213
* elsewhere, don't buffer_error if we had some unmapped buffers
214214
*/
215215
if (all_mapped) {
216+
char b[BDEVNAME_SIZE];
217+
216218
printk("__find_get_block_slow() failed. "
217219
"block=%llu, b_blocknr=%llu\n",
218220
(unsigned long long)block,
219221
(unsigned long long)bh->b_blocknr);
220222
printk("b_state=0x%08lx, b_size=%zu\n",
221223
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);
223226
}
224227
out_unlock:
225228
spin_unlock(&bd_mapping->private_lock);

0 commit comments

Comments
 (0)