mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Use the appropriate size when zeroing out the unused portion
of a snapshot's copy of a superblock. This patch fixes a panic when taking a snapshot of a 4096/512 filesystem. Reported by: Ian Freislich <ianf@za.uu.net> Sponsored by: DARPA & NAI Labs.
This commit is contained in:
parent
58251a8dc0
commit
34968037b1
1 changed files with 3 additions and 3 deletions
|
|
@ -352,9 +352,9 @@ restart:
|
|||
bcopy(fs, copy_fs, fs->fs_sbsize);
|
||||
if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) == 0)
|
||||
copy_fs->fs_clean = 1;
|
||||
if (fs->fs_sbsize < SBLOCKSIZE)
|
||||
bzero(&sbp->b_data[loc + fs->fs_sbsize],
|
||||
SBLOCKSIZE - fs->fs_sbsize);
|
||||
size = fs->fs_bsize < SBLOCKSIZE ? fs->fs_bsize : SBLOCKSIZE;
|
||||
if (fs->fs_sbsize < size)
|
||||
bzero(&sbp->b_data[loc + fs->fs_sbsize], size - fs->fs_sbsize);
|
||||
size = blkroundup(fs, fs->fs_cssize);
|
||||
if (fs->fs_contigsumsize > 0)
|
||||
size += fs->fs_ncg * sizeof(int32_t);
|
||||
|
|
|
|||
Loading…
Reference in a new issue