aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/ext2fs/ext2_alloc.c
diff options
context:
space:
mode:
authorFedor Uporov <fsu@FreeBSD.org>2019-03-04 10:42:25 +0000
committerFedor Uporov <fsu@FreeBSD.org>2019-03-04 10:42:25 +0000
commit6e38bf94e5dae929958d4283a15a771c30aeab7a (patch)
tree04d01909c3cc73729a18607daebd9d3e4afabdde /sys/fs/ext2fs/ext2_alloc.c
parent647915ff208d298bf644d5aca9de7d78e7958a51 (diff)
downloadsrc-6e38bf94e5dae929958d4283a15a771c30aeab7a.tar.gz
src-6e38bf94e5dae929958d4283a15a771c30aeab7a.zip
Make superblock reading logic more strict.
Add more on-disk superblock consistency checks to ext2_compute_sb_data() function. It should decrease the probability of mounting filesystems with corrupted superblock data. Reviewed by: pfg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19322
Notes
Notes: svn path=/head/; revision=344751
Diffstat (limited to 'sys/fs/ext2fs/ext2_alloc.c')
-rw-r--r--sys/fs/ext2fs/ext2_alloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/fs/ext2fs/ext2_alloc.c b/sys/fs/ext2fs/ext2_alloc.c
index 7d1cb67218c8..24cbc5f9dd51 100644
--- a/sys/fs/ext2fs/ext2_alloc.c
+++ b/sys/fs/ext2fs/ext2_alloc.c
@@ -457,7 +457,7 @@ noinodes:
/*
* 64-bit compatible getters and setters for struct ext2_gd from ext2fs.h
*/
-static uint64_t
+uint64_t
e2fs_gd_get_b_bitmap(struct ext2_gd *gd)
{
@@ -465,7 +465,7 @@ e2fs_gd_get_b_bitmap(struct ext2_gd *gd)
gd->ext2bgd_b_bitmap);
}
-static uint64_t
+uint64_t
e2fs_gd_get_i_bitmap(struct ext2_gd *gd)
{
@@ -754,7 +754,7 @@ ext2_hashalloc(struct inode *ip, int cg, long pref, int size,
return (0);
}
-static unsigned long
+static uint64_t
ext2_cg_number_gdb_nometa(struct m_ext2fs *fs, int cg)
{
@@ -768,7 +768,7 @@ ext2_cg_number_gdb_nometa(struct m_ext2fs *fs, int cg)
EXT2_DESCS_PER_BLOCK(fs));
}
-static unsigned long
+static uint64_t
ext2_cg_number_gdb_meta(struct m_ext2fs *fs, int cg)
{
unsigned long metagroup;
@@ -784,7 +784,7 @@ ext2_cg_number_gdb_meta(struct m_ext2fs *fs, int cg)
return (0);
}
-static unsigned long
+uint64_t
ext2_cg_number_gdb(struct m_ext2fs *fs, int cg)
{
unsigned long first_meta_bg, metagroup;