From 08cd0ead43d723a7735bd3ea281c20c8fb381579 Mon Sep 17 00:00:00 2001 From: hrs Date: Wed, 10 Sep 2014 22:37:20 +0000 Subject: 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 --- sbin/dump/traverse.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sbin') 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; } -- cgit v1.1