Skip to contentSkip to conversation

a bug in ext2_put_inode? (was Re: Some question about VFS

DISCUSSION Tigran Aivazian 1 participant 1 message Jul 12, 2001 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 9 lines · yxpeng

When I read the source of VFS, I notice that the fs-specific function sb->s_op->put_inode() is called before the inode->i_count is decremented and then checked. In the ext2 source, we can see that what the put_inode() does is to free the preallocated blocks without checking the i_count. I want to know why the put_inode() should be taken before i_count is checked. I think maybe there are some other processes that hold this file open and may use the preallocated blocks. Now that the other processes may use the preallocated blocks, why here we should free them? I am really confused.

It is possible that you may have found a bug, I am forwarding your question to the linux-kernel list where someone can answer with more certainty...

Regards,
Tigran