From owner-freebsd-hackers Thu Sep 12 15:24:46 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73FE537B400; Thu, 12 Sep 2002 15:24:42 -0700 (PDT) Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1166B43E4A; Thu, 12 Sep 2002 15:24:42 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0015.cvx40-bradley.dialup.earthlink.net ([216.244.42.15] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 17pcO5-0006GH-00; Thu, 12 Sep 2002 15:24:38 -0700 Message-ID: <3D8113D9.CBF06664@mindspring.com> Date: Thu, 12 Sep 2002 15:23:21 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Norikatsu Shigemura Cc: freebsd-hackers@FreeBSD.org Subject: Re: filesytem bsize=64k causes libc/db hash crash References: <200209122022.g8CKM004040532@nd250009.gab.xdsl.ne.jp> Content-Type: multipart/mixed; boundary="------------0D69AD2D1777CA68B9DD36F0" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------0D69AD2D1777CA68B9DD36F0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Norikatsu Shigemura wrote: > I found a problem on 4-STABLE(maybe 5-CURRENT, too) with libc/db > (BerkeleyDB 1). It that when block size on fs is 65536 bytes, > many programs which use BerkeleyDB(dev_mkdb, cap_mkdb, etc..) are > crash. Here is a patch; it's ugly, but it works. -- Terry --------------0D69AD2D1777CA68B9DD36F0 Content-Type: text/plain; charset=us-ascii; name="db.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="db.diff" Index: btree/bt_open.c =================================================================== RCS file: /usr/cvs/src/lib/libc/db/btree/bt_open.c,v retrieving revision 1.7.2.1 diff -c -r1.7.2.1 bt_open.c *** btree/bt_open.c 2 Nov 2000 10:30:07 -0000 1.7.2.1 --- btree/bt_open.c 12 Sep 2002 22:28:51 -0000 *************** *** 262,267 **** --- 262,269 ---- */ if (b.psize == 0) { b.psize = sb.st_blksize; + if (b.psize > 32768) + b.psize = 32868; if (b.psize < MINPSIZE) b.psize = MINPSIZE; if (b.psize > MAX_PAGE_OFFSET + 1) Index: hash/hash.c =================================================================== RCS file: /usr/cvs/src/lib/libc/db/hash/hash.c,v retrieving revision 1.8 diff -c -r1.8 hash.c *** hash/hash.c 27 Jan 2000 23:06:08 -0000 1.8 --- hash/hash.c 12 Sep 2002 22:28:26 -0000 *************** *** 311,316 **** --- 311,318 ---- if (stat(file, &statbuf)) return (NULL); hashp->BSIZE = statbuf.st_blksize; + if (hashp->BSIZE > 32768) + hashp->BSIZE = 32868; hashp->BSHIFT = __log2(hashp->BSIZE); } --------------0D69AD2D1777CA68B9DD36F0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message