Bug 15508

Summary: disk usage after "strip" is wrong
Product: Base System Reporter: Vivek Khera <khera>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: khera
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Vivek Khera 1999-12-15 22:40:00 UTC
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.

Fix: 

Don't know.  Seems like a file system bug to me.
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.
Comment 1 Vick Khera 1999-12-15 23:10:26 UTC
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!)
Comment 2 Steve Price freebsd_committer freebsd_triage 1999-12-17 20:50:36 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs

Misfiled PR. 
Comment 3 Mike Barcroft freebsd_committer freebsd_triage 2001-07-21 19:22:45 UTC
State Changed
From-To: open->feedback


Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE?
Comment 4 Mike Barcroft freebsd_committer freebsd_triage 2001-07-24 01:31:10 UTC
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 -----
Comment 5 Mike Barcroft freebsd_committer freebsd_triage 2001-07-24 01:31:11 UTC
State Changed
From-To: feedback->closed


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.