Re: [PATCH] fat: remove redundent call to fat_detach in vfat_unlink

From: Al Viro
Date: Fri Aug 31 2012 - 13:29:08 EST


On Fri, Aug 31, 2012 at 12:48:07PM -0400, Namjae Jeon wrote:
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/