From khera@kciLink.com  Wed Dec 15 14:32:03 1999
Return-Path: <khera@kciLink.com>
Received: from kci.kciLink.com (kci.kciLink.com [204.117.82.1])
	by hub.freebsd.org (Postfix) with ESMTP id 87CDF1560F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Dec 1999 14:32:02 -0800 (PST)
	(envelope-from khera@kciLink.com)
Received: from onceler.kcilink.com (onceler.kciLink.com [204.117.82.2])
	by kci.kciLink.com (Postfix) with ESMTP
	id 3B85DE8B5; Wed, 15 Dec 1999 17:31:54 -0500 (EST)
Received: (from khera@localhost)
	by onceler.kcilink.com (8.9.3/8.9.3) id RAA15304;
	Wed, 15 Dec 1999 17:31:54 -0500 (EST)
	(envelope-from khera@kci.kcilink.com)
Message-Id: <199912152231.RAA15304@onceler.kcilink.com>
Date: Wed, 15 Dec 1999 17:31:54 -0500 (EST)
From: khera@kcilink.com
Reply-To: khera@kcilink.com
To: FreeBSD-gnats-submit@freebsd.org
Cc: khera@kcilink.com
Subject: disk block count inconsistent with expectations after "strip"
X-Send-Pr-Version: 3.2

>Number:         15508
>Category:       kern
>Synopsis:       disk usage after "strip" is wrong
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 15 14:40:00 PST 1999
>Closed-Date:    Mon Jul 23 17:31:11 PDT 2001
>Last-Modified:  Mon Jul 23 17:35:05 PDT 2001
>Originator:     Vivek Khera
>Release:        FreeBSD 3.4-RC i386
>Organization:
>Environment:

	
Disks are running with soft-updates enabled.


>Description:

after installing wine from the ports collection, I ran strip on the
wine and regapi programs.  This resulted in *more* disk blocks being
allocated on the disk rather than fewer.

>How-To-Repeat:

Script started on Wed Dec 15 17:21:18 1999
[root@onceler]# ls -ls wine regapi
30392 -r-xr-xr-x  1 root  wheel  31091990 Dec 15 17:19 regapi*
30952 -r-xr-xr-x  1 root  wheel  31666110 Dec 15 17:18 wine*
[root@onceler]# df .
Filesystem   1K-blocks     Used    Avail Capacity  Mounted on
/dev/wd0s1f    1016303   930650     4349   100%    /usr
[root@onceler]# strip regapi
[root@onceler]# ls -ls wine regapi
 3568 -r-xr-xr-x  1 root  wheel   3638528 Dec 15 17:21 regapi*
30952 -r-xr-xr-x  1 root  wheel  31666110 Dec 15 17:18 wine*
[root@onceler]# df .
Filesystem   1K-blocks     Used    Avail Capacity  Mounted on
/dev/wd0s1f    1016303   934218      781   100%    /usr
[root@onceler]# strip wine
[root@onceler]# ls -ls wine regapi
3568 -r-xr-xr-x  1 root  wheel  3638528 Dec 15 17:21 regapi*
3672 -r-xr-xr-x  1 root  wheel  3746848 Dec 15 17:21 wine*
[root@onceler]# df .
Filesystem   1K-blocks     Used    Avail Capacity  Mounted on
/dev/wd0s1f    1016303   937890    -2891   100%    /usr
[root@onceler]# rm wine 
[root@onceler]# df .
Filesystem   1K-blocks     Used    Avail Capacity  Mounted on
/dev/wd0s1f    1016303   876549    58450    94%    /usr
[root@onceler]# rm regapi
[root@onceler]# df .
Filesystem   1K-blocks     Used    Avail Capacity  Mounted on
/dev/wd0s1f    1016303   872877    62122    93%    /usr
[root@onceler]# uname -a
FreeBSD onceler.kcilink.com 3.4-RC FreeBSD 3.4-RC #1: Mon Dec 13 11:07:34 EST 1999     khera@daddypop.kcilink.com:/u/onceler1/usr/src/sys/compile/ONCELER  i386
[root@onceler]# exit

Script done on Wed Dec 15 17:22:03 1999


As you can see, the number of blocks used as reported by ls is
consistent with the file sizes, however df reports way more blocks
allocated.  Deleting the file releases all the disk blocks.

>Fix:
	
Don't know.  Seems like a file system bug to me.



>Release-Note:
>Audit-Trail:

