From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amol Dixit To: "9fans@9fans.net" <9fans@9fans.net> Date: Sun, 19 Jan 2014 22:49:16 -0800 Message-ID: Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [9fans] Duplicate fids on 9p server Topicbox-Message-UUID: b3f9edec-ead8-11e9-9d60-3106f5b1d025 Hi, I am pretty new to 9P and I was attempting to write a basic file server for= 9P clients.=20 I am using 9pfuse on the client end to connect to my server. I have a quest= ion about *fid* alloction on the server. In the sample server implementation of plan9port lib9p/{ramfs.c, srv.c} =85= the server code returns Edupfid if a particular fid is already used (due t= o attach, walk, open etc).=20 So for a single client, the server works just fine =97 fids are allocated i= n order 0, 1, 2=85 etc. If the second client using 9pfuse tries to attach to this server it will re= quest the same sequence of fids 0, 1, 2=85 and so on. The server code will = immediately reject these requests with Edupfid if those fids are currently = in use.=20 I first assumed the client will correct itself and retry the same request w= ith a new fid. On more thought I realized that the server should be the one= differentiating between the clients even if they request the same fids for= attach/open/walk etc. Am I right in this assumption? Basically the server = should create new internal fids with ClientID+FID to point to the *same* fi= le and maintain that mapping=85.so that all clients (9pfuse based in this c= ase) still see its sequence (0, 1, 2=85), but the server internally maps th= em to a different IDs pointing to the same file. Hope above question makes sense. Thanks in advance, Amol=