diff options
Diffstat (limited to 'fs/ext4/super.c')
| -rw-r--r-- | fs/ext4/super.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 5e8f9077b0fc..5a18e9ec7cf9 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -347,6 +347,42 @@ void __ext4_error(struct super_block *sb, const char *function, | |||
| 347 | ext4_handle_error(sb); | 347 | ext4_handle_error(sb); |
| 348 | } | 348 | } |
| 349 | 349 | ||
| 350 | void ext4_error_inode(const char *function, struct inode *inode, | ||
| 351 | const char *fmt, ...) | ||
| 352 | { | ||
| 353 | va_list args; | ||
| 354 | |||
| 355 | va_start(args, fmt); | ||
| 356 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: inode #%lu: (comm %s) ", | ||
| 357 | inode->i_sb->s_id, function, inode->i_ino, current->comm); | ||
| 358 | vprintk(fmt, args); | ||
| 359 | printk("\n"); | ||
| 360 | va_end(args); | ||
| 361 | |||
| 362 | ext4_handle_error(inode->i_sb); | ||
| 363 | } | ||
| 364 | |||
| 365 | void ext4_error_file(const char *function, struct file *file, | ||
| 366 | const char *fmt, ...) | ||
| 367 | { | ||
| 368 | va_list args; | ||
| 369 | struct inode *inode = file->f_dentry->d_inode; | ||
| 370 | char pathname[80], *path; | ||
| 371 | |||
| 372 | va_start(args, fmt); | ||
| 373 | path = d_path(&(file->f_path), pathname, sizeof(pathname)); | ||
| 374 | if (!path) | ||
| 375 | path = "(unknown)"; | ||
| 376 | printk(KERN_CRIT | ||
| 377 | "EXT4-fs error (device %s): %s: inode #%lu (comm %s path %s): ", | ||
| 378 | inode->i_sb->s_id, function, inode->i_ino, current->comm, path); | ||
| 379 | vprintk(fmt, args); | ||
| 380 | printk("\n"); | ||
| 381 | va_end(args); | ||
| 382 | |||
| 383 | ext4_handle_error(inode->i_sb); | ||
| 384 | } | ||
| 385 | |||
| 350 | static const char *ext4_decode_error(struct super_block *sb, int errno, | 386 | static const char *ext4_decode_error(struct super_block *sb, int errno, |
| 351 | char nbuf[16]) | 387 | char nbuf[16]) |
| 352 | { | 388 | { |
