[9fans] patch/create problem (error?)

2008-09-12 Thread Antonin Vecera
Hello all,

I had problem to create a patch - the command didn't finish for long long time.
I tried to do it manualy step by step from command line and it seems
that the problem is with cp command.
This is method how to repeat it:

I have in my home dir prepared new version of tftpd.c

ls -l $home/src/tftpd
--rw-rw-r-- M 40 antonin antonin   7708 Sep 11 14:59
/usr/antonin/src/tftpd/tftpd.c

1. bind -b -c $home/src/tftpd /sys/src/cmd/ip
2. 9fs sources
3. cp /sys/src/cmd/ip/tftpd.c /n/sources/patch/tftpd-error
...and now it hangs.

If I copy to /n/sources regular file, things go right.
If I try to copy file from bind-ed dir, cp hangs.

Maybe I am somewhere wrong, I am not sure.

Antonin



Re: [9fans] patch/create problem (error?)

2008-09-12 Thread erik quanstrom
 I had problem to create a patch - the command didn't finish for long long 
 time.

 I created a patch yesterday and it worked fine. It is fairly slow as it
 diff's all the files you have changed with those on sources.

 Sadly the 9p protocol is quite badly effected by high (intercontinential) 
 RTTs.

 -Steve
 
 There were only 2 files in the patch. I wait for about 10 minutes and nothing.
 But then I tried to copy a file from command line.
 If I copied an ordinary file (to /n/sources) it was done immediately.
 But If I copied a file from bind-ed(!) directory it was endless...
 There was no diff, only copy file.

i would guess the problem is a bit different.  i'm assuming that
reads from sources work fine.  it's not until you try to write there
that there's a problem.

this sounds like a mtu problem.  i have a similar problem.
i am not able to submit patches over one particular
network interface.  however, if i use a lower mtu, things work fine.
i believe this is because the dumpy dsl modem we have
blocks icmp messages.

you could lower the mtu on the interface, but rather than
punishing all traffic, i wrote a program called cpmtu. cpmtu
is attached.  if you define this function
fn cp {cpmtu -m 700 $*}
before you run patch/create, i believe patch should work
properly for you.

as an aside: i don't think 9p itself limits plan 9 performance
over high-latency links.  the limitations have more to do with
the number of outstanding messages, which is 1 in the mnt
driver.

- erik
#include u.h
#include libc.h

int mtu = 8*1024;
int failed;
int gflag;
int uflag;
int xflag;
voidcopy(char *from, char *to, int todir);
int copy1(int fdf, int fdt, char *from, char *to);

void
usage(void)
{
fprint(2, usage:\tcp [-gux] [-m mtu] fromfile tofile\n);
fprint(2, \tcp [-x] [-m mtu] fromfile ... todir\n);
exits(usage);
}

void
main(int argc, char *argv[])
{
Dir *dirb;
int todir, i;

ARGBEGIN {
case 'g':
gflag++;
break;
case 'u':
uflag++;
gflag++;
break;
case 'x':
xflag++;
break;
case 'm':
mtu = atoi(EARGF(usage()));
if(mtu  0)
break;
default:
usage();
} ARGEND

todir=0;
if(argc  2)
usage();
dirb = dirstat(argv[argc-1]);
if(dirb!=nil  (dirb-modeDMDIR))
todir=1;
if(argc2  !todir){
fprint(2, cp: %s not a directory\n, argv[argc-1]);
exits(bad usage);
}
for(i=0; iargc-1; i++)
copy(argv[i], argv[argc-1], todir);
if(failed)
exits(errors);
exits(0);
}

int
samefile(Dir *a, char *an, char *bn)
{
Dir *b;
int ret;

ret = 0;
b=dirstat(bn);
if(b != nil)
if(b-qid.type==a-qid.type)
if(b-qid.path==a-qid.path)
if(b-qid.vers==a-qid.vers)
if(b-dev==a-dev)
if(b-type==a-type){
fprint(2, cp: %s and %s are the same file\n, an, bn);
ret = 1;
}
free(b);
return ret;
}

