[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Weird behavior of df with "BLOCK_SIZE="



(Please Cc: me on answers, as I am not subscribed to debian-adm64. Thanks.)

Hi.

I am currently struck by a _very_ weird bug of df on Sarge-AMD64 with
coreutils-5.2.1-2.

Note the randomly changing output:

root@xen-16:~#  while sleep 1; do BLOCK_SIZE= df --portability /; done

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1            1.8MiB 175KiB 1.5MiB  11% /
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/sda1             1829159K   178307K  1553259K      11% /
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1               1.8    178    1.6  11% /
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/sda1             1829159M   178307M  1553259M      11% /
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1              1.8M   178k   1.5M  11% /
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/sda1              1829159    178307   1553259      11% /
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1             1.9MB  179kB  1.6MB  11% /

Source for this test case is the following fragment from the (backported)
mysql-server-5.0 init-script:

if LC_ALL=C BLOCK_SIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
  log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
  echo                "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
  exit 1
fi         

The alternating output of df causes the awk expression to randomly fail
which in turn leads to randomly startup failures of the mysql daemon.

I can only reproduce this bug on my AMD64 machines, i386 ones are not
affected (no idea about other 64bit architectures)

S°

(Please Cc: me on answers, as I am not subscribed to debian-adm64. Thanks.)

-- 
Sven Hartge -- professioneller Unix-Geek
Meine Gedanken im Netz: http://www.svenhartge.de/



Reply to: