All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Charles Manning <manningc2@actrix.gen.nz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Using ilookup?
Date: Tue, 12 Oct 2004 23:50:35 -0600	[thread overview]
Message-ID: <20041013055035.GH2061@schnapps.adilger.int> (raw)
In-Reply-To: <20041013013930.9BB6649E9@blood.actrix.co.nz>

[-- Attachment #1: Type: text/plain, Size: 1564 bytes --]

On Oct 13, 2004  14:42 +1300, Charles Manning wrote:
> 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.

You can use iget4() along with a filesystem-specific comparison function,
which allows you to distinguish inodes with the same number based on
some extra data (e.g. generation number, 64-bit inode numbers, etc).  Is
there a reason to recycle the inode numbers, or could you just have a
32-bit counter?

> 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?

You can use the ->delete_inode method which is a hook to be called
before/instead of the clear_inode() function in iput(), and is
the last thing action taken when the inode is being unlinked.  There
is also the ->clear_inode inode method, which is called when inodes
are being put away but not only when being unlinked.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://members.shaw.ca/adilger/             http://members.shaw.ca/golinux/


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-10-13  5:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13  1:42 Using ilookup? Charles Manning
2004-10-13  5:50 ` Andreas Dilger [this message]
2004-10-13 18:07   ` Charles Manning
2004-10-13  8:50 ` David Woodhouse
2004-10-13 15:22   ` Lee Revell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041013055035.GH2061@schnapps.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manningc2@actrix.gen.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.