From nobody@FreeBSD.org  Sat Apr 21 07:10:03 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id ECC07106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Apr 2012 07:10:03 +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 D23708FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Apr 2012 07:10:03 +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 q3L7A3ZB031659
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Apr 2012 07:10:03 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3L7A3Au031658;
	Sat, 21 Apr 2012 07:10:03 GMT
	(envelope-from nobody)
Message-Id: <201204210710.q3L7A3Au031658@red.freebsd.org>
Date: Sat, 21 Apr 2012 07:10:03 GMT
From: Taras Marusin <mtv.lviv@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: looping process mksnap_ffs when run in a chroot environment named. CPU 100%
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167156
>Category:       bin
>Synopsis:       looping process mksnap_ffs when run in a chroot environment named. CPU 100%
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mckusick
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 21 07:10:10 UTC 2012
>Closed-Date:    Sun Oct 14 03:45:52 UTC 2012
>Last-Modified:  Sun Oct 14 03:45:52 UTC 2012
>Originator:     Taras Marusin
>Release:        FreeBSD 9.0-RELEASE
>Organization:
"PEOPLEnet"
>Environment:
FreeBSD localhost 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
The system is installed with the DVD image. Named is running and working in chroot environment. Full path to chroot environment /var/named.
ps shows:

localhost# ps axw | grep named
  760  ??  Ss   0:00.08 /usr/sbin/syslogd -l /var/run/log -l /var/named/var/run/log -s
  854  ??  Is   0:00.15 /usr/sbin/named -t /var/named -u bind

If you run the command "mksnap_ffs /var /var/.snap/snap_var" system freezes and bring her out of this state can only power down or reset button.
Same thing happens when dump var partition.

In the top we see the following:

last pid:  1236;  load averages:  1.75,  0.71,  0.32    up 0+00:13:58
22:32:34
29 processes:  3 running, 26 sleeping
CPU:  0.0% user,  0.0% nice, 90.1% system,  9.9% interrupt,  0.0% idle
Mem: 19M Active, 12M Inact, 21M Wired, 204K Cache, 19M Buf, 434M Free
Swap: 1024M Total, 1024M Free

  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
 1236 root        1 101    0  9532K  1016K RUN      1:51 100.00% mksnap_ffs
 1199 root        1  20    0  9944K  1884K RUN      0:02  0.00% top
 1113 root        1  20    0  9720K  1148K RUN      0:02  0.00% moused
 1206 mtv         1  21    0 12800K  4048K select   0:01  0.00% ssh
 1085 root        1  20    0 11324K  3404K select   0:00  0.00% sendmail
 1189 root        1  20    0 in the top we see the following. 9956K  2804K pause    0:00  0.00% csh
  854 bind        4  52    0 27840K 11020K kqread   0:00  0.00% named
  760 root        1  20    0  9612K  1392K select   0:00  0.00% syslogd
 1200 mtv         1  20    0  9924K  1748K wait     0:00  0.00% sh
 1173 root        1  20    0 10124K  1952K wait     0:00  0.00% login
....

>How-To-Repeat:
On a freshly installed system, run named.

localhost# /etc/rc.d/named onestart
wrote key file "/var/named/etc/namedb/rndc.key"
Starting named.
localhost# ps ax | grep named
 1240  ??  Ss    0:00.16 /usr/sbin/named -t /var/named -u bind

check the performance of mksnap_ffs

localhost# mksnap_ffs /var /var/.snap/snap_var
localhost# ls -al /var/.snap/
total 1704
drwxrwxr-x   2 root  operator         512 Apr 20 22:13 .
drwxr-xr-x  24 root  wheel           1024 Apr 21 01:00 ..
-r--r-----   1 root  operator  5368709216 Apr 20 22:13 snap_var

Now write a startup named in rc.conf

localhost# echo 'named_enable="YES"' >> /etc/rc.conf
localhost# cat /etc/rc.conf
hostname="localhost"
ifconfig_em0="DHCP"
sshd_enable="YES"
moused_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
named_enable="YES"

reboot the server.
look after the overload:

localhost# ps axw | grep named
  760  ??  Ss   0:00.08 /usr/sbin/syslogd -l /var/run/log -l /var/named/var/run/log -s
  854  ??  Is   0:00.15 /usr/sbin/named -t /var/named -u bind

run mksnap_ffs

localhost# mksnap_ffs /var /var/.snap/snap_var

mksnap_ffs program can not be completed and system freezes.








>Fix:
If removed from the syslog "-l /var/named/var/run/log" everything works without problems. But this is not correct.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mckusick 
Responsible-Changed-By: mckusick 
Responsible-Changed-When: Sun Oct 14 03:44:56 UTC 2012 
Responsible-Changed-Why:  
I will take responsibility for this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167156 
State-Changed-From-To: open->closed 
State-Changed-By: mckusick 
State-Changed-When: Sun Oct 14 03:45:29 UTC 2012 
State-Changed-Why:  
There is a known interaction between journaled soft-updates and 
snapshots. Until we are able to come up with a comprehensive 
solution, we have disabled the taking of snapshots on filesystems 
running with journaled soft-updates: 

r230250 | mckusick | 2012-01-16 17:14:56 -0800 (Mon, 16 Jan 2012) | 7 lines 

There are several bugs/hangs when trying to take a snapshot on a UFS/FFS 
filesystem running with journaled soft updates. Until these problems 
have been tracked down, return ENOTSUPP when an attempt is made to 
take a snapshot on a filesystem running with journaled soft updates. 

MFC after: 2 weeks 

MFC to 9-stable occurred as: 

r230725 | mckusick | 2012-01-29 00:03:45 -0800 (Sun, 29 Jan 2012) | 13 lines 

So, kernels running 9-stable after January 29, 2012 will have this 
change. And once 9.1 is released, it will have this change. 

Jeff Roberson and I are slowing working through the issues involved. 
When we have fully fixed the problem, we will re-enable the taking 
of snapshots on filesystems running with journaled soft-updates. 

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