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>
This commit is contained in:

committed by
Linus Torvalds

parent
0e75f5da06
commit
2bdf67eb16
@@ -77,7 +77,7 @@ next:
|
||||
|
||||
*bh = NULL;
|
||||
iblock = *pos >> sb->s_blocksize_bits;
|
||||
err = fat_bmap(dir, iblock, &phys, &mapped_blocks);
|
||||
err = fat_bmap(dir, iblock, &phys, &mapped_blocks, 0);
|
||||
if (err || !phys)
|
||||
return -1; /* beyond EOF or error */
|
||||
|
||||
|
Reference in New Issue
Block a user