Re: VFAT patch (Re: 2.1.114: VFAT corrupts first block of a file)

Gordon Chaffee (chaffee@cs.berkeley.edu)
Sun, 9 Aug 1998 19:33:25 -0700 (PDT)


Linus Torvalds writes:
> OR
>
> - you haven't cleared "inode->i_nlink" when you marked the old inode
> deleted, so the VFS layer doesn't know that it should call the delete
> function..
>
> The i_nlink thing looks like the more likely suspect.

Indeed. I couldn't figure out how to get the system from reusing the
inode, and clear_inode(old_inode) was the only thing I could get to work.
Clearing old_inode->i_nlink also works, and since it is the correct way,
here is a patch to apply over the previously applied patch.

- Gordon

--- linux-2.1.115-prev/fs/vfat/namei.c Sun Aug 9 11:36:13 1998
+++ linux/fs/vfat/namei.c Sun Aug 9 11:36:40 1998
@@ -1771,6 +1771,8 @@
MSDOS_I(new_inode)->i_logstart = MSDOS_I(old_inode)->i_logstart;
MSDOS_I(new_inode)->i_attrs = MSDOS_I(old_inode)->i_attrs;

+ old_inode->i_nlink = 0;
+
fat_cache_inval_inode(old_inode);
mark_inode_dirty(new_inode);

@@ -1821,8 +1823,6 @@
d_move(old_dentry, new_dentry);
put_new_inode = 0;
}
-
- clear_inode(old_inode);

rename_done:
if (locked)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html