From owner-freebsd-bugs@FreeBSD.ORG Tue Mar 29 13:30:12 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F8E31065670 for ; Tue, 29 Mar 2011 13:30:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9E18FC14 for ; Tue, 29 Mar 2011 13:30:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2TDUChM099582 for ; Tue, 29 Mar 2011 13:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2TDUCFp099580; Tue, 29 Mar 2011 13:30:12 GMT (envelope-from gnats) Resent-Date: Tue, 29 Mar 2011 13:30:12 GMT Resent-Message-Id: <201103291330.p2TDUCFp099580@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Giacomoni Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAD60106564A for ; Tue, 29 Mar 2011 13:26:52 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D9EEF8FC08 for ; Tue, 29 Mar 2011 13:26:52 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p2TDQqdk090369 for ; Tue, 29 Mar 2011 13:26:52 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p2TDQqCr090349; Tue, 29 Mar 2011 13:26:52 GMT (envelope-from nobody) Message-Id: <201103291326.p2TDQqCr090349@red.freebsd.org> Date: Tue, 29 Mar 2011 13:26:52 GMT From: John Giacomoni To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/156039: nullfs + unionfs do not compose, result in unlocking unlocked lock X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2011 13:30:12 -0000 >Number: 156039 >Category: kern >Synopsis: nullfs + unionfs do not compose, result in unlocking unlocked lock >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 29 13:30:11 UTC 2011 >Closed-Date: >Last-Modified: >Originator: John Giacomoni >Release: FreeBSD 7.3 and 7.4 >Organization: LineRate Systems >Environment: FreeBSD 7.4-RELEASE FreeBSD 7.4-RELEASE #0: Fri Feb 18 01:55:22 UTC 2011 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: using unionfs to mount a nullfs mounted directory on top of a 3rd directory causes a panic inside vfs. I am trying to build an appliance with the ability to easily load different versions at boot time based on read-only boot images. briefly what I have is a partion with 4 directories /boot /images /persist /running 1. Mount read-only file backed memory disk image, /images/ver1.img, onto /running 2. mount_nullfs /persist /running/persist 3. mount_unionfs /running/persist/usr /running/usr the problem manifests at boot (during init) as a unlocking unheld lock and it seems to be while the system is launching getty (parallel access race?). This problem manifests identically whether the mounting is done by an init_script (loader.conf) or an rc.d script. >How-To-Repeat: I created a simplified rc.d to demonstrate the problem. echo over_enable="YES" >> /etc/rc,conf mkdir -p /over mkdir -p /null then add the following script as /etc/rc.d/over #!/bin/sh # PROVIDE: over # BEFORE: dumpon . /etc/rc.subr name="over" start_cmd="over_start" stop_cmd=":" over_start() { # # Make sure /over and /null exist on root fs # echo load_kld nullfs.ko load_kld nullfs.ko echo mount_nullfs /null /over mount_nullfs /null /over echo load_kld unionfs.ko load_kld unionfs.ko echo mount_unionfs -ocopymode=transparent /over /usr mount_unionfs -ocopymode=transparent /over /usr } load_rc_config $name run_rc_command "$1" >Fix: >Release-Note: >Audit-Trail: >Unformatted: