Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2002 03:06:57 +0700 (NOVST)
From:      "Semen A. Ustimenko" <semenu@FreeBSD.org>
To:        Boris Popov <bp@butya.kz>
Cc:        freebsd-fs@FreeBSD.org, "Flood, Jim" <Jim.Flood@acirro.com>
Subject:   Re: NULLFS-related possible deadlock + fix proposal
Message-ID:  <20020516023242.L1992-200000@def.the.net>
In-Reply-To: <Pine.BSF.4.21.0205131728290.16895-100000@lion.butya.kz>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-1247632081-1021493217=:1992
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi!

On Mon, 13 May 2002, Boris Popov wrote:

> On Sat, 11 May 2002, Semen A. Ustimenko wrote:
>
> > DEADLOCK...
>
> 	Indeed, weird situation. Nice analysis, btw :)
>
It would be weird, if it didn't happen in practice :)
Thanks are going to Jim, not me...

If you like, i can provide a small patch to help you simulate the problem,
but it's kind of hack as NULLFS looks seriously broken in -current.

> > Make vn_lock() in vrele() lock vnode only LK_THISLAYER. Obviously, the
> > NULLFS and other stacking FSes will have to deal with this in their
> > VOP_INACTIVE() handlers. This changes won't touch real FSes as they ignore
> > the LK_THISLAYER, don't they?
>
> 	Yes, you're correct in that LK_THISLAYER currently used only by
> "stacked" filesystem(s) and it used exactly for such situations to avoid
> deadlocks.  The proposed solution may even work without any additional
> code because null_inactive() performs its own management on the lower
> vnode locking.
>
Looks like we can't do this that easily, because VOP_INACTIVE is called
from different places. Most noticeable from vput(), and it's obvious that
vput() caller is responsible for vnode lock...

Any ideas?

BYe!

--0-1247632081-1021493217=:1992
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="nullfs-deadlock.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <20020516030657.Q1992@def.the.net>
Content-Description: 
Content-Disposition: attachment; filename="nullfs-deadlock.patch"

SW5k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UoeHAs
IG51bGxfaGFzaCk7DQogIAlsb2NrbWdyKCZudWxsX2hhc2hsb2NrLCBMS19S
RUxFQVNFLCBOVUxMLCB0ZCk7DQogIA0KICAJLyoNCiAgCSAqIE5vdyBpdCBp
cyBzYWZlIHRvIGRyb3AgcmVmZXJlbmNlcyB0byB0aGUgbG93ZXIgdm5vZGUu
DQogIAkgKiBWT1BfSU5BQ1RJVkUoKSB3aWxsIGJlIGNhbGxlZCBieSB2cmVs
ZSgpIGlmIG5lY2Vzc2FyeS4NCiAgCSAqLw0KISAJdnJlbGUobG93ZXJ2cCk7
DQohIAl2cmVsZShsb3dlcnZwKTsNCiAgDQogIAl2ZGF0YSA9IHZwLT52X2Rh
dGE7DQogIAl2cC0+dl9kYXRhID0gTlVMTDsNCg==
--0-1247632081-1021493217=:1992--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020516023242.L1992-200000>