summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2013-04-03 19:26:32 +0000
committermckusick <mckusick@FreeBSD.org>2013-04-03 19:26:32 +0000
commit3efd867bfd8807800a7160e66608bc752c92ed1d (patch)
treec2ff6881f546b4bd9c0df7086d8a3a66c7bfddbd /sys/ufs
parente241794c89cea9f7550619f5f3e167a6447455ab (diff)
downloadFreeBSD-src-3efd867bfd8807800a7160e66608bc752c92ed1d.zip
FreeBSD-src-3efd867bfd8807800a7160e66608bc752c92ed1d.tar.gz
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 MFC after: 2 weeks
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index e39fd46..3cff800 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -13022,9 +13022,9 @@ clear_remove(void)
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))
@@ -13085,9 +13085,9 @@ clear_inodedeps(void)
* 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;
OpenPOWER on IntegriCloud