The riddle revealed:

term% ls -l ape
d-rwxrwxr-x M 1003 miller miller   0 Mar 27 09:31 ape/9src
d-rwxrwxr-x M 1003 miller miller   0 Mar 27 09:31 ape/cmd
--rw-rw-r-- M 1003 miller miller 573 Feb 28  2002 ape/config
d-rwxrwxr-x M 1003 miller miller   0 Mar 27 09:31 ape/lib
--rw-rw-r-- M 1003 miller miller 368 Feb 28  2002 ape/mkfile
term% ls -l ape/cmd
ls: ape/cmd: 'ape/cmd' does not exist
term% cd ape
term% ls -l cmd
ls: cmd: 'cmd' disk is full

It's actually not specific to fossil, but an artefact of
9P2000.  If a walk(5) down a multi-level path fails at the
first level, the server can return Rerror with an informative
message.  But if it partially succeeds, it must return Rwalk
with a list of qids for the successfully traversed directories.
The kernel can't tell why the walk didn't complete, so it
takes a guess at "does not exist".

Possible solutions (if anyone cares):

- Next time 9P is revised, add a status string to Rwalk.
- In the kernel, if an N-level walk fails at level K (1 < K <= N),
  retry as two sub-walks (length K-1 and 1) to get an Rwalk for
  the failing level.  If there's a race condition and the retry
  succeeds, that's OK too.
- Change the error message to something more truthful like
  "can't walk to ..."


Reply via email to