void
copy(char *from, char *to, int todir)
{
Dir *dirb, dirt;
char name[256];
int fdf, fdt, mode;

if(todir){
char *s, *elem;
elem=s=from;
while(*s++)
if(s[-1]=='/')
elem=s;
sprint(name, %s/%s, to, elem);
to=name;
}

if((dirb=dirstat(from))==nil){
fprint(2,cp: can't stat %s: %r\n, from);
failed = 1;
return;
}
mode = dirb-mode;
if(modeDMDIR){
fprint(2, cp: %s is a directory\n, from);
free(dirb);
failed = 1;
return;
}
if(samefile(dirb, from, to)){
free(dirb);
failed = 1;
return;
}
mode = 0777;
fdf=open(from, OREAD);
if(fdf0){
fprint(2, cp: can't open %s: %r\n, from);
free(dirb);
failed = 1;
return;
}
fdt=create(to, OWRITE, mode);
if(fdt0){
fprint(2, cp: can't create %s: %r\n, to);
close(fdf);
free(dirb);
failed = 1;
return;
}
if(copy1(fdf, fdt, from, to)==0  (xflag || gflag || uflag)){
nulldir(dirt);
if(xflag){
dirt.mtime = dirb-mtime;
dirt.mode = dirb-mode;
}
if(uflag)
dirt.uid = dirb-uid;
if(gflag)
dirt.gid = 

Re: [9fans] purposeful omission or amnesia

2008-09-12 Thread Eris Discordia
Neither purposeful omission nor amnesia. Rather pragmatism. Nachos, 
ReactOS, QNX, and many others are left unmentioned, too. From these QNX has 
been _really_ successful in the real world and it's fully POSIX. MOS is a 
book for teaching the natural way to students not the (fruitless) deviation 
to hackers. Plan 9 is _for now_ a marginal player.


Just a look at how Anant Narayanan promoted his talk explains it all (and 
he's a student of Tanenbaum's department):


Plan 9 from Bell Labs is a radically new approach to operating and 
distributed systems. Unencumbered by requirements such as ANSI or POSIX 
compliance, the authors were able to take full advantage of modern 
technology made available to us since UNIX was first conceived.


-- http://foss.in/2007/register/speakers/talkdetailspub.php?talkid=388

Radically new? Unencumbered? Full advantage? Modern technology? 
Puh-lease! Microsoft had/has the largest installed base of operating 
systems and the latest technology access and they didn't dare utter that. 
Imagine this at some Microsoft developer convention: we present here the 
new version of Windows, completely 'unencumbered' by POSIX.


P.S. This was just some useless whining. A little spark. Let it die on its 
own... there'll be no flames.


--On Thursday, September 11, 2008 12:52 PM -0700 Skip Tavakkolian 
[EMAIL PROTECTED] wrote:



i was flipping through tanenbaum's modern operating systems - 3e
(2008) and couldn't find any mention of plan9, inferno or 9p.  how
modern is that!?






Re: [9fans] purposeful omission or amnesia

2008-09-12 Thread Eris Discordia
Operating Systems Design and Implementation, 3rd Edition doesn't mention 
it, but it's the MINIX (ah, MINIX 3) book anyway. Modern Operating 
Systems, 2nd Edition contains not even a reference. Computer Networks, 
4th Edition doesn't mention 9P at all--RPC's there, though.


Cool!

--On Friday, September 12, 2008 11:25 AM -0300 Federico G. Benavento 
[EMAIL PROTECTED] wrote:



I thought that Plan 9 was mentioned in modern operating systems,
I read it in 2002, but maybe was in the distributed systems one

On Thu, Sep 11, 2008 at 4:52 PM, Skip Tavakkolian [EMAIL PROTECTED]
wrote:

i was flipping through tanenbaum's modern operating systems - 3e
(2008) and couldn't find any mention of plan9, inferno or 9p.  how
modern is that!?







--
Federico G. Benavento









Re: [9fans] patch/create problem (error?)

2008-09-12 Thread Antonin Vecera
On Fri, Sep 12, 2008 at 1:47 PM, erik quanstrom [EMAIL PROTECTED] wrote:
 I had problem to create a patch - the command didn't finish for long long 
 time.

 I created a patch yesterday and it worked fine. It is fairly slow as it
 diff's all the files you have changed with those on sources.

 Sadly the 9p protocol is quite badly effected by high (intercontinential) 
 RTTs.

 -Steve

 There were only 2 files in the patch. I wait for about 10 minutes and 
 nothing.
 But then I tried to copy a file from command line.
 If I copied an ordinary file (to /n/sources) it was done immediately.
 But If I copied a file from bind-ed(!) directory it was endless...
 There was no diff, only copy file.

 i would guess the problem is a bit different.  i'm assuming that
 reads from sources work fine.  it's not until you try to write there
 that there's a problem.

 this sounds like a mtu problem.  i have a similar problem.
 i am not able to submit patches over one particular
 network interface.  however, if i use a lower mtu, things work fine.
 i believe this is because the dumpy dsl modem we have
 blocks icmp messages.

 you could lower the mtu on the interface, but rather than
 punishing all traffic, i wrote a program called cpmtu. cpmtu
 is attached.  if you define this function
fn cp {cpmtu -m 700 $*}
 before you run patch/create, i believe patch should work
 properly for you.

 as an aside: i don't think 9p itself limits plan 9 performance
 over high-latency links.  the limitations have more to do with
 the number of outstanding messages, which is 1 in the mnt
 driver.

 - erik


It seems you are right. I think I used in my previous tests too
specific (small) files.
I will try to play with mtu and with your cpmtu.

Anyway, does 9P and Plan9 know about path MTU discovery?
Or have I something wrong at my firewall/router?
Other of my computers (FreeBSD,Windows) don't have such problems.

Antonin



Re: [9fans] patch/create problem (error?)

2008-09-12 Thread erik quanstrom
 Anyway, does 9P and Plan9 know about path MTU discovery?

traditional path mtu uses icmp messages.  if your router/modem/whatever
eats icmp, you're outta luck with these traditional methods.
cf. http://www.netheaven.com/pmtu.html  i think there are some tricks
to get around the missing icmp messages, though.

 Or have I something wrong at my firewall/router?
 Other of my computers (FreeBSD,Windows) don't have such problems.

have you tried mounting sources from these machines?

i think this problem is pecular to sources.  if the pmtu is
symmetric, it seems sources is a few bytes short of a full packet.
1510 bytes.  yet when i read from a local machine, the tcp
packets are a bit long of a full packet -- 1518 bytes.

something to look into.

- erik



Re: [9fans] purposeful omission or amnesia

2008-09-12 Thread Pietro Gagliardi

On Sep 12, 2008, at 8:28 AM, Eris Discordia wrote:


completely 'unencumbered' by POSIX.


s/completely/almost /

Pietro




Re: [9fans] purposeful omission or amnesia

2008-09-12 Thread Eris Discordia

s/completely/almost /


Please don't try to educate me P. G. Microsoft got themselves into lots of 
trouble to make NT almost POSIX compliant and to also create a fully POSIX 
compliant subsystem (SFU/SUA/Interix). Everybody knows that. The sentence 
you quoted was a hypothetical, you know, a _hypothetical_. Seeing how 
terrific the hypothetical sounds one gets to shudder at the sound of 
Anant Narayanan's actual promotion of Plan 9.


--On Friday, September 12, 2008 2:47 PM -0400 Pietro Gagliardi 
[EMAIL PROTECTED] wrote:



On Sep 12, 2008, at 8:28 AM, Eris Discordia wrote:


completely 'unencumbered' by POSIX.


s/completely/almost /

Pietro










[9fans] Eris keen on anything

2008-09-12 Thread fgergo
Would you please move?



[9fans] cin is in

2008-09-12 Thread Bruce Ellis
I don't know how you get the source but it is a cool program.

It can simulate itself simulating itself simulating another program.
Lotsa cool stuff.

http://portal.acm.org/citation.cfm?id=107172.107190coll=GUIDEdl=GUIDE

brucee