From owner-cvs-all Mon Mar 11 11:13:27 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 31F1F37B404; Mon, 11 Mar 2002 11:13:22 -0800 (PST) Received: (from iedowse@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2BJDMs78114; Mon, 11 Mar 2002 11:13:22 -0800 (PST) (envelope-from iedowse) Message-Id: <200203111913.g2BJDMs78114@freefall.freebsd.org> From: Ian Dowse Date: Mon, 11 Mar 2002 11:13:22 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/ufs/ufs ufs_dirhash.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG iedowse 2002/03/11 11:13:22 PST Modified files: sys/ufs/ufs ufs_dirhash.c Log: Fix a bug in ufsdirhash_adjfree() that caused it to incorrectly update the free-space statistics in some cases. The problem affected directory blocks when the free space dropped below the size of the maximum allowed entry size. When this happened, the free-space summary information could claim that there are no further blocks that can fit a maximum-size entry, even if there are. The effect of this bug is that the directory may be enlarged even though there is space within the directory for the new entry. This wastes disk space and has a negative impact on performance. Fix it by correctly computing the dh_firstfree array index, adding a helper macro for clarity. Put an extra sanity check into ufsdirhash_checkblock() to detect the situation in future. Found by: dwmalone Reviewed by: dwmalone MFC after: 1 week Revision Changes Path 1.8 +7 -10 src/sys/ufs/ufs/ufs_dirhash.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message