Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ffs ffs_superblock_validate(): check the size of cyl...
details: https://anonhg.NetBSD.org/src/rev/6b7825156b7e
branches: trunk
changeset: 337746:6b7825156b7e
user: maxv <maxv%NetBSD.org@localhost>
date: Sun Apr 26 06:19:36 2015 +0000
description:
ffs_superblock_validate(): check the size of cylinder groups.
diffstat:
sys/ufs/ffs/ffs_vfsops.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (39 lines):
diff -r cbe7d1afe139 -r 6b7825156b7e sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c Sat Apr 25 23:55:23 2015 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c Sun Apr 26 06:19:36 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.329 2015/04/22 07:27:09 maxv Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.330 2015/04/26 06:19:36 maxv Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.329 2015/04/22 07:27:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.330 2015/04/26 06:19:36 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -899,7 +899,7 @@
ffs_superblock_validate(struct fs *fs)
{
int32_t i, fs_bshift = 0, fs_fshift = 0, fs_fragshift = 0, fs_frag;
- int32_t fs_inopb;
+ int32_t fs_inopb, fs_cgsize;
/* Check the superblock size */
if (fs->fs_sbsize > SBLOCKSIZE || fs->fs_sbsize < sizeof(struct fs))
@@ -980,6 +980,11 @@
if (fs->fs_frag != fs_frag)
return 0;
+ /* Check the size of cylinder groups */
+ fs_cgsize = ffs_fragroundup(fs, CGSIZE(fs));
+ if (fs->fs_cgsize != fs_cgsize)
+ return 0;
+
return 1;
}
Home |
Main Index |
Thread Index |
Old Index