Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2013 18:52:33 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253280 - head/sys/ufs/ffs
Message-ID:  <201307121852.r6CIqXGg009824@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Jul 12 18:52:33 2013
New Revision: 253280
URL: http://svnweb.freebsd.org/changeset/base/253280

Log:
  Only copy as much bytes as there in superblock, instead of the full
  block copy, when copying the superblock into the snapshot.  UFS1 does
  not align superblock on the block boundary, and bcopy runs off the end
  of the buffer.
  
  Reported by:	Andre Albsmeier <Andre.Albsmeier@siemens.com>
  Reviewed by:	mckusick
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/ufs/ffs/ffs_snapshot.c

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==============================================================================
--- head/sys/ufs/ffs/ffs_snapshot.c	Fri Jul 12 18:13:41 2013	(r253279)
+++ head/sys/ufs/ffs/ffs_snapshot.c	Fri Jul 12 18:52:33 2013	(r253280)
@@ -792,7 +792,7 @@ out1:
 		brelse(nbp);
 	} else {
 		loc = blkoff(fs, fs->fs_sblockloc);
-		bcopy((char *)copy_fs, &nbp->b_data[loc], fs->fs_bsize);
+		bcopy((char *)copy_fs, &nbp->b_data[loc], (u_int)fs->fs_sbsize);
 		bawrite(nbp);
 	}
 	/*



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