From: Vivek Khera <vivek@khera.org>
To: freebsd-gnats-submit@freebsd.org, khera@kcilink.com
Cc:  
Subject: Re: pending/15508: disk usage after "strip" is wrong
Date: Wed, 15 Dec 1999 18:10:26 -0500

 This does indeed seem to be soft-update related.  The same sequence of
 actions performed with soft-updates disabled works as expected with ls
 and df reporting proper number of blocks.
 
 Conveniently, fsck will clean up the "lost" blocks on the soft-update
 enabled file systems, so all is not lost (and I don't need to
 dump/restore them!)
 
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: steve 
Responsible-Changed-When: Fri Dec 17 12:50:36 PST 1999 
Responsible-Changed-Why:  
Misfiled PR. 
State-Changed-From-To: open->feedback 
State-Changed-By: mike 
State-Changed-When: Sat Jul 21 11:22:45 PDT 2001 
State-Changed-Why:  

Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15508 

From: Mike Barcroft <mike@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/15508: disk usage after "strip" is wrong
Date: Mon, 23 Jul 2001 20:31:10 -0400

 Adding to Audit-Trail.
 
 ----- Forwarded message from Vivek Khera <khera@kciLink.com> -----
 
 X-UIDL: 88d495a52bb9681eae082a78b8e7806c
 Delivered-To: mike@freebsd.org
 From: Vivek Khera <khera@kciLink.com>
 Date: Mon, 23 Jul 2001 15:21:37 -0400
 To: <mike@FreeBSD.org>
 Cc: freebsd-bugs@FreeBSD.org
 Subject: Re: kern/15508: disk usage after "strip" is wrong
 In-Reply-To: <200107211823.f6LIN1320253@freefall.freebsd.org>
 X-Mailer: VM 6.92 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid
 
 >>>>> "m" == mike  <mike@FreeBSD.org> writes:
 
 m> Synopsis: disk usage after "strip" is wrong
 m> State-Changed-From-To: open->feedback
 m> State-Changed-By: mike
 m> State-Changed-When: Sat Jul 21 11:22:45 PDT 2001
 m> State-Changed-Why: 
 
 m> Does this problem still occur in newer versions of FreeBSD,
 m> such as 4.3-RELEASE?
 
 No.  The multiple df's below are to allow softupdates plenty of time
 to do their thing, but it doesn't seem to be changing, and the disk is
 idle... it takes a really long time for that to happen.
 
 I think that might have been the issue before.  I just didn't wait
 long enough, and I expected sync to flush out the softupdate changes
 like it used to on BSD/OS.
 
 
 [root@onceler]# ls -l wine
 -rwxr-xr-x  1 root  wheel  182152 Jul 23 15:16 wine*
 [root@onceler]# df .
 Filesystem   512-blocks     Used    Avail Capacity  Mounted on
 /dev/ad0s1g    20802940  7929970 11208736    41%    /u/onceler1
 [root@onceler]# strip wine
 [root@onceler]# df .
 Filesystem   512-blocks     Used    Avail Capacity  Mounted on
 /dev/ad0s1g    20802940  7930000 11208706    41%    /u/onceler1
 [root@onceler]# df .
 Filesystem   512-blocks     Used    Avail Capacity  Mounted on
 /dev/ad0s1g    20802940  7930000 11208706    41%    /u/onceler1
 [root@onceler]# sync
 [root@onceler]# df .
 Filesystem   512-blocks     Used    Avail Capacity  Mounted on
 /dev/ad0s1g    20802940  7930000 11208706    41%    /u/onceler1
 [root@onceler]# df .
 Filesystem   512-blocks     Used    Avail Capacity  Mounted on
 /dev/ad0s1g    20802940  7930000 11208706    41%    /u/onceler1
 [root@onceler]# ls -l wine
 -rwxr-xr-x  1 root  wheel  15152 Jul 23 15:18 wine*
 [root@onceler]# df .
 Filesystem   512-blocks     Used    Avail Capacity  Mounted on
 /dev/ad0s1g    20802940  7930000 11208706    41%    /u/onceler1
 [root@onceler]# uname -a
 FreeBSD onceler.kciLink.com 4.3-STABLE FreeBSD 4.3-STABLE #13: Thu Jul  5 16:49:55 EDT 2001     khera@onceler.kciLink.com:/u/onceler1/usr/src/sys/compile/ONCELER  i386
 [root@onceler]# df .
 Filesystem   512-blocks     Used    Avail Capacity  Mounted on
 /dev/ad0s1g    20802940  7929616 11209090    41%    /u/onceler1
 
 ----- End forwarded message -----
State-Changed-From-To: feedback->closed 
State-Changed-By: mike 
State-Changed-When: Mon Jul 23 17:31:11 PDT 2001 
State-Changed-Why:  

The originator believes, and I tend to agree, that this is just 
normal soft-updates behaviour and it could take a while for disk 
changes to show up in df. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15508 
>Unformatted:
