9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] v9fs/fossil oddity
@ 2008-05-08 17:56 Brian L. Stuart
  2008-05-08 18:05 ` Eric Van Hensbergen
  0 siblings, 1 reply; 4+ messages in thread
From: Brian L. Stuart @ 2008-05-08 17:56 UTC (permalink / raw)
  To: 9fans

I've found something that looks odd in the way v9fs
under Linux interacts with a fossil running on Plan 9.
If I create a file by redirecting output, the shell
seems able to happily create the file.  If I try to
cp a file, then it fails.  The logs show the error
"unknown mode."  As near as I can tell, here's what's
happening:

- cp creates the file with the O_EXCL flag.
- v9fs_uflags2mode() sets the P9_OEXCL flag.
- v9fs defines P9_OEXCL to be 4, where
  /sys/include/libc.h defines OEXCL to be 0x1000
- fossil masks the mode it gets with 7,
  keeping the P9_OEXCL flag.
- When fossil checks for the allowed modes, it
  does so with strict equalities that don't
  include bit 2 (the P9_OEXCL flag).  So none
  of them match, and we get an unknown mode.

At first glance, it would appear that there are two
bugs.  v9fs shouldn't define P9_OEXCL to be 4,
but to be 0x1000.  Second the OMODE mask in
/sys/src/cmd/fossil/9p.c should be 3 and not 7
so that we are only looking at the read and
write flags when doing the comparisons.

Am I missing something here?  Is there a reason
these are what they are?  If they've been identified
and fixed already, I apologize for the noise.

BLS



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

end of thread, other threads:[~2008-05-08 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-08 17:56 [9fans] v9fs/fossil oddity Brian L. Stuart
2008-05-08 18:05 ` Eric Van Hensbergen
2008-05-08 18:13   ` Brian L. Stuart
2008-05-08 18:27     ` Brian L. Stuart

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