summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fsck_msdos: fatcache: Fix implicit declarationsHEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kstable/cm-13.0-ZNH0Ecm-14.0cm-13.0Brandon McAnsh2015-10-101-0/+1
| | | | | Change-Id: I4ab603aa97b5a4ea4bdda22bc2c2b31a09d7f1e8 Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>
* fsck_msdos: Link against liblogEthan Chen2015-10-071-1/+1
| | | | | | * fsck_msdos requires __android_log_buf_print symbol Change-Id: I3e423825246d3ad192bf47a3d716092904d7df43
* fsck_msdos: Static-ifySteve Kondik2015-10-074-8/+28
| | | | | | * Split out main() and libraryify so we can use in recovery. Change-Id: I1b35d7f52f536145c3c465030391f86100fa2ac0
* external: fsck_msdos: fix pointer truncation issue of 64bitXiaogang Cui2015-10-073-12/+18
| | | | | | | fix the pointer truncation issue of 64bit when porting from 32bit which cause segment fault. Change-Id: I2bc1fdbc4308de60d4e80ec65bf1b603198ae87f
* fsck_msdos: set limitation to reduce the time in extreme caseXiaogang Cui2015-10-071-0/+20
| | | | | | | | | In some particular SD card, Most of the clusters are discrete. It will take a long time to manage the runtime memory and cluster. Set a max limitation here to limit the whole time, otherwise it will take too much time and a bad user experience. Change-Id: I3212f52e19c9b2c888120ada9f9ce46d7ef37d58
* Fix removing file which use last cluster of 4GBytesXiaogang Cui2015-10-071-10/+25
| | | | | | | | | | | | | The FAT file system limit the file size to 4GBytes. Physical size is how much space in storage the file use, sometimes, we create a file which size is 10 Bytes. But it use 4KB space in disk. fsck_msdos use "int" type to calculate physical size of a file. If a file use last cluster of 4GBytes, 4GB - 1 etc. Then the physical size will overflow, and fsck_msdos treate the size as 0 byte. Change-Id: Ie76f2b8e0cbb510fa9d33c6a8543e6cded6bd347
* 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-075-28/+84
| | | | | | | | | 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 overwrite next cluster number in FAT tablexiaogang2015-10-071-1/+1
| | | | | | Cluster numbers are keept packed: 1 cluster = 3 bytes. Change-Id: Ie7f4220fdf1ea7d2389bb0eb9fa1ad6aea0ce19b
* Add description for each functionrockiec2015-10-071-11/+79
| | | | | | Add functions comment header. Change-Id: Ic4b476883c916aea59c48bf7533398974089985d
* Do not return error if searched cluster is before FAT cache headrockiec2015-10-071-4/+1
| | | | | | Clusters are keep unsorted, so this is expected behaviour Change-Id: I9e2feebd7726ab520238c16e4d58f0d2765cf58b
* Enable files with invalid end cluster to be deletedrockiec2015-10-071-4/+7
| | | | | | This allow use to remove some damaged files Change-Id: If7d2ef06a6f47298cd7be48982a78d25c5be8231
* 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-0714-455/+2059
| | | | | | | | | 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
* am b94f2b61: Merge "Detect exFAT filesystems and abort if found"Jean-Baptiste Queru2013-07-080-0/+0
|\ | | | | | | | | * commit 'b94f2b6107f2adfd635fbec55ce6105687eb68b3': Detect exFAT filesystems and abort if found
| * Merge "Detect exFAT filesystems and abort if found"Jean-Baptiste Queru2013-07-081-0/+19
| |\
| | * Detect exFAT filesystems and abort if foundKen Sumrall2013-07-081-0/+19
| |/ | | | | | | | | | | | | | | | | | | If fsck_msdos tries to fix an exFAT filesystem, it will damage it and it won't be mountable on systems that support exFAT. So just abort if the OEM name field is "EXFAT" or an invalid FAT32 Extended BIOS Parameter Block is detected. The test to detect an invalid BIOS Parameter Block was developed by Sony. Change-Id: I09e8457e399239e840c825b858a635a7d9462def
* / Detect exFAT filesystems and abort if foundKen Sumrall2013-06-261-0/+19
|/ | | | | | | | | | If fsck_msdos tries to fix an exFAT filesystem, it will damage it and it won't be mountable on systems that support exFAT. So just abort if the OEM name field is "EXFAT" or an invalid FAT32 Extended BIOS Parameter Block is detected. The test to detect an invalid BIOS Parameter Block was developed by Sony. Change-Id: I09e8457e399239e840c825b858a635a7d9462def
* Merge "Detect and handle invalid number of FATs"Jean-Baptiste Queru2012-05-291-0/+4
|\
| * Detect and handle invalid number of FATsSebastian Rasmussen2012-05-291-0/+4
|/ | | | | | | | | If the number of FATs field in the boot sector is zero, give an appropriate error code. Change-Id: I56545fb322a9d4c94aea8ddbd4879701617100e4 Signed-off-by: Sebastian Rasmussen <sebastian.rasmussen@stericsson.com> Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
* Merge "Fix division-by-zero when reading partition tables"Jean-Baptiste Queru2012-05-291-6/+11
|\
| * Fix division-by-zero when reading partition tablesSebastian Rasmussen2012-05-071-6/+11
|/ | | | | | | | | | | | | When fsck_msdos was asked to analyze a device that contained a partition table in its first sector fsck_msdos was doing a division-by-zero because of mostly zeroed out fields. This fix postpones the division until it is necessary, while other tests already present detect the zeroed out fields and so fsck_msdos fails in a controlled fashion. Change-Id: Id2274b140449f4470f95a0215277f2f2de4cb7b0 Signed-off-by: Sebastian Rasmussen <sebastian.rasmussen@stericsson.com> Signed-off-by: christian bejram <christian.bejram@stericsson.com>
* Merge "fix possible memory leaking"Jean-Baptiste Queru2012-01-241-0/+2
|\
| * fix possible memory leakingrobert_ch_chou2011-06-041-0/+2
| | | | | | | | Change-Id: Ia10d4d15ca662edadfcd83491d5f2cab19669fef
* | Remove the simulator target from all makefiles.Jeff Brown2011-07-111-4/+0
|/ | | | | | Bug: 5010576 Change-Id: I0d523c2e62cb61d2305c5bf20733bcbeb41dfa89
* Resolve conflicts from merge of b6ee08aa into gingerbread-plus-aospJason Chen2010-11-052-22/+169
|\ | | | | | | 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-052-22/+156
| | | | | | | | | | 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>
* Add an empty CleanSpec.mkJean-Baptiste Queru2010-03-081-0/+49
| | | | Change-Id: I97b762bb479d213c8596a34a361dae1456cbeeac
* reconcile main tree with open-source eclairThe Android Open Source Project2010-02-050-0/+0
|\
| * reconcile android-2.1_r1 snapshotThe Android Open Source Project2010-01-290-0/+0
|/|
| * android-2.1_r1 snapshotThe Android Open Source Project2010-01-120-0/+0
| |
* | am c8303378: Add missing license-related filesJean-Baptiste Queru2009-08-262-0/+99
|\| | | | | | | | | | | | | Merge commit 'c8303378f40f96f75c5c353a776fe22e5e6a8fb5' into eclair * commit 'c8303378f40f96f75c5c353a776fe22e5e6a8fb5': Add missing license-related files
| * Add missing license-related filesJean-Baptiste Queru2009-08-262-0/+99
| | | | | | | | BUG=1573996
* | am 4d6d6f8a: fix the issue that variable lfcl in dir.c get enormous value.Shengzhe Zhao2009-08-070-0/+0
|\| | | | | | | | | | | | | Merge commit '4d6d6f8a3674ad67f970e2ae908d34f64e4854cf' * commit '4d6d6f8a3674ad67f970e2ae908d34f64e4854cf': fix the issue that variable lfcl in dir.c get enormous value.
| * fix the issue that variable lfcl in dir.c get enormous value.Shengzhe Zhao2009-08-071-0/+1
| | | | | | | | | | Signed-off-by: Shengzhe Zhao <a18689@motorola.com> Signed-off-by: San Mehat <san@google.com>
* | fix the issue that variable lfcl in dir.c get enormous value.Shengzhe Zhao2009-08-071-0/+1
|/ | | | | Signed-off-by: Shengzhe Zhao <a18689@motorola.com> Signed-off-by: San Mehat <san@google.com>
* fsck_vfat: Lower fat size compare limit from 8192k -> 4096kSan Mehat2009-07-161-2/+4
| | | | Signed-off-by: San Mehat <san@google.com>
* fsck_msdos: Instead of bailing out when we can't reconnect a lost cluster ↵San Mehat2009-07-162-8/+27
| | | | | | | | 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-102-9/+9
| | | | Signed-off-by: San Mehat <san@google.com>
* fsck_msdos: Don't bail out when we find a FAT32 bootblock miscompare.San Mehat2009-06-271-6/+28
| | | | | | Some factory formatted sdcards seem to have a garbage backup block. Signed-off-by: San Mehat <san@google.com>
* msdos_fsck: Don't bail out from the check if readboot() returns !FSFATALSan Mehat2009-06-251-1/+1
| | | | Signed-off-by: San Mehat <san@google.com>
* fsck_msdos: Initial checkinSan Mehat2009-06-259-0/+2657
| | | | Signed-off-by: San Mehat <san@google.com>
* new project, first commitThe Android Open Source Project2009-06-250-0/+0