summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_msdosfs/fat.c
Commit message (Collapse)AuthorAgeFilesLines
* msdosfs: Assorted fixes from other BSDs.pfg2014-07-141-12/+29
| | | | | | | | | | | | | | When truncating cluster chains fix the length of the cluster head. http://marc.info/?t=140304310700005&r=1&w=2 Avoid infinite loops in cluster chain linked lists. http://marc.info/?l=openbsd-tech&m=140275150804337&w=2 Avoid off-by-one on FAT12 filesystems. http://marc.info/?l=openbsd-tech&m=140234174104724&w=2 Obtained from: NetBSD (from OpenBSD) MFC after: 1 week
* fsck_msdosfs: be a bit more permissivepfg2014-07-141-5/+6
| | | | | | | | | | | | | | The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. This fixes a bug found in NetBSD. It must be noted that we never supported all the checks that NetBSD does as some of them would cause failures with a freshly created FAT32 from MS-Windows. While here, bring some space fixes. Obtained from: NetBSD (rev. 1.22) MFC after: 3 days
* Make fsck and fsck_msdosfs WARNS=6 cleanuqs2012-10-211-1/+1
| | | | | | | | | - sprinkle const - add volatile qualifier to avoid vfork clobbering Inspired by: NetBSD PR: bin/139802 Reviewed by: ed
* sbin/fsck: s/perror/perr/ to avoid shadowinguqs2012-10-211-16/+18
| | | | | | | | | - rename some other vars too - merge NetBSD license changes Obtained from: NetBSD PR: bin/139802 Reviewed by: ed
* Fix some style(9), although there's a lot more issues here.brian2010-06-201-1/+2
| | | | | | | | | Fix some casting errors. PR: 142384 Submitted by: giffunip at tutopia dot com Obtained from: NetBSD MFC after: 3 weeks
* Rename fields to match better the msdosfs headers. This work is stillkib2010-02-141-18/+18
| | | | | | | | | incomplete as some info doesn't really belong to the structs where it is defined. Submitted by: Pedro F. Giffuni <giffunip tutopia com> Reviewed by: bde MFC after: 2 weeks
* Bug fixes from NetBSDkib2010-02-141-32/+27
| | | | | | | | | | | - fix sign-compare issues. - ANSIfy a couple of functions. - Remove more duplicate #includes. - Memory leak found by Coverity on NetBSD. Submitted by: Pedro F. Giffuni <giffunip tutopia com> Reviewed by: bde MFC after: 2 weeks
* License changes from NetBSD.kib2010-02-141-7/+0
| | | | | | | Move to 2 clause license, approved by Wolfgang Solfrank. Submitted by: Pedro F. Giffuni <giffunip tutopia com> MFC after: 2 weeks
* Spot two more bugs WRT adherence to the local prompt style.yar2008-01-311-2/+2
|
* Use consistent style in user prompts: the question is in a new lineyar2008-01-311-4/+4
| | | | | | | and begins with a capital letter. The rest of pwarn/ask pairs here follows this style. Requested by: bde
* Fixed some bugs in checkdirty(). The check for the clean bit wasbde2004-02-051-9/+27
| | | | | | | | | | | | | | | | | | | combined with the the signature check in a wrong way (basically (dirty:= signature_recognised() && !clean) instead of (mightbedirty:= !signature_recognized || !clean), so file systems with unrecognized signatures were considered clean. Many of the don't-care and reserved bits were not ignored, so some file systems with valid signatures were unrecognized. One of my FAT32 file systems has a signature of f8,ff,ff,ff,ff,ff,ff,f7 when dirty, but only f8,ff,ff,0f,ff,ff,ff,07 was recognised as dirty for FAT32, so the fail-unsafeness made my file system always considered clean. Check the i/o non-error bit in checkdirty(). Its absence would give an unrecognized signature in code that is unaware of it, but we now mask it out of the signature so we have to check it explicitly. This combines naturally with the check of the clean bit. Reviewed by: rnordier (except for final details)
* Document the dirty flag and other bits in the first 2 FAT entriesbde2004-02-051-0/+18
| | | | | | | | | | | | better. There is a related I/O error flag which we don't support in the kernel but must support here. (Support for bits that we don't understand here is mostly automatic by fail-safeness, but checkdirty() has fail-unsafeness.) There are some reserved and don't-care bits that weren't fully documented and aren't always masked properly. The comment about the bits in readfat() will be removed when the masking is fixed. Submitted by: rnordier
* Prepare to fix checkdirty() by moving it from check.c to fat.c. It isbde2004-02-051-0/+43
| | | | | identical to a subset of readfat(), so it belongs near readfat() if not in it.
* s/filesystem/file system/g as discussed on -developerstrhodes2002-08-211-1/+1
|
* o __P removedimp2002-03-201-52/+16
| | | | | | | o ansi function prototypes o unifdef -D__STDC__ o __dead2 on usage prototype o remove now-bogus main prototype
* Add fsck_msdosfs.obrien2001-07-091-0/+659
Obtained from: NetBSD
OpenPOWER on IntegriCloud