From wcolburn@nmt.edu  Tue Jul 29 14:11:11 2003
Return-Path: <wcolburn@nmt.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5F4CB37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 29 Jul 2003 14:11:11 -0700 (PDT)
Received: from mailhost.nmt.edu (mailhost.NMT.EDU [129.138.4.52])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 79E3D43F75
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 29 Jul 2003 14:11:10 -0700 (PDT)
	(envelope-from wcolburn@nmt.edu)
Received: from icewing.nmt.edu (icewing.tcct.nmt.edu [129.138.3.102])
	by mailhost.nmt.edu (8.12.10.Beta2/8.12.10.Beta2) with ESMTP id h6TLB8Q1020046
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 29 Jul 2003 15:11:08 -0600
Received: from icewing.nmt.edu (localhost.localdomain [127.0.0.1])
	by icewing.nmt.edu (8.12.8/8.12.8) with ESMTP id h6TLB8Sv003846;
	Tue, 29 Jul 2003 15:11:08 -0600
Received: (from wcolburn@localhost)
	by icewing.nmt.edu (8.12.8/8.12.8/Submit) id h6TLB84D003844;
	Tue, 29 Jul 2003 15:11:08 -0600
Message-Id: <200307292111.h6TLB84D003844@icewing.nmt.edu>
Date: Tue, 29 Jul 2003 15:11:08 -0600
From: "William D. Colburn (aka Schlake)" <wcolburn@nmt.edu>
Reply-To: <wcolburn@nmt.edu>
To: FreeBSD-gnats-submit@freebsd.org, wcolburn@nmt.edu
Cc:
Subject: machine crashed/rebooted from tar/find/rm fight
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55025
>Category:       kern
>Synopsis:       machine crashed/rebooted from tar/find/rm fight
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 29 14:20:09 PDT 2003
>Closed-Date:    Wed Jul 30 23:45:24 PDT 2003
>Last-Modified:  Wed Jul 30 23:45:24 PDT 2003
>Originator:     William D.Colburn
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
New Mexico Institute of Mining and Technology
>Environment:
eh?
System: FreeBSD userhost 4.7-STABLE FreeBSD 4.7-STABLE #0: Thu Jan 9 11:59:54 MST 2003 wcolburn@userhost:/usr/obj/usr/src/sys/USERHOST i386


>Description:

Ok, so my file system is pretty full:
  wcolburn@userhost<~>$ df .
  Filesystem  1K-blocks     Used   Avail Capacity  Mounted on
  /dev/da1s1e  81305544 65457788 9343313    88%    /tedium

But I've got this tar file:
  wcolburn@userhost<~>$ ll fermium.tar.gz 
  -rw-r--r--  1 wcolburn  5702  34471720960 Jul 22 14:00 fermium.tar.gz

It contains thousands of files I need, and many more that I don't need.
It would be annoyingly hard to name all the the ones I want on the
command line, but I have a better idea!

  tar zxf fermium.tar.gz & while true ; do find fermium -type f ! -size 0 ! -perm 0 -exec rm '{}' \; ; done

A few minutes later, from an NFS mounted linux box, I do an ls to make
sure the find is progressing right.  I notice that there is a directory
that contains filenames, but not inodes for any of the files.

Uh oh, this is bad.  Kill the while loop, kill the tar, rm -rf the whole
tree.  Whew.  Disaster averted.

A few minutes later, while I'm formulating a new plan of attack the
machine drops off the face of the world.  Since every computer and its
mother depends on this machine for user accounts, I hide.  Eventually,
the fsck is complete (hurray!) and it comes up.  There is useful info in
dmesg, and a handy bug submittal form!

panic: dqget: free dquot isn't
mp_lock = 01000001; cpuid = 1; lapic.id = 01000000
boot() called on cpu#1

syncing disks... 175 35 5 5 5 5 5 5 5 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
gi07]: ./fs/tedium/accounts/u/usul unmounted fstype link from
./fs/tedium/accounts/u/usul
cpu_reset_proxy: Grabbed mp lock for BSP
cpu_reset_proxy: Stopped CPU 1

>How-To-Repeat:

I'm not positive this will work, but I'm also not willing to try again
to see if it crashes again.  I was using a 34 gig tar file.

  tar zxf fermium.tar.gz & while true ; do find fermium -type f ! -size 0 ! -perm 0 -exec rm '{}' \; ; done

>Fix:

My fix is not to run the command listed above in the "How-To-Repeat"
section.  I will untar my 34 gig tar file on a larger disk, and then run
the find after it has finished.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: das 
State-Changed-When: Wed Jul 30 23:43:38 PDT 2003 
State-Changed-Why:  
Fixed in FreeBSD 4.8. 
(This is due to a reference count overflow.  To fix the problem, it is 
sufficient to upgrade your copy of sys/ufs/ufs/quota.h and recompile.) 

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