Discussion:
[9fans] APE rename: wstat for 'none'
(too old to reply)
Yaroslav
2012-08-23 14:46:56 UTC
Permalink
Is there a specific reason of forbidding wstat for 'none' in fossil
(/sys/src/cmd/fossil/9p.c:130,133)?
This causes APE rename() to fail almost always
(/sys/src/ape/lib/ap/plan9/rename.c:43)

Perhaps rename() should be fixed to match mv (/sys/src/cmd/mv.c:/^mv1)
to go around this?
--
- Yaroslav
erik quanstrom
2012-08-23 15:16:46 UTC
Permalink
Post by Yaroslav
Is there a specific reason of forbidding wstat for 'none' in fossil
(/sys/src/cmd/fossil/9p.c:130,133)?
This causes APE rename() to fail almost always
(/sys/src/ape/lib/ap/plan9/rename.c:43)
Perhaps rename() should be fixed to match mv (/sys/src/cmd/mv.c:/^mv1)
to go around this?
why is this related to ape? if you are none, then you are limited
as to what you can do on the file server. you may just have an auth problem.

- erik
Yaroslav
2012-08-23 15:43:38 UTC
Permalink
Post by erik quanstrom
why is this related to ape? if you are none, then you are limited
as to what you can do on the file server. you may just have an auth problem.
APE implements rename() in terms of wstat or copying. It's just
doesn't try to work around failing wstat (that's perhaps a good thing)
while mv does.

There are no auth problem since I deliberatly run the python web app
as none, not willing to give it eve's powers.
erik quanstrom
2012-08-23 15:54:02 UTC
Permalink
Post by Yaroslav
Post by erik quanstrom
why is this related to ape? if you are none, then you are limited
as to what you can do on the file server. you may just have an auth problem.
APE implements rename() in terms of wstat or copying. It's just
doesn't try to work around failing wstat (that's perhaps a good thing)
while mv does.
There are no auth problem since I deliberatly run the python web app
as none, not willing to give it eve's powers.
are you sure?

; touch bz
; ratrace -c mv bz bw >[2=1]| grep -v 'Stat|Brk'
Post by Yaroslav
Post by erik quanstrom
780517 mv Wstat 4815 0xdfffceec/"bz" 0xc700 51 = 51 "" 1345736940235277042 1345736940235937748
780517 mv Open 1a7e 0xbd54/"#c/pid" 0x0 = 3 "" 1345736940236432242 1345736940236445037
780517 mv Pread 4835 3 0xdfffeef4 20 -1 0xdfffeef4/".....780517." 20 -1 = 12 "" 1345736941063833708 1345736941063836265
780517 mv Close 1a8e 3 = 0 "" 1345736941064897487 1345736941064899639
780517 mv Exits 4845 0/""
Yaroslav
2012-08-23 16:18:08 UTC
Permalink
Post by erik quanstrom
are you sure?
; touch bz
; ratrace -c mv bz bw >[2=1]| grep -v 'Stat|Brk'
you forgot auth/none...

; ratrace -c auth/none mv bz bw >[2=1]| grep -v ' none |Stat|Brk'
209051 mv Wstat 8cfe 0xdfffcef4/"bz" 0xc708 51 = -1 './bw' file does
not exist 1345738572648442848 1345738572649648848
209051 mv Open 3e05 0xdfffcef4/"bz" 0x0 = 3 "" 1345738572649753608
1345738572650669632
209051 mv Create 3e0d 0xdfffdef4/"./bw" 0x1 0x1b6 = 4 ""
1345738572651647673 1345738572653507377
209051 mv Pread 8d16 3 0xdfffae8c 8192 -1/"" 8192 -1 = 0 file does not
exist 1345738572653614652 1345738572654039559
209051 mv Close 3e15 3 = 0 "" 1345738572654426753 1345738572654851661
209051 mv Fwstat 8d1e 4 0xc708 49 = -1 './bw' file does not exist
1345738572655401443 1345738572655739187
209051 mv Remove 3dfd 0xdfffcef4/"bz" = 0 "" 1345738572656063524
1345738572656922558
209051 mv Close 3e15 4 = 0 "" 1345738572657094365 1345738572657555310
209051 mv Open 3e05 0xbbe4/"#c/pid" 0x0 = 3 "" 1345738572657805897
1345738572657894733
209051 mv Pread 8d16 3 0xdfffeefc 20 -1 0xdfffeefc/".....209051." 20
-1 = 12 "" 1345738572658193929 1345738572658201471
209051 mv Close 3e15 3 = 0 "" 1345738572658351488 1345738572658359031
209051 mv Exits 3e1d 0/""
erik quanstrom
2012-08-23 16:23:02 UTC
Permalink
Post by Yaroslav
Post by erik quanstrom
are you sure?
; touch bz
; ratrace -c mv bz bw >[2=1]| grep -v 'Stat|Brk'
you forgot auth/none...
no, i didn't. ratrace doesn't run if you're none. but that's beside
the point.

as i understand it, your claim is that mv works as none but ape/rename
does not and this is because ape/rename uses wstat.

since mv doesn't test to see if you're running as none, this trace shows
that claim to be incorrect. it's the same system call, and the same
9p message, regardless.

- erik
Yaroslav
2012-08-23 16:32:31 UTC
Permalink
Post by erik quanstrom
no, i didn't. ratrace doesn't run if you're none.
try 'ratrace -c auth/none cmd ...' while not being none
and ignore everything preceding Exec "cmd".
Post by erik quanstrom
as i understand it, your claim is that mv works as none but ape/rename
does not and this is because ape/rename uses wstat.
both use wstat or copying; what's different is how they choose what to use.
mv falls back to copying if wstat fails; ape/rename does not.
erik quanstrom
2012-08-23 16:42:22 UTC
Permalink
Post by Yaroslav
try 'ratrace -c auth/none cmd ...' while not being none
and ignore everything preceding Exec "cmd".
nice trick.
Post by Yaroslav
Post by erik quanstrom
as i understand it, your claim is that mv works as none but ape/rename
does not and this is because ape/rename uses wstat.
both use wstat or copying; what's different is how they choose what to use.
mv falls back to copying if wstat fails; ape/rename does not.
oh, i thought you were comparing system/library calls, not library function
vs program. i don't understand that comparison.

- erik
Yaroslav
2012-08-23 16:54:18 UTC
Permalink
Post by erik quanstrom
oh, i thought you were comparing system/library calls, not library function
vs program. i don't understand that comparison.
it so happens that mv is a program with own idea how to do renames,
and there are no other obvious subject to compare with.

Loading...