On Tue, 2003-08-12 at 00:16, Maneesh Soni wrote:
> IMHO, it will be nice to have active maintainer for autofs4, particularly for
> keeping autofs4 in sync with VFS layer changes. This is necessary as I found
> autofs4 interacting with VFS (dcache and vfsmount) in a way no other file 
> system does. 
> 
> The problem is with is_tree_busy() routine where we check and depend on 
> dentry ref count to find busy dentries. Though it is done under dcache_lock
> but I don't think taking dcache_lock will guarantee consistent reference count
> for dentries. We have other people doing dget() or dput() without taking
> dcache_lock. Further, introduction of RCU based dcache lookup in 2.5.61 it is 
> more susceptible to races.

I've actually been thinking about this for the last week or so.  I think
the correct solution is to make is_tree_busy a three-phase affair:
     1. get all the vfsmnt structures and inc their refcounts
     2. take dcache_lock and do the core is_tree_busy logic
     3. traverse the list of vfsmnts we got in 1 and release them

The current code gets itself into a tangle because its mixing the lock
ranking of vfsmnt_lock and dcache_lock, and only happens to get away
with it (I think the race can only actually trigger if someone plays
namespace manipulation games while automountd is trying to run an
expire, which seems unlikely since only root can play such games, and
presumably they're going to get autofs manage its own filesystems).

        J

_______________________________________________
autofs mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to