From owner-svn-src-head@FreeBSD.ORG Sun Jan 4 15:56:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B1B71065670; Sun, 4 Jan 2009 15:56:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19D888FC13; Sun, 4 Jan 2009 15:56:50 +0000 (UTC) (envelope-from kib@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 n04FunRm061147; Sun, 4 Jan 2009 15:56:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n04Funod061146; Sun, 4 Jan 2009 15:56:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901041556.n04Funod061146@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jan 2009 15:56:49 +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: r186740 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2009 15:56:50 -0000 Author: kib Date: Sun Jan 4 15:56:49 2009 New Revision: 186740 URL: http://svn.freebsd.org/changeset/base/186740 Log: Do not incorrectly add the low 5 bits of the offset to the resulting position of the found zero bit. Submitted by: Jaakko Heinonen MFC after: 2 weeks Modified: head/sys/gnu/fs/ext2fs/ext2_bitops.h Modified: head/sys/gnu/fs/ext2fs/ext2_bitops.h ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_bitops.h Sun Jan 4 15:49:30 2009 (r186739) +++ head/sys/gnu/fs/ext2fs/ext2_bitops.h Sun Jan 4 15:56:49 2009 (r186740) @@ -84,7 +84,7 @@ find_next_zero_bit(void *data, size_t sz mask = ~0U << (ofs & 31); bit = *p | ~mask; if (bit != ~0U) - return (ffs(~bit) + ofs - 1); + return (ffs(~bit) + (ofs & ~31U) - 1); p++; ofs = (ofs + 31U) & ~31U; }