public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Using ilookup?
@ 2004-10-13  1:42 Charles Manning
  2004-10-13  5:50 ` Andreas Dilger
  2004-10-13  8:50 ` David Woodhouse
  0 siblings, 2 replies; 5+ messages in thread
From: Charles Manning @ 2004-10-13  1:42 UTC (permalink / raw)
  To: linux-kernel

Hi

I'm the maintainer for YAFFS, the NAND-specific file system used in many 
mobile/embedded Linux devices over the last two years.

There is a problem that I'm unsure how to best fix. I thought perhaps using 
ilookup might be a good idea, but I see a big fat warning that ilookup is 
perhaps not the function to be using. I therefore seek help.

YAFFS allocates its own "objectId"s which are used as inode numbers for most 
purposes. When objects get deleted (== unlinked), the object numbers get 
recycles.  Sometimes though the Linux cache has an inode after the object has 
been deleted. Then if that object id gets recycled before the cached inode is 
released, a problem occurs since iget() gets the old inode instead of 
creating a new one. We then end up with an inconsistency.

Someone has been able to force this by doing the following:
# cd /test; rm -rf /test

I think I need to do one of two things:

1)  Somehow plug myself into the inode iput() chain so that I know when an 
inode is removed from the cache. I can then make sure that I don't free up 
the inode number for reuse until the inode is not in the cache. Any hints on 
how to do that?

2) When creating inode numbers, I could test for if there is a corresponding 
inode in the cache first and just not recycle that number if there is. To do 
this is ilookup the correct/safe thing to do?

2') A further issue here is that ilookup is not available in some older 2.4.x 
versions. Is it Ok to just patch the ilookup code in, say, 2.4.27 back into 
earlier versions (say 2.4.18 which seems a popular vintage for embedded stuff 
for some reason or other).


Thanx

-- Charles



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-13 18:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13  1:42 Using ilookup? Charles Manning
2004-10-13  5:50 ` Andreas Dilger
2004-10-13 18:07   ` Charles Manning
2004-10-13  8:50 ` David Woodhouse
2004-10-13 15:22   ` Lee Revell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox