Fixed spacefree calculation in ext2_direnter(). This bug sometimes caused

panics.

This should be in 2.2, of course.

Submitted by:	davidg
Obtained from:	bouyer@antioche.ibp.fr (Manuel BOUYER) (fix for NetBSD)
This commit is contained in:
Bruce Evans 1996-11-08 19:06:34 +00:00
parent f886b4857a
commit 68a9989171
2 changed files with 2 additions and 2 deletions

View File

@ -856,7 +856,7 @@ ext2_direnter(ip, dvp, cnp)
/* overwrite; nothing there; header is ours */
spacefree += dsize;
}
dsize = EXT2_DIR_REC_LEN(ep->name_len);
dsize = EXT2_DIR_REC_LEN(nep->name_len);
spacefree += nep->rec_len - dsize;
loc += nep->rec_len;
bcopy((caddr_t)nep, (caddr_t)ep, dsize);

View File

@ -856,7 +856,7 @@ ext2_direnter(ip, dvp, cnp)
/* overwrite; nothing there; header is ours */
spacefree += dsize;
}
dsize = EXT2_DIR_REC_LEN(ep->name_len);
dsize = EXT2_DIR_REC_LEN(nep->name_len);
spacefree += nep->rec_len - dsize;
loc += nep->rec_len;
bcopy((caddr_t)nep, (caddr_t)ep, dsize);