On Tue, Jan 10, 2006 at 01:41:29AM -0600, Sam Lang wrote:
> >(using strace, the system call that Python's os.statvfs actually makes
> >is:
> >
> >    statfs64("/RAIDS/RAID_2", 84, {f_type=0x20030528, f_bsize=4194304,
> >    f_blocks=1001258, f_bfree=705068, f_bavail=705068,  
> >f_files=4294967292,
> >    f_ffree=4294967277, f_fsid={2016975803, 0}, f_namelen=255,
> >    f_frsize=1024}) = 0
> >)
> >
> >705,068 1KB blocks would give me the 688MB free.
> >
> 
> But that's using f_frsize as the block size, which is actually the  
> fragment size.  If you use f_bsize as the block size, the f_bavail  
> looks correct.  For the 2.4 kernel, we just set f_frsize to 1024,  
> which is why you're seeing those results.  It looks like the 2.6  
> kernel doesn't have the f_frsize field in the statfs struct, so  
> you'll probably have more luck if you're able to update to the 2.6  

I should have said, but this result is from a system running a 2.6
kernel and kernel module.  2.6.14 to be exact.

Looking at src/kernel/linux-2.6/super.c:370 it looks like the f_frsize
is set to 1024 by default in the 2.6 kernel too.

Applying the attached patch sets f_frsize to f_bsize and fixes my
problems in Nautilus.  However, is this a kosher thing to do?  I don't
know much about kernel data structures.  Turning this question around,
is there a specific reason why f_frsize is set to 1024?

> kernel.  I'm curious why Nautilus and other tools use don't use the  
> f_bsize field (seems like a bug)...if you're able to strace the  
> Nautilus process that might be enlightening.

I've attached a bzip2 of an strace of nautilus cut down to the 2
second snippet where I'm accessing the PVFS2 mountpoint
(/RAIDS/RAID_2).  This is using the kernel module without the patch
from above.  The expanded file is about 310K.  However, it looks like
it makes the same statfs64 call with the same return values.
   --Justin
--- pvfs2-1.3.2.pristine/src/kernel/linux-2.6/super.c   2005-12-02 
10:55:50.000000000 -0500
+++ pvfs2-1.3.2/src/kernel/linux-2.6/super.c    2006-01-10 08:37:46.000000000 
-0500
@@ -367,7 +367,7 @@
         {
             struct statfs tmp_statfs;
 
-            buf->f_frsize = 1024;
+            buf->f_frsize = buf->f_bsize;
 
             pvfs2_print("sizeof(kstatfs)=%d\n",
                         (int)sizeof(struct kstatfs));

Attachment: nautilus-trace-times-cut.bz2
Description: Binary data

_______________________________________________
PVFS2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to