summaryrefslogtreecommitdiffstats
path: root/fat.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash in checklostXiaogang Cui2015-10-071-2/+6
| | | | | | Fix crash in checklost , due to reuse pointer after free. Change-Id: Ieab784219f63a1c4fabf838c4819c9452b058a03
* Fix bug in writefat functionAmeya Thakur2015-10-071-1/+1
| | | | | | | The readfat call returns 1 in case of success and 0 in case of failure. writefat now correctly checks the return value of the call. Change-Id: I95d09ec347ac5f2f751bb40a046f2567a1694422
* Correct free size calculationxiaogang2015-10-071-16/+40
| | | | | | | | | When clearchain or trunc, move the fatcache to rb_free_root tree. This way writefat will generate correct FAT table. When clearchain or trunc, re-calculate the free sectors of filesystem. Change-Id: I3b480ab161db5777e6f948f780b6bdaf3ada9467
* Do not return error if there is no FAT after fresh formatrockiec2015-10-071-2/+6
| | | | | | | After format all clusters are free, so don't return error. This fixes fsck fail on clean FAT16 partitions. Change-Id: Ib21d000eaad1f84d6182c19cbb81cd3a1d069211
* Change algorithm of cluster chain organization.jianfeng2015-10-071-283/+491
| | | | | | | | | fsck_msdos will cause crash on low-memory device and 64GB FAT32 SD cards, so change algorithm of cluster chain organization and fix the issue that 64GB SDCARD can't be recognized. Change-Id: I7bcdd138ac76c7f83d9cf3a292b3a0ba8ac78efd
* Resolve conflicts from merge of b6ee08aa into gingerbread-plus-aospJason Chen2010-11-051-7/+36
|\ | | | | | | Change-Id: Iebd91e356bec8bec29e120aea9bb10bcf02bc356
| * Integrate Samsung fsck_msdos fixes, including problem seeking beyond 4 gigcm-7.1.0gingerbread-releasegingerbreadgb-release-7.2d.moskvitin@samsung.com2010-11-051-7/+23
| | | | | | | | | | Change-Id: I8829a3a2c26625d7405fa0a43da1640ea5c9ffbc Signed-off-by: Mike Lockwood <lockwood@google.com>
* | Fix an out of boundary access in fat.cEthan2010-07-211-10/+12
|/ | | | | | | | | | | | From SD Specifications Part2 - File System For Next Free Cluster, value FFFFFFFFh indicates that there exists no information about the first available (free) cluster. It is a valid value. However fat.c doesn't check the value before use it as array index. This will cause fsck_msdos coredump with some micro sd cards Change-Id: Ibdec1655399d95c3ca98a4f4aaed1fd9bf459f33 Signed-off-by: Ethan <ethan.too@gmail.com>
* fsck_msdos: Instead of bailing out when we can't reconnect a lost cluster ↵San Mehat2009-07-161-2/+8
| | | | | | | | chain, clear it. Also, use exit code 4 when the FS has been modified in someway. Signed-off-by: San Mehat <san@google.com>
* fsck_msdos: Don't bail out when there are FAT differences - auto-correctSan Mehat2009-07-101-8/+8
| | | | Signed-off-by: San Mehat <san@google.com>
* fsck_msdos: Initial checkinSan Mehat2009-06-251-0/+705
Signed-off-by: San Mehat <san@google.com>