Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Apr 2006 19:06:13 -0400
From:      Alexander Kabaev <kabaev@gmail.com>
To:        Alexander Kabaev <kabaev@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: vn_lock & ffs_snapremove
Message-ID:  <20060428190613.45f72f84@kan.dnsalias.net>
In-Reply-To: <20060428185749.171da2bc@kan.dnsalias.net>
References:  <20060428130030.GC1270@deviant.kiev.zoral.com.ua> <20060428185749.171da2bc@kan.dnsalias.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Fri, 28 Apr 2006 18:57:49 -0400
Alexander Kabaev <kabaev@gmail.com> wrote:

> On Fri, 28 Apr 2006 16:00:30 +0300
> Kostik Belousov <kostikbel@gmail.com> wrote:
> 
> > Look at the two code fragments
> > 
> > 1. from vn_lock(9):
> > 
> > 		error = VOP_LOCK(vp, flags | LK_INTERLOCK, td);
> > 		flags &= ~LK_INTERLOCK;
> > 		KASSERT((flags & LK_RETRY) == 0 || error == 0,
> > 		    ("LK_RETRY set with incompatible flags %d\n",
> > flags)); /*
> > 		 * Callers specify LK_RETRY if they wish to get dead
> > vnodes.
> > 		 * If RETRY is not set, we return ENOENT instead.
> > 		 */
> > 		if (error == 0 && vp->v_iflag & VI_DOOMED &&
> > 		    (flags & LK_RETRY) == 0) {
> > 			VOP_UNLOCK(vp, 0, td);
> > 			error = ENOENT;
> > 			break;
> > 		}
> > 
> > 2. ffs_snapremove(9):
> > 
> > (vp->v_vnlock for snapshot vnode vp points to sn_snlock)
> > 		lkp = vp->v_vnlock;
> > 		vp->v_vnlock = &vp->v_lock;
> > 
> > Is there anything that would prevent these two fragments to
> > intervene ? Esp. bad looks the situation where VOP_LOCK() from
> > vn_lock executed and locked doomed snapshot vnode, after that
> > ffs_snapremove replaces vnode lock and VOP_UNLOCK attempted on
> > _another_ lock.
> > 
> > If this scenario can happen (as it seems), then, probably,
> > some measures like transferlockers(9) are needed ?
> > _______________________________________________
> > freebsd-fs@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> > To unsubscribe, send any mail to
> > "freebsd-fs-unsubscribe@freebsd.org"
> 
> Привет,
> 
> тут возникло предложение наказать тебя commit bit-ом. Интересует
> мнение самого наказуемого на это предложение :)
> 
> -- 
> Alexander Kabaev
Sorry for wide distribution. Throw stones in my direction, please.

-- 
Alexander Kabaev

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (FreeBSD)

iD8DBQFEUp/vQ6z1jMm+XZYRAmeKAJsF6QubAgB9sdO4Sd37hIuktXYjtgCgp/zz
pbUDz2A1hjBSaa9nE6yrzEk=
=9REo
-----END PGP SIGNATURE-----

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