diff options
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 2292cbf7d364..476f80b175fe 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -458,6 +458,8 @@ static void fat_put_super(struct super_block *sb) | |||
458 | if (sb->s_dirt) | 458 | if (sb->s_dirt) |
459 | fat_write_super(sb); | 459 | fat_write_super(sb); |
460 | 460 | ||
461 | iput(sbi->fat_inode); | ||
462 | |||
461 | if (sbi->nls_disk) { | 463 | if (sbi->nls_disk) { |
462 | unload_nls(sbi->nls_disk); | 464 | unload_nls(sbi->nls_disk); |
463 | sbi->nls_disk = NULL; | 465 | sbi->nls_disk = NULL; |
@@ -1183,7 +1185,7 @@ static int fat_read_root(struct inode *inode) | |||
1183 | int fat_fill_super(struct super_block *sb, void *data, int silent, | 1185 | int fat_fill_super(struct super_block *sb, void *data, int silent, |
1184 | const struct inode_operations *fs_dir_inode_ops, int isvfat) | 1186 | const struct inode_operations *fs_dir_inode_ops, int isvfat) |
1185 | { | 1187 | { |
1186 | struct inode *root_inode = NULL; | 1188 | struct inode *root_inode = NULL, *fat_inode = NULL; |
1187 | struct buffer_head *bh; | 1189 | struct buffer_head *bh; |
1188 | struct fat_boot_sector *b; | 1190 | struct fat_boot_sector *b; |
1189 | struct msdos_sb_info *sbi; | 1191 | struct msdos_sb_info *sbi; |
@@ -1423,6 +1425,11 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, | |||
1423 | } | 1425 | } |
1424 | 1426 | ||
1425 | error = -ENOMEM; | 1427 | error = -ENOMEM; |
1428 | fat_inode = new_inode(sb); | ||
1429 | if (!fat_inode) | ||
1430 | goto out_fail; | ||
1431 | MSDOS_I(fat_inode)->i_pos = 0; | ||
1432 | sbi->fat_inode = fat_inode; | ||
1426 | root_inode = new_inode(sb); | 1433 | root_inode = new_inode(sb); |
1427 | if (!root_inode) | 1434 | if (!root_inode) |
1428 | goto out_fail; | 1435 | goto out_fail; |
@@ -1448,6 +1455,8 @@ out_invalid: | |||
1448 | " on dev %s.\n", sb->s_id); | 1455 | " on dev %s.\n", sb->s_id); |
1449 | 1456 | ||
1450 | out_fail: | 1457 | out_fail: |
1458 | if (fat_inode) | ||
1459 | iput(fat_inode); | ||
1451 | if (root_inode) | 1460 | if (root_inode) |
1452 | iput(root_inode); | 1461 | iput(root_inode); |
1453 | if (sbi->nls_io) | 1462 | if (sbi->nls_io) |