Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 22:37:20 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271411 - head/sbin/dump
Message-ID:  <201409102237.s8AMbKde012878@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Wed Sep 10 22:37:20 2014
New Revision: 271411
URL: http://svnweb.freebsd.org/changeset/base/271411

Log:
  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

Modified:
  head/sbin/dump/traverse.c

Modified: head/sbin/dump/traverse.c
==============================================================================
--- head/sbin/dump/traverse.c	Wed Sep 10 22:34:08 2014	(r271410)
+++ head/sbin/dump/traverse.c	Wed Sep 10 22:37:20 2014	(r271411)
@@ -673,7 +673,12 @@ ufs2_blksout(union dinode *dp, ufs2_dadd
 	 */
 	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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409102237.s8AMbKde012878>