From owner-freebsd-bugs@freebsd.org Sun Jan 17 14:11:42 2016 Return-Path: Delivered-To: freebsd-bugs@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 17D85A863F6 for ; Sun, 17 Jan 2016 14:11:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id F0A101D92 for ; Sun, 17 Jan 2016 14:11:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u0HEBfB9038889 for ; Sun, 17 Jan 2016 14:11:41 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 206328] Crash on shutdown with swap on NFS file Date: Sun, 17 Jan 2016 14:11:42 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: tvijlbrief@gmail.com 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: Message-ID: In-Reply-To: References: 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.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 14:11:42 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206328 --- Comment #2 from Tom Vijlbrief --- It is not clear to me why swapoff_all is called at the end of bufshutdown(), probably for a sanity check. I created two potential quick fixes which work for me, don't fire the specific KASSERT when rebooting: *** sys/kern/vfs_bio.c.orig 2016-01-17 14:10:04.000000000 +0100 --- sys/kern/vfs_bio.c 2015-12-22 06:54:16.000000000 +0100 *************** *** 4542,4548 **** KASSERT(vp->v_type !=3D VCHR && vp->v_type !=3D VBLK, ("Wrong vnode in bufstrategy(bp=3D%p, vp=3D%p)", bp, vp)); i =3D VOP_STRATEGY(vp, bp); ! KASSERT(i =3D=3D 0 && !rebooting, ("VOP_STRATEGY failed bp=3D%p vp= =3D%p", bp, bp->b_vp)); } void --- 4542,4548 ---- KASSERT(vp->v_type !=3D VCHR && vp->v_type !=3D VBLK, ("Wrong vnode in bufstrategy(bp=3D%p, vp=3D%p)", bp, vp)); i =3D VOP_STRATEGY(vp, bp); ! KASSERT(i =3D=3D 0, ("VOP_STRATEGY failed bp=3D%p vp=3D%p", bp, bp-= >b_vp)); } void -----8<---------------------- or don't swapoff for special files in swapoff_all() which is only called at= the end of a reboot. *** sys/vm/swap_pager.c.orig 2016-01-17 14:24:40.000000000 +0100 --- sys/vm/swap_pager.c 2016-01-17 14:59:03.000000000 +0100 *************** *** 2284,2294 **** mtx_lock(&sw_dev_mtx); TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); ! if (vn_isdisk(sp->sw_vp, NULL)) devname =3D devtoname(sp->sw_vp->v_rdev); ! else devname =3D "[file]"; ! error =3D swapoff_one(sp, thread0.td_ucred); if (error !=3D 0) { printf("Cannot remove swap device %s (error=3D%d), " "skipping.\n", devname, error); --- 2284,2298 ---- mtx_lock(&sw_dev_mtx); TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); ! if (vn_isdisk(sp->sw_vp, NULL)) { devname =3D devtoname(sp->sw_vp->v_rdev); ! error =3D swapoff_one(sp, thread0.td_ucred); ! } else { devname =3D "[file]"; ! error =3D 0; ! printf("Skip swapoff for (NFS) swap file.\n"); ! } !=20 if (error !=3D 0) { printf("Cannot remove swap device %s (error=3D%d), " "skipping.\n", devname, error); --=20 You are receiving this mail because: You are the assignee for the bug.=