diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-07 13:44:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:12 -0400 |
commit | b522412aeabadbb302fd4338eaabf09d10e2d29c (patch) | |
tree | 6b6b73686bc77e10a3a8275e84bc545ddf7755b6 /fs/fat/inode.c | |
parent | 964f5369667b342994fe3f384e9ba41d404ee796 (diff) |
Sanitize ->fsync() for FAT
* mark directory data blocks as assoc. metadata
* add new inode to deal with FAT, mark FAT blocks as assoc. metadata of that
* now ->fsync() is trivial both for files and directories
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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) |