From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: Richard Miller <9fans@hamnavoe.com> Date: Thu, 29 Mar 2012 15:18:22 +0100 In-Reply-To: <8324903fd701463095501ba2faaa2bb6@hamnavoe.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] fossil riddle Topicbox-Message-UUID: 7068d0e4-ead7-11e9-9d60-3106f5b1d025 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 ..."