Re: [PATCH] nfsd: lockdep annotation

From: Neil Brown
Date: Thu Aug 24 2006 - 03:48:16 EST


On Thursday August 24, arjan@xxxxxxxxxxxxx wrote:
> On Thu, 2006-08-24 at 16:12 +1000, Neil Brown wrote:
> >
> > I had flags the fh_lock in nfsd_setattr a I_MUTEX_CHILD which you
> > didn't however I see that isn't needed (Why do we have PARENT and
> > CHILD and NORMAL.... you would think that any two would do ??)
>
> for cross directory renames 3 are needed ;(

I see....
If one of the source/dest directories is an ancestor to the other
it gets _PARENT while the descendent gets _CHILD,
otherwise the destination gets _PARENT and the source gets _CHILD.
I guess the terms 'PARENT' and 'CHILD' refer more to the relationship
of the locks than the relationship of the directories.

(If the destination name exists, it gets locked with _NORMAL)

I still find the terminology a bit confusing.
_GRANDPARENT -> _PARENT -> _NORMAL

would make more sense to me, but maybe it isn't that important.

Thanks for the explanation.

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/