xfs
[Top] [All Lists]

Re: Just a small reminder

To: Steve Lord <lord@xxxxxxx>, "William L. Jones" <jones@xxxxxxxxxxxxxxxxxx>
Subject: Re: Just a small reminder
From: "William L. Jones" <jones@xxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Sep 2000 11:05:36 -0500
Cc: lord@xxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <200009181453.JAA32353@xxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
Thanks for taking a look!

I suspect that you may  have to reach into the inode.c to really fix the
problem. The mod I gave you has all the same problem as the d_iput method but it
will help with nfsd issue.

Bill Jones



At 09:53 AM 9/18/00 -0500, Steve Lord wrote:


The real problem here is that two threads can end up attempting to manipulate
inode state based on the reference count crossing through 1. What we actually
need is synchronization between these threads.

Based on the code after your patch:

Consider vn_hold - which wraps around igrab and vn_rele which calls iput
and ends up in vn_put_inode. These both manipulate the inode count.

A thread doing a vn_hold racing with a thread in vn_put_inode will block whilst
vn_put_inode is checking the hold count. But once we release the lock in the
vnode and call xfs_inactive the vn_hold will continue and bump the count.

So we now have one thread doing the inactive processing and another thread
bumping the hold count. If this was an unlinked inode then inactive will start
the work of removing it from the disk. At the same time the thread doing the
vn_hold will carry on using the inode, this is bad.

The code currently in the tree does have a similar race in it - I am not sure
yet if it is a narrower window than with your patch, it survives a dbench load
of 100, I will test the patch which will help the NFS server end of things.

There is still work to do on this either way, and trying to do this without
modifying iput is non-trivial to say the least.

Steve



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