Re: [Question] does iput(iget(...)) work?

Jan Kara (jack@atrey.karlin.mff.cuni.cz)
Mon, 1 Mar 1999 16:26:10 +0100


> My problem is that if the inode is not active iget() still
> returns a pointer. But an iput() then gives:
>
> Feb 28 15:28:51 harpo kernel: EXT2-fs warning (device 16:07): ext2_free_blocks: bit already cleared for block 82191
> Feb 28 15:28:51 harpo kernel: EXT2-fs warning (device 16:07): ext2_free_inode: bit already cleared for inode 20409
This is strange. When you do iget() on some inode an i_count is incremented
and inode can't be deleted from disk until i_count is non-zero. Only when
inode is unlinked and last user does iput() inode is really deleted. But this
messages from ext2 say the inode is already deleted => something is
wrong. Your filesystem is corrupted or your code is wrong somehow (I can't
just now imagine how, but it might be possible)... No matter what case this
is I would run fsck on the filesystem...

Honza.

-
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.tux.org/lkml/