]> git.baikalelectronics.ru Git - kernel.git/commit
fat: Fix the race of read/write the FAT12 entry
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Mon, 16 Jul 2007 00:40:05 +0000 (09:40 +0900)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 16 Jul 2007 17:31:01 +0000 (10:31 -0700)
commit0172882f9cf1f81c4c138c8824519ae4491395f9
treef124325ac1768bee61b82e7689bc48ea102efe56
parent46846b8f2afa267767a40ac04bbe7c693639d10a
fat: Fix the race of read/write the FAT12 entry

FAT12 entry is 12bits, so it needs 2 phase to update the value.  And
writer and reader access it without any lock, so reader can get the
half updated value.

This fixes the long standing race condition by adding a global
spinlock to only FAT12 for avoiding any impact against FAT16/32.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fat/fatent.c