From owner-freebsd-bugs Sat Jul 24 22:31:49 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B083114DB8 for ; Sat, 24 Jul 1999 22:31:45 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA97884; Sat, 24 Jul 1999 22:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sat, 24 Jul 1999 22:30:01 -0700 (PDT) Message-Id: <199907250530.WAA97884@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Tor.Egge@fast.no Subject: Re: kern/12800: buffer leak in cluster_wbuild Reply-To: Tor.Egge@fast.no Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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