From owner-freebsd-fs@freebsd.org Fri Jan 27 17:07:11 2017 Return-Path: Delivered-To: freebsd-fs@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 4490BCC37C7 for ; Fri, 27 Jan 2017 17:07:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7E813B72 for ; Fri, 27 Jan 2017 17:07:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA04199 for ; Fri, 27 Jan 2017 19:07:08 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1cX9zQ-000D4C-KB for freebsd-fs@FreeBSD.org; Fri, 27 Jan 2017 19:07:08 +0200 To: freebsd-fs From: Andriy Gapon Subject: ZFS: spa_deadman -> vdev_deadman -> sx_xlock Message-ID: <9f6712e4-f6f4-670a-11b8-babfad9a9463@FreeBSD.org> Date: Fri, 27 Jan 2017 19:06:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2017 17:07:11 -0000 There is a fundamental problem with the spa_deadman code. The function is a callout and callouts must not sleep. On the other hand, on FreeBSD we implemented illumos mutexes as sx locks. As a result, if the deadman timer ever fires we can easily violate the rule. With INVARIANTS that would result in a panic. Not sure how the problem would manifest itself without INVARIANTS. In either case, I would appreciate any suggestions on how to fix the problem. Thanks! -- Andriy Gapon