Subject: Re: fts_read: No such file or directory
To: None <current-users@netbsd.org>
From: Jukka Salmi <j+nbsd@2005.salmi.ch>
List: current-users
Date: 08/10/2005 10:43:14
Peter Seebach --> current-users (2005-08-09 21:31:50 -0500):
> $ du -s .
> du: fts_read: No such file or directory
> 
> This is a rather surprising outcome.
> 
> This is happening on an MS-DOS filesystem.  (Kernel is dated August 6.)
> 
> "du -s *" works fine; there is no subdirectory that causes trouble.

I see this on two up-to-date netbsd-2 i386 systems on ffs:

$ du -s /
du: fts_read: No such file or directory

However:

$ sudo du -sx /
78279   /

works fine, as does

$ cd /
$ sudo du -s / 
831478  /


> ktrace says:
> 
>   1226 du       RET   getdents 0
>   1226 du       CALL  lseek(4,0,0,0,0)
>   1226 du       RET   lseek 0
>   1226 du       CALL  close(4)
>   1226 du       RET   close 0
>   1226 du       CALL  open(0xbdbd025b,0,0x804b000)
>   1226 du       NAMI  ".."
>   1226 du       RET   open -1 errno 2 No such file or directory
>   1226 du       CALL  write(2,0xbfbfde60,4)
>   1226 du       GIO   fd 2 wrote 4 bytes
>        "du: "
>   1226 du       RET   write 4
>   1226 du       CALL  write(2,0xbfbfde80,8)
>   1226 du       GIO   fd 2 wrote 8 bytes
>        "fts_read"
>   1226 du       RET   write 8
>   1226 du       CALL  write(2,0xbdbcc9d2,2)
>   1226 du       GIO   fd 2 wrote 2 bytes
>        ": "
>   1226 du       RET   write 2

My trace looks different - there's nothing returning failure:

  1591 du       CALL  open(0x480ed557,0,0x804b000)
  1591 du       NAMI  ".."
  1591 du       RET   open 4
  1591 du       CALL  __fstat13(4,0xbfbff900)
  1591 du       RET   __fstat13 0
  1591 du       CALL  close(4)
  1591 du       RET   close 0
  1591 du       CALL  write(2,0xbfbff050,4)
  1591 du       GIO   fd 2 wrote 4 bytes
       "du: "
  1591 du       RET   write 4
  1591 du       CALL  write(2,0xbfbff070,8)
  1591 du       GIO   fd 2 wrote 8 bytes
       "fts_read"
  1591 du       RET   write 8
  1591 du       CALL  write(2,0x480f3a55,2)
  1591 du       GIO   fd 2 wrote 2 bytes
       ": "
  1591 du       RET   write 2


Regards,

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~