aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/super.c')
-rw-r--r--fs/jfs/super.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 70a14001c98f..50ea65451732 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -414,7 +414,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
414 struct inode *inode; 414 struct inode *inode;
415 int rc; 415 int rc;
416 s64 newLVSize = 0; 416 s64 newLVSize = 0;
417 int flag; 417 int flag, ret = -EINVAL;
418 418
419 jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags); 419 jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags);
420 420
@@ -461,8 +461,10 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
461 * Initialize direct-mapping inode/address-space 461 * Initialize direct-mapping inode/address-space
462 */ 462 */
463 inode = new_inode(sb); 463 inode = new_inode(sb);
464 if (inode == NULL) 464 if (inode == NULL) {
465 ret = -ENOMEM;
465 goto out_kfree; 466 goto out_kfree;
467 }
466 inode->i_ino = 0; 468 inode->i_ino = 0;
467 inode->i_nlink = 1; 469 inode->i_nlink = 1;
468 inode->i_size = sb->s_bdev->bd_inode->i_size; 470 inode->i_size = sb->s_bdev->bd_inode->i_size;
@@ -494,9 +496,11 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
494 496
495 sb->s_magic = JFS_SUPER_MAGIC; 497 sb->s_magic = JFS_SUPER_MAGIC;
496 498
497 inode = iget(sb, ROOT_I); 499 inode = jfs_iget(sb, ROOT_I);
498 if (!inode || is_bad_inode(inode)) 500 if (IS_ERR(inode)) {
501 ret = PTR_ERR(inode);
499 goto out_no_root; 502 goto out_no_root;
503 }
500 sb->s_root = d_alloc_root(inode); 504 sb->s_root = d_alloc_root(inode);
501 if (!sb->s_root) 505 if (!sb->s_root)
502 goto out_no_root; 506 goto out_no_root;
@@ -536,7 +540,7 @@ out_kfree:
536 if (sbi->nls_tab) 540 if (sbi->nls_tab)
537 unload_nls(sbi->nls_tab); 541 unload_nls(sbi->nls_tab);
538 kfree(sbi); 542 kfree(sbi);
539 return -EINVAL; 543 return ret;
540} 544}
541 545
542static void jfs_write_super_lockfs(struct super_block *sb) 546static void jfs_write_super_lockfs(struct super_block *sb)
@@ -726,7 +730,6 @@ out:
726static const struct super_operations jfs_super_operations = { 730static const struct super_operations jfs_super_operations = {
727 .alloc_inode = jfs_alloc_inode, 731 .alloc_inode = jfs_alloc_inode,
728 .destroy_inode = jfs_destroy_inode, 732 .destroy_inode = jfs_destroy_inode,
729 .read_inode = jfs_read_inode,
730 .dirty_inode = jfs_dirty_inode, 733 .dirty_inode = jfs_dirty_inode,
731 .write_inode = jfs_write_inode, 734 .write_inode = jfs_write_inode,
732 .delete_inode = jfs_delete_inode, 735 .delete_inode = jfs_delete_inode,