Bug 156039 - [nullfs] [unionfs] nullfs + unionfs do not compose, result in unlocking unlocked lock
Summary: [nullfs] [unionfs] nullfs + unionfs do not compose, result in unlocking unloc...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 14:30 UTC by John Giacomoni
Modified: 2023-05-12 03:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Giacomoni 2011-03-29 14:30:11 UTC
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"
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-04-09 20:50:48 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:13 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped