From owner-freebsd-current@freebsd.org Mon Jan 9 02:33:05 2017 Return-Path: Delivered-To: freebsd-current@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 36CB9CA0801 for ; Mon, 9 Jan 2017 02:33:05 +0000 (UTC) (envelope-from anindya49@hotmail.com) Received: from BLU004-OMC4S22.hotmail.com (blu004-omc4s22.hotmail.com [65.55.111.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE9351191 for ; Mon, 9 Jan 2017 02:33:04 +0000 (UTC) (envelope-from anindya49@hotmail.com) Received: from NAM04-BN3-obe.outbound.protection.outlook.com ([65.55.111.136]) by BLU004-OMC4S22.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sun, 8 Jan 2017 18:31:57 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0GTed57s4hl+qsSybmjT6dXxRTeeIvukDDGt3Zy00wU=; b=Qv8eaIprtSR/a+ah51Q4ZiWXdQcCatB7sHqwhUzPEn4daFiVla5Kpeuq4AdnELAogTFZbp4MSRs2UYkv554jP2S+/YoEdCZXy2M+5+4gOwaMhjYDOB7ZdHLtOB5DVf4+FTOkTovrz+ID/rPZXrQw2ZwP8+iKI/1xfO9H5E5aeA9pRXEFqw/fVhGzdSMVVWL0ZM2jGlSOfTg0YgVeUbZVDViw+EPhWWSES8yribc7g/tAbW1Cdsc6z+cRr3u2KfabQuyMgaNMGUO3tC3cVPzOnNBT73vK/9Ec9gwa/k83uv/Pnax1X4EYvaJHBJ/nG5KtBkhtd+L6oDv5FRYhzV+GUw== Received: from BN3NAM04FT048.eop-NAM04.prod.protection.outlook.com (10.152.92.52) by BN3NAM04HT006.eop-NAM04.prod.protection.outlook.com (10.152.92.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8; Mon, 9 Jan 2017 02:31:56 +0000 Received: from BN6PR22MB0802.namprd22.prod.outlook.com (10.152.92.59) by BN3NAM04FT048.mail.protection.outlook.com (10.152.92.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Mon, 9 Jan 2017 02:31:39 +0000 Received: from BN6PR22MB0802.namprd22.prod.outlook.com ([10.171.180.21]) by BN6PR22MB0802.namprd22.prod.outlook.com ([10.171.180.21]) with mapi id 15.01.0829.013; Mon, 9 Jan 2017 02:31:39 +0000 From: Anindya Mukherjee To: Benjamin Kaduk CC: "freebsd-current@freebsd.org" Subject: RE: New Lock Order Reversal in 12.0? Thread-Topic: New Lock Order Reversal in 12.0? Thread-Index: AQHSag/a8ajcUxWClUK1AyeooZ2LxKEvT7sAgAAY/m8= Date: Mon, 9 Jan 2017 02:31:39 +0000 Message-ID: References: , <20170109004717.GE8460@kduck.kaduk.org> In-Reply-To: <20170109004717.GE8460@kduck.kaduk.org> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mit.edu; dkim=none (message not signed) header.d=none;mit.edu; dmarc=none action=none header.from=hotmail.com; x-incomingtopheadermarker: OriginalChecksum:F66C45FE03EE7DC3B4A36A51B708368A251F67A4AB6D0B2A8A99B891D0627AEC; UpperCasedChecksum:72F16CB1FB8756DB761FF410B12030926A7E9583B6E2B3B9FE2043177ED3D972; SizeAsReceived:7727; Count:40 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [u4J6Hcp2XqRxKAtPq2LRBfQO5XUuylgJ] x-incomingheadercount: 40 x-eopattributedmessage: 0 x-microsoft-exchange-diagnostics: 1; BN3NAM04HT006; 7:RjUeD7lDqHn7k3OKly8GV0Zz0VjgwmjG3wFgOhq+isIj2q4gyABX4TzSk5ecGtohKLSo1OPjgfzqfWIf+gkFXdclI9qdEG7ExIATWgmrSrJg/z7TwA7ocJZx8DxQ2p4yJYmhjI6KGztL9uXRl+fbDUucoDHGU4lmusgk75DJ49I9kGghAHYewORGMW3tjYMUfug4E/QWJNCSFAw2buyjPP6zaCqqh6QXDPEXANYZDgp/KVMW3THUqcCuSu+LzM35bSk94dLZCXjbq9XxkATTqOdZMLfS0/Bpd+h0bb8UNZ4zGoIZvnIP/d8SZzb104i8np7YQYWAz8dDBDx/IY4Ubk3azcoyNYR/drOo55OJ9xw/JDsj60zQxiwJpGrmwyB7jTDxW2g1r4yIqghLOHG1hQXvAhyTd+sByO4k/LYCYgq0GhUEs0bvdTR44lkQPu4FnUisqbDoPuxl3yS+VSlPwQ== x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(10019020)(98900003); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3NAM04HT006; H:BN6PR22MB0802.namprd22.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: 336db30d-39fa-4229-0f71-08d43837a44d x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(1601124038)(1603103113)(1603101340)(1601125047)(1701031023); SRVR:BN3NAM04HT006; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444111334)(444112120)(432015012)(82015046); SRVR:BN3NAM04HT006; BCL:0; PCL:0; RULEID:; SRVR:BN3NAM04HT006; x-forefront-prvs: 0182DBBB05 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2017 02:31:39.4240 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3NAM04HT006 X-OriginalArrivalTime: 09 Jan 2017 02:31:57.0411 (UTC) FILETIME=[8C654330:01D26A20] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 02:33:05 -0000 Hi Ben, Thanks for your reply, and yes, I did notice #238. I should say at this poi= nt that I'm a newbie when it comes to kernel code and am trying to learn ab= out it (hence current). The entry you refer to does look a bit like the one I've got, but I'm not t= otally sure if the same code path is being followed to arrive at this LOR. = An inode is being created in my case, vs a directory creation (entry + inod= e probably) in #238, and then a sync is being attempted, which causes locks= to activate in the softdep code. I've read a bit about this from McCusick'= s book but the details are still fuzzy. Perhaps you are trying to tell me that it's benign? I know that WITNESS has= false positives, an example being #236 where due to shared vs exclusive vn= ode locks required on the two ways to lock bufwait and dirhash a deadlock n= ever happens.=20 Best, Anindya ________________________________________ From: Benjamin Kaduk [kaduk@mit.edu] Sent: January 8, 2017 4:47 PM To: Anindya Mukherjee Cc: freebsd-current@freebsd.org Subject: Re: New Lock Order Reversal in 12.0? On Mon, Jan 09, 2017 at 12:32:28AM +0000, Anindya Mukherjee wrote: > Hi, I'm running 12.0-current and noticed a LOR message from WITNESS which= I couldn't find a report about. I looked at http://sources.zabbadoz.net/fr= eebsd/lor.html, among other places. > > system details: > root@triskelion:~ # uname -a > FreeBSD triskelion 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r311461: Thu Jan = 5 22:46:38 UTC 2017 root@releng3.nyi.freebsd.org:/usr/obj/usr/src/sys/= GENERIC amd64 > root@triskelion:~ # freebsd-version > 12.0-CURRENT > > > WITNESS report: > lock order reversal: > 1st 0xfffff8002e8049a0 ufs (ufs) @ /usr/src/sys/kern/vfs_subr.c:2598 > 2nd 0xfffffe01e7ce9b40 bufwait (bufwait) @ /usr/src/sys/ufs/ffs/ffs_vnop= s.c:277 > 3rd 0xfffff8002ec7b9a0 ufs (ufs) @ /usr/src/sys/kern/vfs_subr.c:2598 > stack backtrace: > #0 0xffffffff80aa6fd0 at witness_debugger+0x70 > #1 0xffffffff80aa6ed3 at witness_checkorder+0xde3 > #2 0xffffffff80a20c15 at __lockmgr_args+0x725 > #3 0xffffffff80d06fc5 at ffs_lock+0xa5 > #4 0xffffffff8101c0c0 at VOP_LOCK1_APV+0xe0 > #5 0xffffffff80b1a6aa at _vn_lock+0x9a > #6 0xffffffff80b0ac94 at vget+0x64 > #7 0xffffffff80afd19c at vfs_hash_get+0xcc > #8 0xffffffff80d02e5e at ffs_vgetf+0x3e > #9 0xffffffff80cf9787 at softdep_sync_buf+0xc37 > #10 0xffffffff80d07c51 at ffs_syncvnode+0x2a1 > #11 0xffffffff80d06e60 at ffs_fsync+0x20 > #12 0xffffffff8101b110 at VOP_FSYNC_APV+0xe0 > #13 0xffffffff80d0f2f0 at ufs_direnter+0x870 > #14 0xffffffff80d18050 at ufs_makeinode+0x5c0 > #15 0xffffffff80d13d7a at ufs_create+0x3a > #16 0xffffffff810199ca at VOP_CREATE_APV+0xda > #17 0xffffffff80b19f77 at vn_open_cred+0x2c7 > > This is based on the FreeBSD-12.0-CURRENT-amd64-20170105-r311461-memstick= .img installer. Known issue? You do not think it looks like http://sources.zabbadoz.net/freebsd/lor/238.= html ? -Ben