From 706de5ae51e04c761f2b51ce3dff6071bc31b7d8 Mon Sep 17 00:00:00 2001 From: hrs Date: Thu, 9 Oct 2014 23:43:13 +0000 Subject: [PATCH] MFC r271411: 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. git-svn-id: svn://svn.freebsd.org/base/stable/10@272867 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/dump/traverse.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 8258f079c..8a9a378df 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; } -- 2.45.0