diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-01-10 12:10:55 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-01-10 12:10:55 -0500 |
commit | f7c21177af0b32a2cd9ee36189637f0c1f0e1e17 (patch) | |
tree | ba83d4ddcd4b7e15ff575f0b75013ba9ed62f249 /fs/ext4/super.c | |
parent | f9a62d090cf47fae2fe6f6bd8eb9f24482573fd8 (diff) |
ext4: Use ext4_error_file() to print the pathname to the corrupted inode
Where the file pointer is available, use ext4_error_file() instead of
ext4_error_inode().
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d49e3b1ec41e..7728a4ca3d6c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -406,28 +406,31 @@ void ext4_error_inode(struct inode *inode, const char *function, | |||
406 | const char *fmt, ...) | 406 | const char *fmt, ...) |
407 | { | 407 | { |
408 | va_list args; | 408 | va_list args; |
409 | struct va_format vaf; | ||
409 | struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es; | 410 | struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es; |
410 | 411 | ||
411 | es->s_last_error_ino = cpu_to_le32(inode->i_ino); | 412 | es->s_last_error_ino = cpu_to_le32(inode->i_ino); |
412 | es->s_last_error_block = cpu_to_le64(block); | 413 | es->s_last_error_block = cpu_to_le64(block); |
413 | save_error_info(inode->i_sb, function, line); | 414 | save_error_info(inode->i_sb, function, line); |
414 | va_start(args, fmt); | 415 | va_start(args, fmt); |
416 | vaf.fmt = fmt; | ||
417 | vaf.va = &args; | ||
415 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: inode #%lu: ", | 418 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: inode #%lu: ", |
416 | inode->i_sb->s_id, function, line, inode->i_ino); | 419 | inode->i_sb->s_id, function, line, inode->i_ino); |
417 | if (block) | 420 | if (block) |
418 | printk("block %llu: ", block); | 421 | printk(KERN_CONT "block %llu: ", block); |
419 | printk("comm %s: ", current->comm); | 422 | printk(KERN_CONT "comm %s: %pV\n", current->comm, &vaf); |
420 | vprintk(fmt, args); | ||
421 | printk("\n"); | ||
422 | va_end(args); | 423 | va_end(args); |
423 | 424 | ||
424 | ext4_handle_error(inode->i_sb); | 425 | ext4_handle_error(inode->i_sb); |
425 | } | 426 | } |
426 | 427 | ||
427 | void ext4_error_file(struct file *file, const char *function, | 428 | void ext4_error_file(struct file *file, const char *function, |
428 | unsigned int line, const char *fmt, ...) | 429 | unsigned int line, ext4_fsblk_t block, |
430 | const char *fmt, ...) | ||
429 | { | 431 | { |
430 | va_list args; | 432 | va_list args; |
433 | struct va_format vaf; | ||
431 | struct ext4_super_block *es; | 434 | struct ext4_super_block *es; |
432 | struct inode *inode = file->f_dentry->d_inode; | 435 | struct inode *inode = file->f_dentry->d_inode; |
433 | char pathname[80], *path; | 436 | char pathname[80], *path; |
@@ -435,17 +438,18 @@ void ext4_error_file(struct file *file, const char *function, | |||
435 | es = EXT4_SB(inode->i_sb)->s_es; | 438 | es = EXT4_SB(inode->i_sb)->s_es; |
436 | es->s_last_error_ino = cpu_to_le32(inode->i_ino); | 439 | es->s_last_error_ino = cpu_to_le32(inode->i_ino); |
437 | save_error_info(inode->i_sb, function, line); | 440 | save_error_info(inode->i_sb, function, line); |
438 | va_start(args, fmt); | ||
439 | path = d_path(&(file->f_path), pathname, sizeof(pathname)); | 441 | path = d_path(&(file->f_path), pathname, sizeof(pathname)); |
440 | if (IS_ERR(path)) | 442 | if (IS_ERR(path)) |
441 | path = "(unknown)"; | 443 | path = "(unknown)"; |
442 | printk(KERN_CRIT | 444 | printk(KERN_CRIT |
443 | "EXT4-fs error (device %s): %s:%d: inode #%lu " | 445 | "EXT4-fs error (device %s): %s:%d: inode #%lu: ", |
444 | "(comm %s path %s): ", | 446 | inode->i_sb->s_id, function, line, inode->i_ino); |
445 | inode->i_sb->s_id, function, line, inode->i_ino, | 447 | if (block) |
446 | current->comm, path); | 448 | printk(KERN_CONT "block %llu: ", block); |
447 | vprintk(fmt, args); | 449 | va_start(args, fmt); |
448 | printk("\n"); | 450 | vaf.fmt = fmt; |
451 | vaf.va = &args; | ||
452 | printk(KERN_CONT "comm %s: path %s: %pV\n", current->comm, path, &vaf); | ||
449 | va_end(args); | 453 | va_end(args); |
450 | 454 | ||
451 | ext4_handle_error(inode->i_sb); | 455 | ext4_handle_error(inode->i_sb); |