When externding directory inode in ufs_direnter(), adjust i_endoff.

This change is formally not needed, since i_endoff not used in all
code paths after the call to ufs_direnter(), and i_endoff is
recalculated by the next lookup.  But having the value correct makes
the reasoning about code simpler.

Reported and tested by:	pho
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2016-09-08 12:07:25 +00:00
parent 6cb0fae25e
commit ea16af59a1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305597

View File

@ -908,6 +908,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename)
}
dp->i_size = dp->i_offset + DIRBLKSIZ;
DIP_SET(dp, i_size, dp->i_size);
dp->i_endoff = dp->i_size;
dp->i_flag |= IN_CHANGE | IN_UPDATE;
dirp->d_reclen = DIRBLKSIZ;
blkoff = dp->i_offset &