diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index e39fd465529a..3cff800d35a4 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;