In mapdirs(), do not use the `dp' inode pointer after searchdir()

has been called, since it points to a shared inode buffer that may
be overwritten. The two cases where `dp' was used incorrectly appear
to have been overlooked when "nodump" inheritance was first added
in revision 1.12.

This is reported to correct propagation of the nodump flag on
directories that are larger than one block in size.

PR:		bin/58912
Submitted by:	Volker Paepcke <vpaepcke@incore.de>
MFC after:	1 week
This commit is contained in:
Ian Dowse 2003-11-04 14:20:14 +00:00
parent 4835e2c745
commit 155ea0634c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122060

View File

@ -274,8 +274,8 @@ mapdirs(ino_t maxino, long *tapesize)
for (ret = 0, i = 0; filesize > 0 && i < NDADDR; i++) {
if (DIP(&di, di_db[i]) != 0)
ret |= searchdir(ino, DIP(&di, di_db[i]),
(long)sblksize(sblock, DIP(dp, di_size), i),
filesize, tapesize, nodump);
(long)sblksize(sblock, DIP(&di, di_size),
i), filesize, tapesize, nodump);
if (ret & HASDUMPEDFILE)
filesize = 0;
else
@ -289,7 +289,7 @@ mapdirs(ino_t maxino, long *tapesize)
}
if (ret & HASDUMPEDFILE) {
SETINO(ino, dumpinomap);
*tapesize += blockest(dp);
*tapesize += blockest(&di);
change = 1;
continue;
}