diff options
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index b3d290c1b513..84c602b4bb25 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -490,6 +490,7 @@ static void fat_put_super(struct super_block *sb) | |||
490 | if (sb->s_dirt) | 490 | if (sb->s_dirt) |
491 | fat_write_super(sb); | 491 | fat_write_super(sb); |
492 | 492 | ||
493 | iput(sbi->fsinfo_inode); | ||
493 | iput(sbi->fat_inode); | 494 | iput(sbi->fat_inode); |
494 | 495 | ||
495 | unload_nls(sbi->nls_disk); | 496 | unload_nls(sbi->nls_disk); |
@@ -1244,6 +1245,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, | |||
1244 | void (*setup)(struct super_block *)) | 1245 | void (*setup)(struct super_block *)) |
1245 | { | 1246 | { |
1246 | struct inode *root_inode = NULL, *fat_inode = NULL; | 1247 | struct inode *root_inode = NULL, *fat_inode = NULL; |
1248 | struct inode *fsinfo_inode = NULL; | ||
1247 | struct buffer_head *bh; | 1249 | struct buffer_head *bh; |
1248 | struct fat_boot_sector *b; | 1250 | struct fat_boot_sector *b; |
1249 | struct msdos_sb_info *sbi; | 1251 | struct msdos_sb_info *sbi; |
@@ -1490,6 +1492,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, | |||
1490 | goto out_fail; | 1492 | goto out_fail; |
1491 | MSDOS_I(fat_inode)->i_pos = 0; | 1493 | MSDOS_I(fat_inode)->i_pos = 0; |
1492 | sbi->fat_inode = fat_inode; | 1494 | sbi->fat_inode = fat_inode; |
1495 | |||
1496 | fsinfo_inode = new_inode(sb); | ||
1497 | if (!fsinfo_inode) | ||
1498 | goto out_fail; | ||
1499 | fsinfo_inode->i_ino = MSDOS_FSINFO_INO; | ||
1500 | sbi->fsinfo_inode = fsinfo_inode; | ||
1501 | insert_inode_hash(fsinfo_inode); | ||
1502 | |||
1493 | root_inode = new_inode(sb); | 1503 | root_inode = new_inode(sb); |
1494 | if (!root_inode) | 1504 | if (!root_inode) |
1495 | goto out_fail; | 1505 | goto out_fail; |
@@ -1516,6 +1526,8 @@ out_invalid: | |||
1516 | fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem"); | 1526 | fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem"); |
1517 | 1527 | ||
1518 | out_fail: | 1528 | out_fail: |
1529 | if (fsinfo_inode) | ||
1530 | iput(fsinfo_inode); | ||
1519 | if (fat_inode) | 1531 | if (fat_inode) |
1520 | iput(fat_inode); | 1532 | iput(fat_inode); |
1521 | unload_nls(sbi->nls_io); | 1533 | unload_nls(sbi->nls_io); |