From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 18 00:14:51 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CEA1A905; Thu, 18 Apr 2013 00:14:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BFD9EF23; Thu, 18 Apr 2013 00:14:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I0EpcF015861; Thu, 18 Apr 2013 00:14:51 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I0EpPG015860; Thu, 18 Apr 2013 00:14:51 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304180014.r3I0EpPG015860@svn.freebsd.org> From: Kirk McKusick Date: Thu, 18 Apr 2013 00:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249598 - stable/8/sys/ufs/ffs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 00:14:51 -0000 Author: mckusick Date: Thu Apr 18 00:14:51 2013 New Revision: 249598 URL: http://svnweb.freebsd.org/changeset/base/249598 Log: MFC of 249064: The code in clear_remove() and clear_inodedeps() skips one entry in the pagedep and inodedep hash tables. An entry in the table is skipped because 'pagedep_hash' and 'inodedep_hash' hold the size of the hash tables - 1. The chance that this would have any operational failure is extremely unlikely. These funtions only need to find a single entry and are only called when there are too many entries. The chance that they would fail because all the entries are on the single skipped hash chain are remote. Submitted by: Pedro Martelletto Reviewed by: kib Modified: stable/8/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/ufs/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_softdep.c Thu Apr 18 00:12:32 2013 (r249597) +++ stable/8/sys/ufs/ffs/ffs_softdep.c Thu Apr 18 00:14:51 2013 (r249598) @@ -5965,9 +5965,9 @@ clear_remove(td) mtx_assert(&lk, MA_OWNED); - for (cnt = 0; cnt < pagedep_hash; cnt++) { + for (cnt = 0; cnt <= pagedep_hash; cnt++) { pagedephd = &pagedep_hashtbl[next++]; - if (next >= pagedep_hash) + if (next > pagedep_hash) next = 0; LIST_FOREACH(pagedep, pagedephd, pd_hash) { if (LIST_EMPTY(&pagedep->pd_dirremhd)) @@ -6029,9 +6029,9 @@ clear_inodedeps(td) * We will then gather up all the inodes in its block * that have dependencies and flush them out. */ - for (cnt = 0; cnt < inodedep_hash; cnt++) { + for (cnt = 0; cnt <= inodedep_hash; cnt++) { inodedephd = &inodedep_hashtbl[next++]; - if (next >= inodedep_hash) + if (next > inodedep_hash) next = 0; if ((inodedep = LIST_FIRST(inodedephd)) != NULL) break;