Barry Friedman | 16 Sep 05:10 2010
Picon

How do I tell FUSE to forget about a stale inode?

I have a filesystem using the lowlevel API where state in my program
is represented in FUSE by some files and directories. When I delete
the state I tried using fuse_lowlevel_notify_inval_inode() and
fuse_lowlevel_notify_inval_entry() to tell FUSE to re-query the file
system attributes. If I later re-create the state and I use the same
file and directory names and what happens is that somewhere FUSE still
has the old inode number so it calls the getattr() callback with this
invalid inode number.

The strange thing is that I get the lookup() callbacks for the new
instance of my directory and I return the new inode numbers via
fuse_reply_entry(), but as I said then I get a getattr() call with the
old inode number and FUSE seems to want to use that.

Is there something else I need to do to make FUSE forget about these
stale inode numbers?

Thanks,
Barry

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
Stef Bon | 16 Sep 10:18 2010
Picon

Re: How do I tell FUSE to forget about a stale inode?

Don't you see somewhere in your fs logfiles that a new entry is
created?? Your fs is a lowlevel fs, so is it
doing the administration of the internal (=FUSE) entries and inodes self.

It should create a new entry here, if not, it's using the old entry,
and the old inode.

So please check this first. You write you invalidate the entry and
inode, but you'r program has to delete them also (internally).

Stef

2010/9/16 Barry Friedman <friedman.barry@...>:
> I have a filesystem using the lowlevel API where state in my program
> is represented in FUSE by some files and directories. When I delete
> the state I tried using fuse_lowlevel_notify_inval_inode() and
> fuse_lowlevel_notify_inval_entry() to tell FUSE to re-query the file
> system attributes. If I later re-create the state and I use the same
> file and directory names and what happens is that somewhere FUSE still
> has the old inode number so it calls the getattr() callback with this
> invalid inode number.
>
> The strange thing is that I get the lookup() callbacks for the new
> instance of my directory and I return the new inode numbers via
> fuse_reply_entry(), but as I said then I get a getattr() call with the
> old inode number and FUSE seems to want to use that.
>
> Is there something else I need to do to make FUSE forget about these
> stale inode numbers?
>
(Continue reading)

Barry Friedman | 16 Sep 17:09 2010
Picon

Re: How do I tell FUSE to forget about a stale inode?

Thanks for the help, I changed my code to just mark as deleted my
inode record when the file is to be removed and I recycle the same
inode record if the same filename is re-created later. This seems to
work better than if I destroy the old inode record and create a new
one.

Thanks,
Barry

On Thu, Sep 16, 2010 at 1:18 AM, Stef Bon <stefbon@...> wrote:
> Don't you see somewhere in your fs logfiles that a new entry is
> created?? Your fs is a lowlevel fs, so is it
> doing the administration of the internal (=FUSE) entries and inodes self.
>
> It should create a new entry here, if not, it's using the old entry,
> and the old inode.
>
> So please check this first. You write you invalidate the entry and
> inode, but you'r program has to delete them also (internally).
>
> Stef
>
> 2010/9/16 Barry Friedman <friedman.barry@...>:
>> I have a filesystem using the lowlevel API where state in my program
>> is represented in FUSE by some files and directories. When I delete
>> the state I tried using fuse_lowlevel_notify_inval_inode() and
>> fuse_lowlevel_notify_inval_entry() to tell FUSE to re-query the file
>> system attributes. If I later re-create the state and I use the same
>> file and directory names and what happens is that somewhere FUSE still
>> has the old inode number so it calls the getattr() callback with this
(Continue reading)


Gmane