]> git.hungrycats.org Git - linux/commit
[PATCH] FAT: Fix the race bitween fat_free() and fat_get_cluster()
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>
Wed, 20 Oct 2004 01:15:45 +0000 (18:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 20 Oct 2004 01:15:45 +0000 (18:15 -0700)
commitbe591191813b7746f3e969e3fb77b73f9d33d1f1
treec9b8f8246ef3c4a46b27e81f37a0ec0fd110ca8f
parent7ff228f05f3949cce5ce7d5258b5c87b48af0cb8
[PATCH] FAT: Fix the race bitween fat_free() and fat_get_cluster()

This patch fixes the race condition

  |      fat_free                |    fat_get_cluster
  +------------------------------+-----------------------
                                     fat_cache_lookup()
                                     (get the copy of cache)
   fat_cache_inval_inode()
(invalidate caches on inode)
                                     fat_cache_add()
                                     (update/add the getted cache)

The above race has possible that invalidated cache is added.

This patch fixes the race condition by adding the cache-id to copy of cache.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/fat/cache.c
fs/fat/inode.c
include/linux/msdos_fs_i.h