From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 18:12:02 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11D411065670; Wed, 17 Dec 2008 18:12:02 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F13EA8FC19; Wed, 17 Dec 2008 18:12:01 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBHIC1DU011363; Wed, 17 Dec 2008 18:12:01 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBHIC17u011360; Wed, 17 Dec 2008 18:12:01 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812171812.mBHIC17u011360@svn.freebsd.org> From: Doug Rabson Date: Wed, 17 Dec 2008 18:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186243 - in head/sys/boot: i386/gptzfsboot i386/zfsboot zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 18:12:02 -0000 Author: dfr Date: Wed Dec 17 18:12:01 2008 New Revision: 186243 URL: http://svn.freebsd.org/changeset/base/186243 Log: Use full 64bit arithmetic when converting file offsets to block numbers - fixes booting on filesystems with inode numbers with values above 4194304. Submitted by: ps Modified: head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Wed Dec 17 18:05:30 2008 (r186242) +++ head/sys/boot/i386/gptzfsboot/Makefile Wed Dec 17 18:12:01 2008 (r186243) @@ -60,7 +60,7 @@ gptzfsboot.bin: gptzfsboot.out objcopy -S -O binary gptzfsboot.out ${.TARGET} gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o - ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Wed Dec 17 18:05:30 2008 (r186242) +++ head/sys/boot/i386/zfsboot/Makefile Wed Dec 17 18:12:01 2008 (r186243) @@ -80,7 +80,7 @@ zfsboot.bin: zfsboot.out objcopy -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o - ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} zfsboot.o: zfsboot.s Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Wed Dec 17 18:05:30 2008 (r186242) +++ head/sys/boot/zfs/zfsimpl.c Wed Dec 17 18:12:01 2008 (r186243) @@ -873,17 +873,12 @@ dnode_read(spa_t *spa, const dnode_phys_ int i, rc; /* - * We truncate the offset to 32bits, mainly so that I don't - * have to find a copy of __divdi3 to put into the bootstrap. - * I don't think the bootstrap needs to access anything bigger - * than 2G anyway. Note that block addresses are still 64bit - * so it doesn't affect the possible size of the media. - * We still use 64bit block numbers so that the bitshifts - * work correctly. Note: bsize may not be a power of two here. + * Note: bsize may not be a power of two here so we need to do an + * actual divide rather than a bitshift. */ while (buflen > 0) { - uint64_t bn = ((int) offset) / bsize; - int boff = ((int) offset) % bsize; + uint64_t bn = offset / bsize; + int boff = offset % bsize; int ibn; const blkptr_t *indbp; blkptr_t bp;