Subject: Re: CVS commit: src/sys/miscfs
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Bill Studenmund <wrstuden@netbsd.org>
List: source-changes
Date: 06/17/2004 10:50:25
--WYTEVAkct0FjGQmd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 17, 2004 at 11:02:07AM +0900, YAMAMOTO Takashi wrote:
> > > how can vn_lock(LK_EXCLUSIVE | LK_RETRY) fail in this case?
> >=20
> > Somehow the lock is dying.
>=20
> dying?  can you please be more specific?

Lock being drained, for instance. Specifically for PDIRUNLOCKED the main=20
point was to handle errors in looking up '..'. If there's an error getting=
=20
'..' and we can't then re-lock '.', this flag tells callers something=20
happened.

> > Yes, for it to happen we have to have
> > wandered into the weeds, but this code methodology is to try and help u=
s=20
> > get somewhere a bit safer. i.e. not add more error states on top if we=
=20
> > don't have to.
>=20
> we have many code which assume that vn_lock with LK_RETRY never fails.
> are you going to add error checks on all of them?
> i think that it just bloats the code without any benefits.

The difference here is that you're changing the state of PDIRUNLOCK. Don't=
=20
clear it if you don't know the lock succeeded.

Take care,

Bill

--WYTEVAkct0FjGQmd
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFA0dnhWz+3JHUci9cRAvC4AJ9LIXfdJEH/TMbyfTGQoHsqgbRftgCfVKkY
dXhe4VwhRaAjAPY0tMIC3Ds=
=ZJRc
-----END PGP SIGNATURE-----

--WYTEVAkct0FjGQmd--