#40893 [NEW]: PHP reports wrong total and free space for NFS-mounted filesystems on RedHat

From: Date: Thu, 22 Mar 2007 14:59:05 +0000
Subject: #40893 [NEW]: PHP reports wrong total and free space for NFS-mounted filesystems on RedHat
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110684@lists.php.net to get a copy of this message
From: andrew at digicol dot de Operating system: Redhat EL4 PHP version: 4.4.5 PHP Bug Type: Filesystem function related Bug description: PHP reports wrong total and free space for NFS-mounted filesystems on RedHat Description: ------------ disk_total_space, disk_free_space reports wrong total and free space for NFS-mounted filesystems on RedHat Linux. This bug seems to be the related to #39520, if not the same. #39520 has been rated as 'bogus' which I think is a mistake. Please re-consider. The bug shows on RedHat Linux, but not SuSE Linux. This might ultimately be considered as a RedHat bug or of the libraries used there, but other commands (df) that use the statfs system call show the correct file system size / free space. It may be argued (like in #39520) that the wrong block size parameter is used to calculate total or free disk space. strace df -h shows RedHat and SuSE report different f_frsize, but same f_bsize on the same NFS share, but df reports the correct size on both. Reproduce code: --------------- Test: Mount a NFS share on a RedHat system and on a SuSE Linux system. 1) RedHat 2.6.9-34.EL, 32-bit [root@dc5ora10gr2 /]# mount -t nfs 10.20.0.178:/dot/oracle_dump /mnt [root@dc5ora10gr2 /]# df -h Filesystem Size Used Avail Use% Mounted on ... 10.20.0.178:/dot/oracle_dump 280G 125G 156G 45% /mnt [root@dc5ora10gr2 /]# /dot/dc/bin/php/bin/php -r 'echo_number_format(disk_total_space("/mnt")) . "\n";' 37,512,204,288 ==> Wrong size, seems to be real size / 8 2) SuSE Linux 9.3 32-bit suse:/ # mount -t nfs 10.20.0.178:/dot/oracle_dump /mnt suse:/ # df -h Filesystem Size Used Avail Use% Mounted on ... 10.20.0.178:/dot/oracle_dump 280G 125G 156G 45% /mnt suse:/ # php -r 'echo number_format(disk_total_space("/mnt")) . "\n";' 300,097,634,304 ==> Correct. Expected result: ---------------- I would expect the result to be 300G on both systems. Actual result: -------------- Reports 300G on SuSE Linux, around 35G only on RedHat. -- Edit bug report at http://bugs.php.net/?id=40893&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40893&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40893&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40893&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40893&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40893&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40893&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40893&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40893&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40893&r=support Expected behavior: http://bugs.php.net/fix.php?id=40893&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40893&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40893&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40893&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40893&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40893&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40893&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40893&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40893&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40893&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40893&r=mysqlcfg

« previous php.bugs (#110684) next »