Date: Thu, 18 Aug 2016 00:03:33 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: Konstantin Belousov <kostikbel@gmail.com> Cc: "kib@FreeBSD.org" <kib@FreeBSD.org>, Mark Johnston <markj@freebsd.org>, FreeBSD Stable <freebsd-stable@freebsd.org>, Harry Schmalzbauer <freebsd@omnilan.de> Subject: Re: unionfs bugs, a partial patch and some comments [Was: Re: 1-BETA3 Panic: __lockmgr_args: downgrade a recursed lockmgr nfs @ /usr/local/share/deploy-tools/RELENG_11/src/sys/fs/unionfs/union_vnops.c:1905] Message-ID: <YTXPR01MB018919BE87B12E458144E218DD140@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <20160812123950.GO83214@kib.kiev.ua> References: <57A79E24.8000100@omnilan.de> <YQBPR01MB0401201977AEA8A803F27B23DD1A0@YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM> <57A83C78.1070403@omnilan.de> <20160809060213.GA67664@raichu> <57A9A6C0.9060609@omnilan.de> <YTOPR01MB0412B2A08F1A3C1A3B2EB160DD1E0@YTOPR01MB0412.CANPRD01.PROD.OUTLOOK.COM>, <20160812123950.GO83214@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--_004_YTXPR01MB018919BE87B12E458144E218DD140YTXPR01MB0189CANP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Kostik wrote: [stuff snipped] >insmnque() performs the cleanup on its own, and that default cleanup isnot= suitable >for the situation. I think that insmntque1() would betterfit yo= ur requirements, your >need to move the common code into a helper.It seems = that >unionfs_ins_cached_vnode() cleanup could reuse it. <https://lists.freebsd.org> I've attached an updated patch (untested like the last one). This one creat= es a custom version insmntque_stddtr() that first calls unionfs_noderem() and th= en does the same stuff as insmntque_stddtr(). This looks like it does the requ= ired stuff (unionfs_noderem() is what the unionfs VOP_RECLAIM() does). It switches the node back to using its own v_vnlock that is exclusively loc= ked, among other things. rick --_004_YTXPR01MB018919BE87B12E458144E218DD140YTXPR01MB0189CANP_ Content-Type: application/octet-stream; name="unionfs-newvnode.patch" Content-Description: unionfs-newvnode.patch Content-Disposition: attachment; filename="unionfs-newvnode.patch"; size=1862; creation-date="Thu, 18 Aug 2016 00:03:25 GMT"; modification-date="Thu, 18 Aug 2016 00:03:25 GMT" Content-Transfer-Encoding: base64 LS0tIGZzL3VuaW9uZnMvdW5pb25fc3Vici5jLnNhdgkyMDE2LTA4LTExIDE4OjIwOjEwLjU4NTk5 OTAwMCAtMDQwMAorKysgZnMvdW5pb25mcy91bmlvbl9zdWJyLmMJMjAxNi0wOC0xNyAxOTozODox NC43OTUwMjMwMDAgLTA0MDAKQEAgLTEwMSw2ICsxMDEsMjMgQEAgdW5pb25mc19nZXRfaGFzaGhl YWQoc3RydWN0IHZub2RlICpkdnAsIAogfQogCiAvKgorICogQ2xlYW4gdXAgZnVuY3Rpb24gZm9y IGluc21udHF1ZTEoKS4KKyAqIEZpcnN0LCBjYWxsIHVuaW9uZnNfbm9kZXJlbSgpIGFuZCB0aGVu IGRvIHRoZSBzYW1lIGFzIGluc21udHF1ZV9zdGRkdHIoKS4KKyAqIE1heWJlIGluc21udHF1ZV9z dGRkdHIoKSBzaG91bGQgYmVjb21lIG5vbi1zdGF0aWMsIHNvIEkgY2FuIGp1c3QgY2FsbAorICog aXQgaGVyZT8KKyAqLworc3RhdGljIHZvaWQKK3VuaW9uZnNfaW5zbW50cXVlX2R0cihzdHJ1Y3Qg dm5vZGUgKnZwLCB2b2lkICpkdHJfYXJnKQoreworCisJdW5pb25mc19ub2RlcmVtKHZwLCBjdXJ0 aHJlYWQpOworCXZwLT52X2RhdGEgPSBOVUxMOworCXZwLT52X29wID0gJmRlYWRfdm5vZGVvcHM7 CisJdmdvbmUodnApOworCXZwdXQodnApOworfQorCisvKgogICogR2V0IHRoZSBjYWNoZWQgdm5v ZGUuCiAgKi8KIHN0YXRpYyBzdHJ1Y3Qgdm5vZGUgKgpAQCAtMjU1LDExICsyNzIsNi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TkxPQ0sodnAsIDApOworCiAJaWYgKHBhdGggIT0gTlVMTCAmJiBkdnAg IT0gTlVMTFZQICYmIHZ0ID09IFZESVIpCiAJCSp2cHAgPSB1bmlvbmZzX2luc19jYWNoZWRfdm5v ZGUodW5wLCBkdnAsIHBhdGgpOwogCWlmICgoKnZwcCkgIT0gTlVMTFZQKSB7CkBAIC0zMTQsNiAr MzM4LDcgQEAgdW5pb25mc19ub2RlZ2V0KHN0cnVjdCBtb3VudCAqbXAsIHN0cnVjdAogCiB1bmlv bmZzX25vZGVnZXRfb3V0OgogCWlmIChsa2ZsYWdzICYgTEtfVFlQRV9NQVNLKQorCQkvKiBTaG91 bGQgdGhlcmUgYmUgYSBjaGVjayBmb3IgVklfRE9PTUVEIGhlcmU/ICovCiAJCXZuX2xvY2sodnAs IGxrZmxhZ3MgfCBMS19SRVRSWSk7CiAKIAlyZXR1cm4gKDApOwo= --_004_YTXPR01MB018919BE87B12E458144E218DD140YTXPR01MB0189CANP_--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTXPR01MB018919BE87B12E458144E218DD140>