From owner-svn-src-head@FreeBSD.ORG Fri Jul 12 18:52:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 98B1AA35; Fri, 12 Jul 2013 18:52:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B18818C4; Fri, 12 Jul 2013 18:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CIqXgf009825; Fri, 12 Jul 2013 18:52:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CIqXGg009824; Fri, 12 Jul 2013 18:52:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307121852.r6CIqXGg009824@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 12 Jul 2013 18:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253280 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 18:52:33 -0000 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 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); } /*