From owner-freebsd-bugs@freebsd.org Fri Mar 23 10:49:34 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2E0F5EC5E for ; Fri, 23 Mar 2018 10:49:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5FD56CFDF for ; Fri, 23 Mar 2018 10:49:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 434611601E for ; Fri, 23 Mar 2018 10:49:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w2NAnXaV098067 for ; Fri, 23 Mar 2018 10:49:33 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w2NAnXLT098065 for freebsd-bugs@FreeBSD.org; Fri, 23 Mar 2018 10:49:33 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 226870] [panic] cdstrategy violates GEOM I/O contract Date: Fri, 23 Mar 2018 10:49:33 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: avg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2018 10:49:34 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D226870 Bug ID: 226870 Summary: [panic] cdstrategy violates GEOM I/O contract Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: avg@FreeBSD.org anic: sleepq_add: td 0xfffff80008e1c000 to sleep on wchan 0xfffff801e58b8048 with sleeping prohibited cpuid =3D 0 curthread: 0xfffff80008e1c000 stack: 0xfffffe07e1883000 - 0xfffffe07e1887000 stack pointer: 0xfffffe07e1886820 time =3D 1521652565 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff804670bb =3D db_trace_self_wrapper+0x2b/frame 0xfffffe07e1886750 kdb_backtrace() at 0xffffffff806d4c79 =3D kdb_backtrace+0x39/frame 0xfffffe07e1886800 vpanic() at 0xffffffff80699da6 =3D vpanic+0x166/frame 0xfffffe07e1886840 kassert_panic() at 0xffffffff80699adb =3D kassert_panic+0x16b/frame 0xfffffe07e18868b0 sleepq_add() at 0xffffffff806e1902 =3D sleepq_add+0x342/frame 0xfffffe07e18= 86910 _sleep() at 0xffffffff806a41f7 =3D _sleep+0x2b7/frame 0xfffffe07e18869b0 cam_periph_ccbwait() at 0xffffffff802b53ad =3D cam_periph_ccbwait+0x5d/frame 0xfffffe07e18869e0 cam_periph_runccb() at 0xffffffff802b51d8 =3D cam_periph_runccb+0xb8/frame 0xfffffe07e1886a40 cdrunccb() at 0xffffffff802d52fc =3D cdrunccb+0x3c/frame 0xfffffe07e1886a60 cdprevent() at 0xffffffff802d4beb =3D cdprevent+0x7b/frame 0xfffffe07e1886a= a0 cdcheckmedia() at 0xffffffff802d48b2 =3D cdcheckmedia+0x22/frame 0xfffffe07e1886af0 cdstrategy() at 0xffffffff802d2a36 =3D cdstrategy+0x56/frame 0xfffffe07e188= 6b20 g_disk_start() at 0xffffffff80608330 =3D g_disk_start+0x170/frame 0xfffffe07e1886b70 g_io_schedule_down() at 0xffffffff8060c1db =3D g_io_schedule_down+0x1eb/fra= me 0xfffffe07e1886b90 g_down_procbody() at 0xffffffff8060cbdd =3D g_down_procbody+0x6d/frame 0xfffffe07e1886ba0 fork_exit() at 0xffffffff8065e410 =3D fork_exit+0xd0/frame 0xfffffe07e1886b= f0 fork_trampoline() at 0xffffffff808e4aee =3D fork_trampoline+0xe/frame 0xfffffe07e1886bf0 The cause is obvious. There must no sleeping in the GEOM I/O threads (up and down). But cdstrategy may violate this contract if it detects that a disk has been removed. In this case it calls cdcheckmedia() that closes the CD-ROM tray, locks it = and tastes the disk (if present). These are all blocking operations and can potentially take a long time since mechanical actions are involved. I am not sure how to fix this. A naive approach is to just fail the request when the CD-ROM is without med= ia (including when its tray is open). --=20 You are receiving this mail because: You are the assignee for the bug.=