Bug 140744 - upgrade fails with false diskspace problem
Summary: upgrade fails with false diskspace problem
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution   
(Show other bugs)
Version: 3
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Matthew Barnes
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-11-24 16:36 UTC by Andrew Gilmore
Modified: 2008-08-02 23:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-10-31 16:10:55 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to calculate diskspace from blocksize, rather than fragment size (519 bytes, patch)
2004-11-24 22:15 UTC, Dave Malcolm
no flags Details | Diff
2nd attempt at using block size, rather than fragment size (563 bytes, patch)
2004-11-24 22:19 UTC, Dave Malcolm
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Bugzilla 269895 None None None Never

Description Andrew Gilmore 2004-11-24 16:36:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)

Description of problem:
When I run evolution for the first time after upgrading to FC3 from FC2,
I get an error:

"Insufficient disk space for upgrade.
Upgrading your data and settings will require upto 1583362 KB of disk
space, but you only have 710361 KB available.

You will need to make more space available in your home directory
before you can continue."

My home directory is NFS mounted from a Solaris 9 box. 
df -k ~:
Filesystem           1K-blocks      Used Available Use% Mounted on
athena:/wrg           43376616  31577080  11365776  74% /wrg

Which, as I read it, is 11GB, much more than is necessary.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.start evolution
2.observe error

Actual Results:  saw error message as above

Expected Results:  migration occurs

Additional info:

Comment 1 Dave Malcolm 2004-11-24 20:38:04 UTC
What are the fragment size and the block size on the NFS filesystem?

Comment 2 Andrew Gilmore 2004-11-24 21:07:39 UTC
rsize, wsize set to 8192

Not sure what you mean by fragment size. Connection is ethernet, MTU
is set at 1500.

Comment 3 Dave Malcolm 2004-11-24 21:21:20 UTC
It appears to be using this code to determine free space (which I
believe will be wrong if the fragment size != block size)

	struct statvfs stfs;

	if (statvfs(path, &stfs) == -1)
		return -1;

	/* Assumes that frsize === power of 2 */
	if (stfs.f_frsize >= 1024)
		return stfs.f_bavail * (stfs.f_frsize / 1024);
		return stfs.f_bavail / (1024 / stfs.f_frsize);

Comment 4 Dave Malcolm 2004-11-24 22:04:54 UTC
Evolution's disk space calculation seems to be wrong by a factor of 16
i.e. it believes you have exactly 1/16th of the space you actually
have (as reported by df).

Does the NFS mount use version 2 or version 3 of the protocol?

(If you cat /proc/mounts, you will see the options for the filesystem,
expect to see a "v2" or "v3" in the options).

Does the problem go away if you try remounting the NFS filesystem
using the other version of the protocol?

Comment 5 Dave Malcolm 2004-11-24 22:15:30 UTC
Created attachment 107429 [details]
Patch to calculate diskspace from blocksize, rather than fragment size

Comment 6 Dave Malcolm 2004-11-24 22:19:24 UTC
Created attachment 107430 [details]
2nd attempt at using block size, rather than fragment size

Comment 7 Dave Malcolm 2004-11-24 22:23:50 UTC
As further test, can you run strace df, and look through the output
for calls to statfs (or statfs64), and paste the results here

Comment 8 Andrew Gilmore 2004-11-24 22:35:35 UTC
Tried removing the wsize,rsize options in the fstab, and mount.
size reported was even less, and mount(1) showed a wsize, rsize of 32K.

Tried with a wsize, rsize of 4K, and was able to upgrade settings
without error.

This shows pretty conclusively what happened. What exactly do you need
me to do? I'm AFK until Dec 3.

Comment 9 Andrew Gilmore 2004-11-24 22:43:01 UTC
statfs64("/wrg", 84, {f_type="NFS_SUPER_MAGIC", f_bsize=4096,
f_blocks=10844153, f_bfree=3049606, f_bavail=2941165, f_files=5209856,
f_ffree=5022281, f_fsid={0, 0}, f_namelen=255, f_frsize=512}) = 0

Comment 10 Dave Malcolm 2004-11-24 22:58:27 UTC
OK - so the fragment size is 512 bytes, but the block size is 4096, a
factor of 8

The existing Evolution code would calc:
f_bavail * f_frsize = 1505876480 bytes (1470582.5 KB, or 1.4GB)

but df should calc:
f_bavail * f_bsize = 12047011840 bytes (11764660 KB, or 11.2GB)

Looks like we haven't accounted for an extra factor of 2, for some
reason (assuming my calculations are correct...)

Comment 11 Dave Malcolm 2004-11-24 23:00:27 UTC
I've opened an upstream bug for this here:

Comment 12 Andrew Gilmore 2004-11-24 23:06:00 UTC
This is after a change to rsize,wsize to get this to work.

Note that the problem occurred when wsize and rsize were set to 8K,
which takes care of the extra factor of two you are seeing. :)

with block size at 4K, I was able to complete the upgrade!

Comment 13 Dave Malcolm 2004-11-24 23:16:45 UTC
Aha - excellent!  Thanks for the feedback.

Comment 14 Burkhard 2005-01-23 06:26:17 UTC
Had the same problem. Workaround was using nfsvers=2 (block size 4k).
Filed bug #141766 to libgnome, because this seems to be not only an
evolution problem. Gnome system monitor shows the same behaviour.

Comment 15 Burkhard 2005-01-23 07:13:12 UTC
Nautilus is affected, too.

Comment 17 Matthew Miller 2006-07-10 22:18:04 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!

Comment 18 John Thacker 2006-10-31 16:10:55 UTC
Upstream bug suggests that this got fixed by FC4.  Closing.

Note You need to log in before you can comment on or make changes to this bug.