9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] fossil riddle
@ 2012-03-27 16:38 Richard Miller
  2012-03-27 17:47 ` Nemo
  2012-03-29 14:18 ` Richard Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Miller @ 2012-03-27 16:38 UTC (permalink / raw)
  To: 9fans

Who can guess what's happening here:

term% ls -ld src
d-rwxrwxr-x M 353 miller miller 0 Mar 27 17:15 src
term% ls -l src
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/9
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/ape
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/boot
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/cmd
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/games
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/lib9p
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libString
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libauth
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libauthsrv
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libavl
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libbin
d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libbio
term% ls -l src/*
ls: src/9: 'src/9' does not exist
ls: src/ape: 'src/ape' does not exist
ls: src/boot: 'src/boot' does not exist
ls: src/cmd: 'src/cmd' does not exist
ls: src/games: 'src/games' does not exist
ls: src/lib9p: 'src/lib9p' does not exist
ls: src/libString: 'src/libString' does not exist
ls: src/libauth: 'src/libauth' does not exist
ls: src/libauthsrv: 'src/libauthsrv' does not exist
ls: src/libavl: 'src/libavl' does not exist
ls: src/libbin: 'src/libbin' does not exist
ls: src/libbio: 'src/libbio' does not exist




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] fossil riddle
  2012-03-27 16:38 [9fans] fossil riddle Richard Miller
@ 2012-03-27 17:47 ` Nemo
  2012-03-27 18:17   ` Richard Miller
  2012-03-29 14:18 ` Richard Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Nemo @ 2012-03-27 17:47 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I've seen that when the directory is ok but the file is not, fossil cannot
get to the data file although it can obtain the metadata for the file.
In fact, we still have a few files named "bug" which came from
mv a-file-in-such-shape to bug

Is that the case?

On Mar 27, 2012, at 6:38 PM, Richard Miller wrote:

> Who can guess what's happening here:
>
> term% ls -ld src
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 17:15 src
> term% ls -l src
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/9
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/ape
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/boot
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/cmd
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/games
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/lib9p
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libString
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libauth
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libauthsrv
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libavl
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libbin
> d-rwxrwxr-x M 353 miller miller 0 Mar 27 09:31 src/libbio
> term% ls -l src/*
> ls: src/9: 'src/9' does not exist
> ls: src/ape: 'src/ape' does not exist
> ls: src/boot: 'src/boot' does not exist
> ls: src/cmd: 'src/cmd' does not exist
> ls: src/games: 'src/games' does not exist
> ls: src/lib9p: 'src/lib9p' does not exist
> ls: src/libString: 'src/libString' does not exist
> ls: src/libauth: 'src/libauth' does not exist
> ls: src/libauthsrv: 'src/libauthsrv' does not exist
> ls: src/libavl: 'src/libavl' does not exist
> ls: src/libbin: 'src/libbin' does not exist
> ls: src/libbio: 'src/libbio' does not exist
>




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] fossil riddle
  2012-03-27 17:47 ` Nemo
@ 2012-03-27 18:17   ` Richard Miller
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Miller @ 2012-03-27 18:17 UTC (permalink / raw)
  To: 9fans

> I've seen that when the directory is ok but the file is not, fossil cannot
> get to the data file although it can obtain the metadata for the file.
>..
> Is that the case?

No, in this case the files are all actually fine.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] fossil riddle
  2012-03-27 16:38 [9fans] fossil riddle Richard Miller
  2012-03-27 17:47 ` Nemo
@ 2012-03-29 14:18 ` Richard Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Miller @ 2012-03-29 14:18 UTC (permalink / raw)
  To: 9fans

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 ..."




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-29 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-27 16:38 [9fans] fossil riddle Richard Miller
2012-03-27 17:47 ` Nemo
2012-03-27 18:17   ` Richard Miller
2012-03-29 14:18 ` Richard Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).