diff options
author | hrs <hrs@FreeBSD.org> | 2014-09-10 22:37:20 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2014-09-10 22:37:20 +0000 |
commit | 08cd0ead43d723a7735bd3ea281c20c8fb381579 (patch) | |
tree | 766cbad50d51ede7b2db795bae6b363c2fb3ba40 /sbin/dump | |
parent | 3a5e9986076b0ba01721c639f18b17277d15b29e (diff) | |
download | FreeBSD-src-08cd0ead43d723a7735bd3ea281c20c8fb381579.zip FreeBSD-src-08cd0ead43d723a7735bd3ea281c20c8fb381579.tar.gz |
Fix a bug which could break extended attributes in a dump output.
This occurred when a file was >892kB long and had a large data (>1kB)
in the extended attributes.
Reported by: Masashi Toriumi
Reviewed by: mckusick
Diffstat (limited to 'sbin/dump')
-rw-r--r-- | sbin/dump/traverse.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 8258f07..8a9a378 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -673,7 +673,12 @@ ufs2_blksout(union dinode *dp, ufs2_daddr_t *blkp, int frags, ino_t ino, */ blks = howmany(frags * sblock->fs_fsize, TP_BSIZE); if (last) { - resid = howmany(fragoff(sblock, dp->dp2.di_size), TP_BSIZE); + if (writingextdata) + resid = howmany(fragoff(sblock, spcl.c_extsize), + TP_BSIZE); + else + resid = howmany(fragoff(sblock, dp->dp2.di_size), + TP_BSIZE); if (resid > 0) blks -= howmany(sblock->fs_fsize, TP_BSIZE) - resid; } |