Messages in this thread Patch in this message |  | | Date | Mon, 9 Dec 1996 13:04:01 -0500 (EST) | From | Benjamin C R LaHaise <> | Subject | Re: Corrupted inode list? |
| |
On Mon, 9 Dec 1996, Andrew E. Mileski wrote:
> > After exhaustive testing, and the loss of several hundred MB of data, > I can assure everyone that the FAT race fix in v2.1.14 doesn't work :-( > (this also affects VFAT of course) > > To review for anxious readers, three different solutions have been > posted on linux-kernel for this problem: > #1 by Benjamin LaHaise - see linux-kernel-digest #635 > #2 by Stephen Tweedie - see linux-kernel-digest #636 > #3 by Stephen Tweedie - see linux-kernel-digest #638 > Solution #2 seems to be incorporated into v2.1.14 now. > > I'll try #3 now and report back after wringing it out a while.
Hmmm... I haven't seen #3, but how about the patch below (untested, against 2.1.14). I investigated the msdos/vfat code a bit more, and depend/linked only seem to be used when renaming across directories (explains why most tests don't show the problem).
--- linux/fs/fat/inode.c.orig Mon Dec 9 12:43:05 1996 +++ linux/fs/fat/inode.c Mon Dec 9 12:44:20 1996 @@ -32,6 +32,7 @@ struct inode *depend, *linked; struct super_block *sb; + lock_inode(inode); depend = MSDOS_I(inode)->i_depend; linked = MSDOS_I(inode)->i_linked; sb = inode->i_sb; @@ -44,6 +45,7 @@ MSDOS_I(inode)->i_linked = NULL; } if (MSDOS_I(inode)->i_busy) fat_cache_inval_inode(inode); + unlock_inode(inode); return; } inode->i_size = 0; @@ -69,6 +71,7 @@ iput(linked); } done: + unlock_inode(inode); clear_inode(inode); }
|  |