Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Miklos Szeredi <miklos-sUDqSbJrdHQHWmgEVkV9KA <at> public.gmane.org>
Subject: Re: statfs bug
Newsgroups: gmane.comp.file-systems.fuse.devel
Date: Friday 24th November 2006 09:27:09 UTC (over 10 years ago)
> I think I found a bug in the statfs operation.
> 
> I'm using the lowlevel API (tested with fuse-2.5.3 and fuse-2.6.0), and
my 
> filesystem is filling these values in the statvfs structure:
> 
> f_frsize: 512
> f_bsize: 131072
> f_blocks: 129946
> 
> I know it's unusual to give different values for f_frsize and f_bsize,
but ZFS 
> uses variable block sizes and those are the values used in OpenSolaris.
> 
> According to the statvfs(2) manpage, f_blocks is the "size of fs in
f_frsize 
> units".
> 
> So, the size of my filesystem is 129946 * 512 bytes, which is around 63
MB.
> 
> But df is reporting these values:
> Filesystem           1K-blocks      Used Available Use% Mounted on
> pool                  16633088      6272  16626816   1% /pool
> 
> Notice how the filesystem size is around 16GB..
> 
> Also notice how the reported filesystem size is exactly the same as
f_blocks * 
> f_bsize instead of f_frsize, so it seems the fields are not being
correctly 
> used somewhere.

The stat*fs interfaces are a bit of a mess.  I think the problem here
is that 'df' is using statfs() instead of statvfs(), and statfs
doesn't have f_frsize only f_bsize.  'df' uses f_bsize for the purpose
of f_frsize, which gets you this strange behavior.

The proper solution would probably be to fix 'df', but in the mean
time you probably should just set f_bsize to the same value as
f_frsize.

Miklos

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
 
CD: 2ms