Skip to contentSkip to conversation

fat: remove redundent call to fat_detach in vfat_unlink

PATCH In review Namjae Jeon 2 participants 3 messages Aug 31, 2012 – Sep 3, 2012 VFAT/FAT/msdos filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fat: remove redundent call to fat_detach in vfat_unlink

As after file is removed fat_evict_inode will be called and fat_detach will be called from that place. So, fat_detach can be removed from vfat_unlink

---
 fs/fat/namei_vfat.c |    1 -
 1 file changed, 1 deletion(-)
fs/fat/namei_vfat.c +0 -1
index e535dd7..37be82e 100644
@@ -852,7 +852,6 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry)
 		goto out;
 	clear_nlink(inode);
 	inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
-	fat_detach(inode);
 out:
 	unlock_super(sb);
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 1 line · Namjae Jeon

As after file is removed fat_evict_inode will be called and fat_detach will be called from that place. So, fat_detach can be removed from vfat_unlink

NAK. Please, realize that unlink and destruction of file are separate operations. ->evict_inode() may be called long after ->unlink(); moreover, during that time you might have another file created, getting the same directory entry our file used to have.

This is Unix, damnit. You *can* open file, then unlink it and that file will keep existing (i.e. you can write to that descriptor, read, etc.) until it's closed.

#2 lore raw

2012/9/1, Al Viro <[email protected]>:

Quoted 5 lines · Namjae Jeon
Quoted 3 lines

As after file is removed fat_evict_inode will be called and fat_detach will be called from that place. So, fat_detach can be removed from vfat_unlink

Quoted 9 lines

NAK. Please, realize that unlink and destruction of file are separate operations. ->evict_inode() may be called long after ->unlink(); moreover, during that time you might have another file created, getting the same directory entry our file used to have.

This is Unix, damnit. You *can* open file, then unlink it and that file will keep existing (i.e. you can write to that descriptor, read, etc.) until it's closed.

Hi Al.
Sorry for noise. I understand what you said.
There was some confusing to me while checking fat's estale issue.:) I will re-post patch-set about fat estale issue soon.(fix side-effect informed by you and ogawa)
I am grateful that you review these patches also if you have time. Thanks.