From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 9 Sep 2010 18:28:03 -0400 To: 9fans@9fans.net Message-ID: In-Reply-To: <1023d4c768c8748eb15f14ff85786cf7@terzarima.net> References: <1023d4c768c8748eb15f14ff85786cf7@terzarima.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] kfs bug Topicbox-Message-UUID: 5322f6c8-ead6-11e9-9d60-3106f5b1d025 On Thu Sep 9 09:54:56 EDT 2010, forsyth@terzarima.net wrote: > >Would I be right in thinking that 9p originally had 16 bit fids? If > >so, it suggests that no-one has used kfs in anger for a while. > > how are you using the kfs? just locally? > a plan 9 client normally re-used fids, so i'd have thought you'd need to have >32767 active files, > which most people probably haven't done. changing File->fid to ulong should be good enough. i haven't had any trouble in testing on arm. one could argue for u32int, but the rest of kfs doesn't use u32int either and i didn't track down all the places where fid is passed in an int anyway. diff -c /n/dump/2010/0909/sys/src/cmd/disk/kfs/portdat.h portdat.h /n/dump/2010/0909/sys/src/cmd/disk/kfs/portdat.h:150,156 - portdat.h:150,156 long addr; long slot; long lastra; /* read ahead address */ - short fid; + ulong fid; short uid; char open; #define FREAD 1 diff -c /n/dump/2010/0909/sys/src/cmd/disk/kfs/sub.c sub.c /n/dump/2010/0909/sys/src/cmd/disk/kfs/sub.c:89,95 - sub.c:89,95 goto out; } } - else print("cannot find %p.%d (list=%p)\n", cp, fid, cp->flist); + else print("cannot find %p.%ud (list=%p)\n", cp, fid, cp->flist); unlock(&cp->flock); return 0; - erik