Bug 91725

Summary: bad handling of DF by KDiskFreeSp
Product: [Applications] kdf Reporter: Shie Erlich <erlich>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Shie Erlich 2004-10-20 01:01:50 UTC
Version:            (using KDE KDE 3.3.0)
Installed from:    RedHat RPMs
Compiler:          gcc 3.4.2 
OS:                Linux

when calling KDiskFreeSp::findUsageInfo(), i supply the path which i want to test. then KDiskFreeSp::readDF() runs DF -k and parses the resulting data. The point is that it runs 'df -k' instead of running 'df -k path'. this causes 2 things:
1) calling this function for multiple mount points is very inefficient
2) if you have an NFS share mounted, and the connection is bad, or the remote computer is not connected anymore, DF takes a LONG LONG LONG time to finish. when that happens, i don't get the stat info i requested even if i didn't want to know anything about that remote share. 

fix: in KDiskFreeSp::readDF(), change
------- this ---------
(*dfProc) << QString::fromLocal8Bit(DF_COMMAND) << QString::fromLocal8Bit(DF_ARGS);
------- to this ------
(*dfProc) << QString::fromLocal8Bit(DF_COMMAND) << QString::fromLocal8Bit(DF_ARGS) << mountPoint;


thanks!
Comment 1 Christoph Feck 2013-01-19 23:00:35 UTC
Code now uses statvfs().