From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoann Padioleau To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Date: Tue, 3 Jun 2014 01:14:13 +0000 Message-ID: Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [9fans] kernel bug Topicbox-Message-UUID: f4b624ae-ead8-11e9-9d60-3106f5b1d025 Hi, in the newseg() function there is: mapsize =3D ROUND(size, PTEPERTAB)/PTEPERTAB; if(mapsize > nelem(s->ssegmap)){ mapsize *=3D 2; if(mapsize > (SEGMAPSIZE*PTEPERTAB)) mapsize =3D (SEGMAPSIZE*PTEPERTAB); s->map =3D smalloc(mapsize*sizeof(Pte*)); s->mapsize =3D mapsize; } else{ s->map =3D s->ssegmap; s->mapsize =3D nelem(s->ssegmap); } I think it should be if(mapsize > (SEGMAPSIZE)) mapsize =3D SEGMAPSIZE; Also why in the kernel they use 'struct Pte' instead of the better name Pag= etable. In many places this is very confusing because when I see Pte I think of a P= agetable Entry where really they are speaking about a Pagetable.=