[Top] [All Lists]

Re: Just a small reminder

To: lord@xxxxxxx
Subject: Re: Just a small reminder
From: "William L. Jones" <jones@xxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Sep 2000 12:11:41 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <200009171351.IAA27556@xxxxxxxxxxxxxxxxxxxx>
References: <Your message of "Sat, 16 Sep 2000 17:31:38 CDT>
Sender: owner-linux-xfs@xxxxxxxxxxx
At 08:50 AM 9/17/00 -0500, lord@xxxxxxx wrote:
> The use the dentry d_iput function creates a problem with nfsd.   It to
> creates a dentry from an iget like open_by_filehndle and will cause
> vnode reference  problems.  Couldn't this problem be solved cleaner
> by using the linux provided iop functions like put_inode and clear_inode.
> Then the nfs would not have special case for xfs.
> Given the way the vn_rele works currently is their a problem with it
> marking the vnode inactive.   Linux will retain
> the inode in its cache until it decides to prune it, which means it may
> reuse it.   Wouldn't it be
> better to mark it inactive in a clear_inode call?
> Bill Jones

Yes, I am aware of this. The issues here are that the put_inode method is
racey in that it always calls put inode, then does an atomic decrement and
lock on the count. Only if the count hits zero does it obtain a lock and do
special processing. It is quite possible we would call the inactive code,
and then have something else grab a reference count.

But you have the same problem with the current code.  Their
is no difference between using dcache d_iput or the supper operation put_inode.!

In both cases most of the iput work is done after the call to vn_rele.
The second method is better since it works with nfsd.

Can xfs_inactive sleep? It it can then both methods have a problem because
it is possible to have a d_iput or iput running vn_rele at the same time
and i_count will be greater then 1!

Using d_iput is not perfect either as we cannot hold a lock across all of it.

Marking the vnode inactive is not a problem here, we do not remove the inode
from the system at this point, that is done in the clear inode phase. In
fact XFS will keep xfs inodes after the linux inode has gone in some cases.
We cannot use clear_inode to call inactive, as you only get here on inode
reuse. This is a long time later.

I found the clear_inode code!


<Prev in Thread] Current Thread [Next in Thread>