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
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);
}