guard against bogus 0-extension of masks. most of these are harmless to real file servers now, as the largest qid is just 24-bits, but as this number increases it will be more imporant. the real fix is to mmu.c, which has a real bug in PPN. Reference: /n/atom/patch/applied/fssignextend Date: Sat Aug 15 23:12:56 CES 2015 Signed-off-by: quanstro@quanstro.net --- /sys/src/fs/port/iobuf.c Sat Aug 15 23:11:54 2015 +++ /sys/src/fs/port/iobuf.c Sat Aug 15 23:11:55 2015 @@ -227,7 +227,7 @@ return 2; } if(qpath != QPNONE) { - if((qpath ^ t->path) & ~QPDIR) { + if((qpath ^ t->path) & ~(uvlong)QPDIR) { print(" tag/path = %llud; expected %d/%llux\n", (Wideoff)t->path, tag, (Wideoff)qpath); return 0; --- /sys/src/fs/port/chk.c Sat Aug 15 23:11:57 2015 +++ /sys/src/fs/port/chk.c Sat Aug 15 23:11:59 2015 @@ -509,7 +509,7 @@ } /* check qid */ - edent.qpath = d->qid.path & ~QPDIR; + edent.qpath = d->qid.path & ~(uvlong)QPDIR; qmark(edent.qpath); if(edent.qpath > maxq) maxq = edent.qpath; --- /sys/src/fs/port/9p2.c Sat Aug 15 23:12:02 2015 +++ /sys/src/fs/port/9p2.c Sat Aug 15 23:12:04 2015 @@ -223,7 +223,7 @@ void mkqid9p2(Qid* qid, Qid9p1* qid9p1, int mode9p1) { - qid->path = (ulong)(qid9p1->path & ~QPDIR); + qid->path = (ulong)(qid9p1->path & ~(uvlong)QPDIR); qid->vers = qid9p1->version; qid->type = mktype9p2(mode9p1); } --- /sys/src/fs/amd64/mmu.c Sat Aug 15 23:12:06 2015 +++ /sys/src/fs/amd64/mmu.c Sat Aug 15 23:12:08 2015 @@ -51,7 +51,7 @@ * mmuptcopy (PteSHARED trick?); */ -#define PPN(x) ((x)&~(PGSZ-1)) +#define PPN(x) ((x)&~(uintptr)(PGSZ-1)) /* * set up a pat mappings. the system depends