From owner-freebsd-stable@freebsd.org Thu Aug 18 04:36:47 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 789D0BBC2F6 for ; Thu, 18 Aug 2016 04:36:47 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0097.outbound.protection.outlook.com [65.55.169.97]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA9071A99; Thu, 18 Aug 2016 04:36:45 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) by YTXPR01MB0190.CANPRD01.PROD.OUTLOOK.COM (10.165.218.134) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Thu, 18 Aug 2016 00:03:33 +0000 Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) with mapi id 15.01.0557.022; Thu, 18 Aug 2016 00:03:33 +0000 From: Rick Macklem To: Konstantin Belousov CC: "kib@FreeBSD.org" , Mark Johnston , FreeBSD Stable , Harry Schmalzbauer 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] Thread-Topic: 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] Thread-Index: AQHR8Usp3UC6l4vlEEOdyPFAeIRbFKBAJI+AgAA/AgCAA/TscIAA8igAgAiYa2I= Date: Thu, 18 Aug 2016 00:03:33 +0000 Message-ID: References: <57A79E24.8000100@omnilan.de> <57A83C78.1070403@omnilan.de> <20160809060213.GA67664@raichu> <57A9A6C0.9060609@omnilan.de> , <20160812123950.GO83214@kib.kiev.ua> In-Reply-To: <20160812123950.GO83214@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-originating-ip: [25.165.183.132] x-ms-office365-filtering-correlation-id: 830ab853-5b1e-41ac-60a6-08d3c6fb1844 x-microsoft-exchange-diagnostics: 1; YTXPR01MB0190; 6:HR843R1lkSDVB9mt2Zs1v+ZoW8cYmSQbQ5xi+VifANvghakllvjx9X2l5xrq5yyGwqu0JTKp8gxnsTTxLJxkJqr30vp4P1dM/ZDj/K5fbZ+04SOOLB9K6SVFwtGwQfbxv56NsXGoi3LrLhCCt5ri01c3LQhGHiBpJcghCrlWGaNqImR4/SfrDvRHt9KKyDKJzjpB5J04HN5xFmPKe+4DAqQjxRNkLuIa1q8dIWGs7OqsuzuFM8ZGvYTFQoCOQPxyfoia45hZy3XUoPM+QUIsqhLn4LHN9j8uaTGuuSxiZJY6HyCvOqYip/9l/a8tvdsP; 5:ikTHR3f4lUwzUGS0ZzlgKNsKK7KKcGW5Pf3YU1/FyZxB/Ipba0OoRvnF2QxOPqaPslFp/OAJToODIrnmocPEpiVixf7OKS3gsodXSOEtwFOUXGnMAFNjo1SbdkRzlIiuiSP5csR7fuQRWVEAr05p1g==; 24:151P3BcwqC2Js7DrEy1ynakG8is5hBVh2Zi3n3chWCXJQnbUKK+DdNaDnC57qccBORNr1oIiKkbv9E+w8sDdMmSwfn3tFv8X2K1a0CdSpx4=; 7:wfi1sj+3vzhDt7NHMNq9vq83qG0UCjyMFnF8gkeK3MWaNcPWYtbMNncCY4d6fb1m+js8Xyh+EMhhmeXhavbJ49jxs9/9mB7ON4Ycbv4Fxt9lzIWp5w2aDaQszkA7yUE7CUdKema5sfuizYNkk8EYH2aeLyK7ceezkF/7BVxb7w8ROuyjCrlj5JXRGm2g0lgKC9sgrtaUuovcdCKDWJ+Pq7QB8jVAv6jLsOdHBKqMoFmbK5h4QFp1ej0M29hinFXX x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:YTXPR01MB0190; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(75325880899374); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415321)(6040176)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6042046)(6043046); SRVR:YTXPR01MB0190; BCL:0; PCL:0; RULEID:; SRVR:YTXPR01MB0190; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(7916002)(199003)(189002)(51444003)(24454002)(33656002)(74316002)(105586002)(106116001)(7696003)(97736004)(7846002)(11100500001)(81166006)(16236675004)(87936001)(4326007)(50986999)(2906002)(189998001)(6116002)(8676002)(102836003)(3846002)(5640300001)(8936002)(586003)(68736007)(7736002)(110136002)(66066001)(7906003)(1411001)(101416001)(2900100001)(86362001)(77096005)(92566002)(3280700002)(122556002)(2950100001)(99936001)(19580395003)(5002640100001)(106356001)(93886004)(74482002)(10400500002)(9686002)(15975445007)(54356999)(5890100001)(19627405001)(81156014)(19617315012)(76176999)(19625215002)(3660700001); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0190; H:YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/mixed; boundary="_004_YTXPR01MB018919BE87B12E458144E218DD140YTXPR01MB0189CANP_" MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2016 00:03:33.3665 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0190 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2016 04:36:47 -0000 --_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. 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 OTAwMCAtMDQwMAorKys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