#142 cofs: "rm -r" fails on directories with more as 200 files

open
nobody
None
5
2008-11-30
2008-11-29
Henry N.
No

If a directory has more as 200 entries the call "rm -r testdir" fails with:

rm: cannot remove `testdir/file-000.tmp': No such file or directory
rm: cannot remove `testdir/file-001.tmp': No such file or directory
rm: cannot remove `testdir/file-002.tmp': No such file or directory
...
rm: cannot remove `testdir/file-200.tmp': No such file or directory

A "rm -rf testdir" on such directories goes in an endless loop with full cpu load. The rm command can simple break with "CTRL-C".

A "cd testdir; rm *" works without problems.

After the rm all files are removed. So, the rm is working, but not the "-r" option.

All coLinux versions have this problem (tested 0.7.2, 0.7.3, 0.8.0).
This problem I have only under Debian 4.0 Etch.
On Debian 3.0 (Wooody), all works without problems.

The script creates 201 files (from 000 to 200). If there are only 200 or less files in the directory, than it works. You can test it by change the 200 in the script to any lower value, for example 199, 100 or so.

#!/bin/bash -e
# create a list of files

rm -rf testdir
mkdir testdir
cd testdir

COUNT=0
while test $COUNT -le 200
do
NAME=$COUNT
test $NAME -le 99 && NAME=0$NAME
test $NAME -le 9 && NAME=0$NAME
echo "$NAME"
touch file-$NAME.tmp
COUNT=$(($COUNT+1))
done

cd ..
rm -r testdir

Discussion

  • Henry N.
    Henry N.
    2008-11-30

    • summary: cofs: "rm -r" fails on directories more as 200 files --> cofs: "rm -r" fails on directories with more as 200 files