home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!Sirius.dfn.de!chx400!bernina!almesber
- From: almesber@nessie.cs.id.ethz.ch (Werner Almesberger)
- Subject: MS-DOS FS: FAT corruption bug, the dirty details
- Message-ID: <1992Sep4.013803.19351@bernina.ethz.ch>
- Sender: news@bernina.ethz.ch (USENET News System)
- Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
- References: <1992Sep4.003915.18305@bernina.ethz.ch>
- Date: Fri, 4 Sep 1992 01:38:03 GMT
- Lines: 39
-
- This is a short description of the FAT corruption bug mentioned in
- the dosfs.8 announcement. People who are using an older version of
- the MS-DOS FS should read this in order to find out how to avoid
- that problem.
-
- The MS-DOS FS uses "inode numbers" to describe the location of the
- corresponding directory entry. E.g. the first file in a directory may
- have the "inode number" 320, the second 321, etc.
-
- The MS-DOS FS also uses a small cache that caches FAT accesses. It is
- accessed by a device/inode-number/cluster-number key.
-
- Whenever a file is removed, the associated cache entries are
- invalidated, because the next file created in the same directory may
- occupy the same entry and may therefore inherit the same "inode
- number". This matters for regular files that contain holes and for
- directory files, because they are accessed on a per cluster basis in
- the FS.
-
- Unfortunately, I forgot to do this when renaming a file into a
- different directory. So if the FAT cache contains references to the
- blocks of a file _and_ the file is moved to a different directory
- _and_ a new directory (or, to a lesser extent, a new file) is created
- in the same directory, it may "inherit" those FAT references to the
- blocks of the old file.
-
- This bug exists in versions 5, 6 and 7 of the MS-DOS FS. It is fixed
- in version 8.
-
- If you don't want to upgrade or if you can't, I'd suggest to either
- avoid the situation described above or to unmount and re-mount the FS
- after the rename. (The FAT cache is invalidated during a umount.)
-
- - Werner
- --
- _________________________________________________________________________
- / Werner Almesberger, ETH Zuerich, CH almesber@nessie.cs.id.ethz.ch /
- / IFW A44 Tel. +41 1 254 7213 almesberger@rzvax.ethz.ch /
- /_BITNET:_ALMESBER@CZHETH5A__HEPNET/CHADNET:_[20579::]57414::ALMESBERGER_/
-