On Fri Sep 17 17:13:40 EDT 2010, [email protected] wrote:
> On Thu, Sep 16, 2010 at 11:02 PM, erik quanstrom <[email protected]> 
> wrote:
> > i have these processes all deadlocked.  8.out
> > is serving /n/mntpt.
> >
> > xxx        11921346    0:00   0:00      436K Create   8.out
> > xxx        11921785    0:00   0:00       24K Open     cat /n/mntpt/sos
> > xxx        11921786    0:00   0:00       24K Unmount  unmount /n/mntpt
> > xxx        11921787    0:00   0:00       44K Pwrite   echo x y
> 
> tell us why it's interesting.  it looks like 8.out can see
> itself so you've got a bad loop.

on second thought, i'm not sure i fully understand why
not forking the namespace should result in a deadlock.

8.out is opening /dev/sdC0/part OTRUNC
cat is opening /n/mntpt/sos
unmount is opening /n/mntpt

so 8.out isn't waiting for itself.
it seems that any one of the three could resonably
finish, but they deadlock.  but the problem is

                have                            want
11921346                                        rlock(&pg->ns)
11921785        rlock(&mh->lock);
11921786        wlock(&pg->ns)                  wlock(&m->lock);
                rlock(&mh->lock) [walk]

the locks for pg->ns mh->lock and m->lock aren't nested.
it would seem if they were, we would get a winner and all three
operations would complete (or fail).  so, why can't the locks
be nested?  and why does this have to deadlock?  what am i missing?

- erik

Reply via email to