Fix an error in dumping large sparse files containing extended attributes.

This commit is contained in:
mckusick 2007-02-27 07:28:17 +00:00
parent b7672bad26
commit 325fee4370

View File

@ -688,7 +688,7 @@ ufs2_blksout(union dinode *dp, ufs2_daddr_t *blkp, int frags, ino_t ino,
else
spcl.c_addr[j - i] = 0;
spcl.c_count = count - i;
if (last && !writingextdata)
if (last && count == blks && !writingextdata)
added = appendextdata(dp);
writeheader(ino);
bp = &blkp[i / tbperdb];
@ -701,7 +701,7 @@ ufs2_blksout(union dinode *dp, ufs2_daddr_t *blkp, int frags, ino_t ino,
}
spcl.c_type = TS_ADDR;
spcl.c_count = 0;
if (last && !writingextdata) {
if (last && count == blks && !writingextdata) {
writingextdata = 1;
writeextdata(dp, ino, added);
writingextdata = 0;