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;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to