summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-02-17 08:51:49 +0000
committertjr <tjr@FreeBSD.org>2004-02-17 08:51:49 +0000
commite426f6c0bc27c74a12298323ed13254ab51304e0 (patch)
tree1d0a1e68ee4cb16ae396b3067ec41daa18fc04c3
parent55590093d9518557a8233c2e404cde2205c920b3 (diff)
downloadFreeBSD-src-e426f6c0bc27c74a12298323ed13254ab51304e0.zip
FreeBSD-src-e426f6c0bc27c74a12298323ed13254ab51304e0.tar.gz
If the "next free cluster" field of the FSInfo block is 0xFFFFFFFF,
it means that the correct value is unknown. Since this value is just a hint to improve performance, initially assume that the first non-reserved cluster is free, then correct this assumption if necessary before writing the FSInfo block back to disk. PR: 62826 MFC after: 2 weeks
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index edcdd2e..be56bfc 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -561,9 +561,11 @@ mountmsdosfs(devvp, mp, td, argp)
if (!bcmp(fp->fsisig1, "RRaA", 4)
&& !bcmp(fp->fsisig2, "rrAa", 4)
&& !bcmp(fp->fsisig3, "\0\0\125\252", 4)
- && !bcmp(fp->fsisig4, "\0\0\125\252", 4))
+ && !bcmp(fp->fsisig4, "\0\0\125\252", 4)) {
pmp->pm_nxtfree = getulong(fp->fsinxtfree);
- else
+ if (pmp->pm_nxtfree == 0xffffffff)
+ pmp->pm_nxtfree = CLUST_FIRST;
+ } else
pmp->pm_fsinfo = 0;
brelse(bp);
bp = NULL;
OpenPOWER on IntegriCloud