summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2000-01-17 06:35:11 +0000
committermckusick <mckusick@FreeBSD.org>2000-01-17 06:35:11 +0000
commitc6b837370821a24c417a02795813a1bf26e1246b (patch)
tree03517a0082e25e117ba8f02a0950755c6552a619 /sys/contrib
parente7e567fb65e813dd1bbcca85b976d0ce2e6804b8 (diff)
downloadFreeBSD-src-c6b837370821a24c417a02795813a1bf26e1246b.zip
FreeBSD-src-c6b837370821a24c417a02795813a1bf26e1246b.tar.gz
Better bounding on softdep_flushfiles; other minor tweeks to checks.
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/softupdates/ffs_softdep.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/contrib/softupdates/ffs_softdep.c b/sys/contrib/softupdates/ffs_softdep.c
index 5b4face..dfd7a11 100644
--- a/sys/contrib/softupdates/ffs_softdep.c
+++ b/sys/contrib/softupdates/ffs_softdep.c
@@ -52,7 +52,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)ffs_softdep.c 9.53 (McKusick) 1/16/00
+ * from: @(#)ffs_softdep.c 9.54 (McKusick) 1/16/00
* $FreeBSD$
*/
@@ -680,8 +680,9 @@ softdep_flushfiles(oldmnt, flags, p)
* but we give it a few extra just to be sure.
*/
devvp = VFSTOUFS(oldmnt)->um_devvp;
- for (loopcnt = 10; loopcnt > 0; loopcnt--) {
+ for (loopcnt = 10; loopcnt > 0; ) {
if (softdep_process_worklist(oldmnt) == 0) {
+ loopcnt--;
/*
* Do another flush in case any vnodes were brought in
* as part of the cleanup operations.
@@ -1771,7 +1772,9 @@ deallocate_dependencies(bp, inodedep)
dirrem = LIST_NEXT(dirrem, dm_next)) {
LIST_REMOVE(dirrem, dm_next);
dirrem->dm_dirinum = pagedep->pd_ino;
- if (inodedep == NULL)
+ if (inodedep == NULL ||
+ (inodedep->id_state & ALLCOMPLETE) ==
+ ALLCOMPLETE)
add_to_worklist(&dirrem->dm_list);
else
WORKLIST_INSERT(&inodedep->id_bufwait,
@@ -3589,10 +3592,9 @@ softdep_update_inodeblock(ip, bp, waitfor)
* to track.
*/
ACQUIRE_LOCK(&lk);
- if (ip->i_effnlink != ip->i_nlink) {
- (void) inodedep_lookup(ip->i_fs, ip->i_number, DEPALLOC,
- &inodedep);
- } else if (inodedep_lookup(ip->i_fs, ip->i_number, 0, &inodedep) == 0) {
+ if (inodedep_lookup(ip->i_fs, ip->i_number, 0, &inodedep) == 0) {
+ if (ip->i_effnlink != ip->i_nlink)
+ panic("softdep_update_inodeblock: bad link count");
FREE_LOCK(&lk);
return;
}
OpenPOWER on IntegriCloud