diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2013-07-12 18:52:33 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2013-07-12 18:52:33 +0000 |
commit | 2aea094f6552685e6d7b11828c52ad91616e8ca9 (patch) | |
tree | ba8b1629db12fc74eab665c00276f87a49b252a1 /sys/ufs/ffs/ffs_snapshot.c | |
parent | 008ac71e0a8c1738cb6b636740aefd567b77f1b8 (diff) | |
download | src-2aea094f6552685e6d7b11828c52ad91616e8ca9.tar.gz src-2aea094f6552685e6d7b11828c52ad91616e8ca9.zip |
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
Notes
Notes:
svn path=/head/; revision=253280
Diffstat (limited to 'sys/ufs/ffs/ffs_snapshot.c')
-rw-r--r-- | sys/ufs/ffs/ffs_snapshot.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index ad157aa7bc1e..c37706b96f41 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -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); } /* |