cannot delete directory - why?

Brian May (bam@snoopy.apana.org.au)
Sat, 2 Oct 1999 16:34:23 +1000


Hello,

I can't seem to delete the following directory:

snoopy# pwd
/homes/diskless/slink/root/dev
snoopy# ls -ld pts
drwxr-xr-x 2 root root 0 Oct 2 15:20 pts
snoopy# ls -la pts/
total 18
drwxr-xr-x 2 root root 0 Oct 2 15:20 .
drwxr-xr-x 3 root root 17408 Oct 2 15:53 ..

Nothing is using it or mounted in it (take my word for it).

snoopy# rmdir pts
rmdir: pts: No such file or directory
snoopy# rm -rf pts

still exists:

snoopy# pwd
/homes/diskless/slink/root
snoopy# rm -rf dev

hangs - I have to push ctrl+C

snoopy# strace rm -rf dev
[...]
lstat("dev/pts", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
stat("dev/pts", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("dev/pts", O_RDONLY|O_NONBLOCK) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
lseek(3, 0, SEEK_CUR) = 0
getdents(3, /* 2 entries */, 984) = 28
lseek(3, 0, SEEK_CUR) = 256
getdents(3, /* 0 entries */, 984) = 0
close(3) = 0
rmdir("dev/pts") = -1 ENOENT (No such file or directory)
stat("dev", {st_mode=S_IFDIR|0755, st_size=17408, ...}) = 0
open("dev", O_RDONLY|O_NONBLOCK) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
lseek(3, 0, SEEK_CUR) = 0
getdents(3, /* 2 entries */, 3933) = 28
lseek(3, 0, SEEK_CUR) = 1024
getdents(3, /* 1 entries */, 3933) = 16
lseek(3, 0, SEEK_CUR) = 17408
getdents(3, /* 0 entries */, 3933) = 0
close(3) = 0
[...the above repeats endlessly...]

So any ideas what is going on? I have Linux 2.2.12

Is this a sign of filesystem curruption? I hope not - up to now Linux
has been very reliable in this respect.

The partition is ext2:
/dev/hdb2 on /homes type ext2 (rw,usrquota)

-- 
Brian May <bam@snoopy.apana.org.au>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/