Date: Sat, 24 Jul 1999 22:30:01 -0700 (PDT) From: Tor.Egge@fast.no To: freebsd-bugs@FreeBSD.org Subject: Re: kern/12800: buffer leak in cluster_wbuild Message-ID: <199907250530.WAA97884@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/12800; it has been noted by GNATS. From: Tor.Egge@fast.no To: tegge@not.fast.no Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/12800: buffer leak in cluster_wbuild Date: Sun, 25 Jul 1999 07:23:18 +0200 With this patch installed, the problem with processes getting stuck in getblk disappeared. The spurious SIGBUSes were due to mmap allowing us to map memory completely after the end of the file. When accessing the pages that weren't even partially backed by the file, the result was a SIGBUS. The coredump routines needs some more robustness against the program having performed incorrect mmap() operations. --------------- Index: vfs_cluster.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_cluster.c,v retrieving revision 1.87 diff -u -r1.87 vfs_cluster.c --- vfs_cluster.c 1999/07/08 06:05:53 1.87 +++ vfs_cluster.c 1999/07/25 05:08:52 @@ -774,6 +774,20 @@ splx(s); break; } + if (tbp->b_flags & B_VMIO) { + vm_page_t m; + + for (j = 0; + j < tbp->b_npages; j += 1) { + m = tbp->b_pages[j]; + if (m->flags & PG_BUSY) { + BUF_UNLOCK(tbp); + splx(s); + goto finishcluster; + } + } + } + /* * Ok, it's passed all the tests, * so remove it from the free list @@ -798,7 +812,7 @@ for (j = 0; j < tbp->b_npages; j += 1) { m = tbp->b_pages[j]; if (m->flags & PG_BUSY) - goto finishcluster; + panic("cluster_wbuild: PG_BUSY: m=%p, tbp=%p\n", m, tbp); } } --------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907250530.WAA97884>