summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2002-08-22 22:17:11 +0000
committertrhodes <trhodes@FreeBSD.org>2002-08-22 22:17:11 +0000
commit463419831e6ea6e94c187b5adcce377713794e17 (patch)
tree8c773cfbe8df9d8f90e5c72908db508e443672e8 /sys/fs/msdosfs
parent4e87117d72c7b2dac15e0d266e10bab7f0ad8111 (diff)
downloadFreeBSD-src-463419831e6ea6e94c187b5adcce377713794e17.zip
FreeBSD-src-463419831e6ea6e94c187b5adcce377713794e17.tar.gz
Fix a bug where large msdos partitions were not handled correctly, and fix
a few fsck_msdosfs related 'issues' PR: 28536, 30168 Submitted by: Jiangyi Liu <jyliu@163.net> && NetBSD Approved by: rwatson (mentor)
Diffstat (limited to 'sys/fs/msdosfs')
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index f820b2a..cf68ec1 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -543,8 +543,14 @@ mountmsdosfs(devvp, mp, td, argp)
}
/*
- * Check and validate (or perhaps invalidate?) the fsinfo structure? XXX
+ * Check and validate (or perhaps invalidate?) the fsinfo structure?
*/
+ if (pmp->pm_fsinfo && pmp->pm_nxtfree > pmp->pm_maxcluster) {
+ printf("Next free cluster in FSInfo (%u) exceeds maxcluster (%u)\n",
+ pmp->pm_nxtfree, pmp->pm_maxcluster);
+ error = EINVAL;
+ goto error_exit;
+ }
/*
* Allocate memory for the bitmap of allocated clusters, and then
OpenPOWER on IntegriCloud