9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] APE rename: wstat for 'none'
@ 2012-08-23 14:46 Yaroslav
  0 siblings, 0 replies; 9+ messages in thread
From: Yaroslav @ 2012-08-23 14:46 UTC (permalink / raw)
  To: 9fans

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



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

* Re: [9fans] APE rename: wstat for 'none'
  2012-08-23 16:42             ` erik quanstrom
@ 2012-08-23 16:54               ` Yaroslav
  0 siblings, 0 replies; 9+ messages in thread
From: Yaroslav @ 2012-08-23 16:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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



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

* Re: [9fans] APE rename: wstat for 'none'
       [not found]           ` <CAG3N4d_XzC19rud_S4WjLdKV9H28S0FtEW3AnHFatL+UqGAcAw@mail.gmail.c>
@ 2012-08-23 16:42             ` erik quanstrom
  2012-08-23 16:54               ` Yaroslav
  0 siblings, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2012-08-23 16:42 UTC (permalink / raw)
  To: 9fans

> try 'ratrace -c auth/none cmd ...' while not being none
> and ignore everything preceding Exec "cmd".

nice trick.

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



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

* Re: [9fans] APE rename: wstat for 'none'
  2012-08-23 16:23         ` erik quanstrom
@ 2012-08-23 16:32           ` Yaroslav
       [not found]           ` <CAG3N4d_XzC19rud_S4WjLdKV9H28S0FtEW3AnHFatL+UqGAcAw@mail.gmail.c>
  1 sibling, 0 replies; 9+ messages in thread
From: Yaroslav @ 2012-08-23 16:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

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



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

* Re: [9fans] APE rename: wstat for 'none'
       [not found]       ` <CAG3N4d-aMWWawDBksttk5AG4wv44LPkmoQ9XF7TAUZ85a7ZGGw@mail.gmail.c>
@ 2012-08-23 16:23         ` erik quanstrom
  2012-08-23 16:32           ` Yaroslav
       [not found]           ` <CAG3N4d_XzC19rud_S4WjLdKV9H28S0FtEW3AnHFatL+UqGAcAw@mail.gmail.c>
  0 siblings, 2 replies; 9+ messages in thread
From: erik quanstrom @ 2012-08-23 16:23 UTC (permalink / raw)
  To: 9fans

On Thu Aug 23 12:19:22 EDT 2012, yarikos@gmail.com wrote:
> > 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



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

* Re: [9fans] APE rename: wstat for 'none'
  2012-08-23 15:54     ` erik quanstrom
@ 2012-08-23 16:18       ` Yaroslav
       [not found]       ` <CAG3N4d-aMWWawDBksttk5AG4wv44LPkmoQ9XF7TAUZ85a7ZGGw@mail.gmail.c>
  1 sibling, 0 replies; 9+ messages in thread
From: Yaroslav @ 2012-08-23 16:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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



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

* Re: [9fans] APE rename: wstat for 'none'
       [not found]   ` <CAG3N4d9NVTKqwH9Ho0LkfSqxgZAxsGpwN_tFW-4k6GaUFdrQpA@mail.gmail.c>
@ 2012-08-23 15:54     ` erik quanstrom
  2012-08-23 16:18       ` Yaroslav
       [not found]       ` <CAG3N4d-aMWWawDBksttk5AG4wv44LPkmoQ9XF7TAUZ85a7ZGGw@mail.gmail.c>
  0 siblings, 2 replies; 9+ messages in thread
From: erik quanstrom @ 2012-08-23 15:54 UTC (permalink / raw)
  To: 9fans

On Thu Aug 23 11:44:55 EDT 2012, yarikos@gmail.com wrote:
> > 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'
>>>	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/""




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

* Re: [9fans] APE rename: wstat for 'none'
  2012-08-23 15:16 ` erik quanstrom
@ 2012-08-23 15:43   ` Yaroslav
       [not found]   ` <CAG3N4d9NVTKqwH9Ho0LkfSqxgZAxsGpwN_tFW-4k6GaUFdrQpA@mail.gmail.c>
  1 sibling, 0 replies; 9+ messages in thread
From: Yaroslav @ 2012-08-23 15:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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



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

* Re: [9fans] APE rename: wstat for 'none'
       [not found] <CAG3N4d_daNzfAbW8cn5xvF3zJ7sx4gpjGpWpL2dL_3mXdNruzA@mail.gmail.c>
@ 2012-08-23 15:16 ` erik quanstrom
  2012-08-23 15:43   ` Yaroslav
       [not found]   ` <CAG3N4d9NVTKqwH9Ho0LkfSqxgZAxsGpwN_tFW-4k6GaUFdrQpA@mail.gmail.c>
  0 siblings, 2 replies; 9+ messages in thread
From: erik quanstrom @ 2012-08-23 15:16 UTC (permalink / raw)
  To: 9fans

On Thu Aug 23 10:48:13 EDT 2012, yarikos@gmail.com wrote:
> 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



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

end of thread, other threads:[~2012-08-23 16:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-23 14:46 [9fans] APE rename: wstat for 'none' Yaroslav
     [not found] <CAG3N4d_daNzfAbW8cn5xvF3zJ7sx4gpjGpWpL2dL_3mXdNruzA@mail.gmail.c>
2012-08-23 15:16 ` erik quanstrom
2012-08-23 15:43   ` Yaroslav
     [not found]   ` <CAG3N4d9NVTKqwH9Ho0LkfSqxgZAxsGpwN_tFW-4k6GaUFdrQpA@mail.gmail.c>
2012-08-23 15:54     ` erik quanstrom
2012-08-23 16:18       ` Yaroslav
     [not found]       ` <CAG3N4d-aMWWawDBksttk5AG4wv44LPkmoQ9XF7TAUZ85a7ZGGw@mail.gmail.c>
2012-08-23 16:23         ` erik quanstrom
2012-08-23 16:32           ` Yaroslav
     [not found]           ` <CAG3N4d_XzC19rud_S4WjLdKV9H28S0FtEW3AnHFatL+UqGAcAw@mail.gmail.c>
2012-08-23 16:42             ` erik quanstrom
2012-08-23 16:54               ` Yaroslav

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