diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2008-11-06 15:53:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-06 18:41:21 -0500 |
commit | 2bdf67eb1631f30e2f3f5d49e4007c76e88877a8 (patch) | |
tree | d3d337e52516b3b61cdf4508cf445ef8dcaae2ed /fs/fat/inode.c | |
parent | 0e75f5da06c05425f4b375eb981c4489fb2d9787 (diff) |
fat: mmu_private race fix
mmu_private is 64bits value, hence it's not atomic to update.
So, the access rule for mmu_private is we must hold ->i_mutex. But,
fat_get_block() path doesn't follow the rule on non-allocation path.
This fixes by using i_size instead if non-allocation path.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index be88208b83a6..9e37ad93c730 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -64,7 +64,7 @@ static inline int __fat_get_block(struct inode *inode, sector_t iblock, | |||
64 | sector_t phys; | 64 | sector_t phys; |
65 | int err, offset; | 65 | int err, offset; |
66 | 66 | ||
67 | err = fat_bmap(inode, iblock, &phys, &mapped_blocks); | 67 | err = fat_bmap(inode, iblock, &phys, &mapped_blocks, create); |
68 | if (err) | 68 | if (err) |
69 | return err; | 69 | return err; |
70 | if (phys) { | 70 | if (phys) { |
@@ -94,7 +94,7 @@ static inline int __fat_get_block(struct inode *inode, sector_t iblock, | |||
94 | *max_blocks = min(mapped_blocks, *max_blocks); | 94 | *max_blocks = min(mapped_blocks, *max_blocks); |
95 | MSDOS_I(inode)->mmu_private += *max_blocks << sb->s_blocksize_bits; | 95 | MSDOS_I(inode)->mmu_private += *max_blocks << sb->s_blocksize_bits; |
96 | 96 | ||
97 | err = fat_bmap(inode, iblock, &phys, &mapped_blocks); | 97 | err = fat_bmap(inode, iblock, &phys, &mapped_blocks, create); |
98 | if (err) | 98 | if (err) |
99 | return err; | 99 | return err; |
100 | 100 | ||