From root@hs-karlsruhe.de  Thu Sep  1 08:43:29 2005
Return-Path: <root@hs-karlsruhe.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 52D8D16A421
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 Sep 2005 08:43:29 +0000 (GMT)
	(envelope-from root@hs-karlsruhe.de)
Received: from rz06.hs-karlsruhe.de (rz06.HS-Karlsruhe.DE [193.196.64.6])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D180D43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 Sep 2005 08:43:28 +0000 (GMT)
	(envelope-from root@hs-karlsruhe.de)
Received: from rz-wenk1.hs-karlsruhe.de ([193.196.65.41])
	by rz06.hs-karlsruhe.de with esmtp (Exim 4.52)
	id 1EAkfO-00044U-Ht; Thu, 01 Sep 2005 10:43:26 +0200
Received: from root by RZ-Wenk1.HS-Karlsruhe.DE with local (Exim 4.52 (FreeBSD))
	id 1EAkfO-000AnK-Cg; Thu, 01 Sep 2005 10:43:26 +0200
Message-Id: <E1EAkfO-000AnK-Cg@RZ-Wenk1.HS-Karlsruhe.DE>
Date: Thu, 01 Sep 2005 10:43:26 +0200
From: Ralf Wenk <RZ-FreeBSD0605@hs-karlsruhe.de>
Reply-To: Ralf Wenk <RZ-FreeBSD0605@hs-karlsruhe.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Ralf Wenk <RZ-FreeBSD0605@hs-karlsruhe.de>
Subject: initdiskless should not generate memory disks with soft-updates enabled
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         85558
>Category:       conf
>Synopsis:       initdiskless should not generate memory disks with soft-updates enabled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    brooks
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 01 08:50:13 GMT 2005
>Closed-Date:    Tue Jan 24 05:56:09 GMT 2006
>Last-Modified:  Tue Jan 24 05:56:09 GMT 2006
>Originator:     Ralf Wenk
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
Hochschule Karlsruhe - Technik und Wirtschaft, University of Applied Sciences
>Environment:
System: FreeBSD RZ-Wenk1 5.4-STABLE FreeBSD 5.4-STABLE #2: Mon Aug 22 09:29:37 CEST 2005 wera0003@RZ-FreeBSD1:/usr/obj/usr/src/sys/fsc-t-diskless-SMP i386


>Description:
When booting diskless initdiskless creates memory disks with soft-updates
enabeld. The delayed freeing of blocks occupied by removed files causes
suprious 'file system full' messages in our diskless environment while
initdiskless is running and building the final /etc directory. These
messages occured more often with a SMP kernel (9 times out of 10) than
with a non SMP kernel (5 times out of 10). The resulting memory disk
containing /etc is 84% used.

This behaviour was never seen as long as we used 5.3. It was discovered
almost immediately after upgrading to STABLE. I think it shows up because
of the finer locking in STABLE.

>How-To-Repeat:
Use a diskless environment and a not too big memory disk. Replace varoius
files in it with the different templates initdiskless uses.

>Fix:
Add the -S switch to the mdmfs call in mount_md() in initdiskless to disable
the use of soft-updates in memory disks.

--- initdiskless.udiff begins here ---
--- etc.old/rc.d/initdiskless   Tue Apr  5 14:06:37 2005
+++ etc/rc.d/initdiskless       Mon Aug 22 09:04:47 2005
@@ -151,7 +151,7 @@
 # Create a generic memory disk
 #
 mount_md() {
-    /sbin/mdmfs -i 4096 -s $1 -M md $2
+    /sbin/mdmfs -S -i 4096 -s $1 -M md $2
 }

 # Create the memory filesystem if it has not already been created
--- initdiskless.udiff ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brooks 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Fri Nov 4 21:04:34 GMT 2005 
Responsible-Changed-Why:  
Assign this PR to brooks@ since he seems to be the active committer in this field. 
BTW, to me, the patch looks correct 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85558 
State-Changed-From-To: open->patched 
State-Changed-By: brooks 
State-Changed-When: Wed Jan 11 21:59:56 UTC 2006 
State-Changed-Why:  
Fixed in HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85558 
State-Changed-From-To: patched->closed 
State-Changed-By: brooks 
State-Changed-When: Tue Jan 24 05:55:25 UTC 2006 
State-Changed-Why:  
MFCd to RELENG_6 and RELENG_5.  Thanks for your submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85558 
>Unformatted:
