summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
2012-01-05FAT: update the second FAT when writing a fileDonggeun Kim
After susccessful write to the FAT partition, fsck program may print warning message due to different FAT, provided that the filesystem supports two FATs. This patch makes the second FAT to be same with the first one when writing a file. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-01-05fs/fat: Improve error handlingKyle Moffett
The FAT filesystem fails silently in inexplicable ways when given a filesystem with a block-size that does not match the device sector size. In theory this is not an unsupportable combination but requires a major rewrite of a lot of the filesystem. Until that occurs, the filesystem should detect that scenario and display a helpful error message. This scenario in particular occurred on a 512-byte blocksize FAT fs stored in an El-Torito boot volume on a CD-ROM (2048-byte sector size). Additionally, in many circumstances the ->block_read method will not return a negative number to indicate an error but instead return 0 to indicate the number of blocks successfully read (IE: None). The FAT filesystem should defensively check to ensure that it got all of the sectors that it asked for when reading. Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
2012-01-05fs/fat: Fix FAT detection to support non-DOS partition tablesKyle Moffett
The FAT filesystem code currently ends up requiring that the partition table be a DOS MBR, as it checks for the DOS 0x55 0xAA signature on the partition table (which may be Mac, EFI, ISO9660, etc) before actually computing the partition offset. This fixes support for accessing a FAT filesystem in an ISO9660 boot volume (El-Torito format) by reordering the filesystem checks and reading the 0x55 0xAA "DOS boot signature" and FAT/FAT32 magic number from the first sector of the partition instead of from sector 0. Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com> Fix build warning: fat.c: In function 'fat_register_device': fat.c:66:15: warning: variable 'found_partition' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk <wd@denx.de>
2012-01-05ext2: Cache line align indirection buffersSimon Glass
Make ext2 use cache line aligned buffers for reading from the filesystem. This is needed when caches are enabled because unaligned cache invalidates are not safe. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-01-05fat: reset VFAT short alias checksum on first matchSergei Shtylyov
The VFAT short alias checksum read from a long file name is only overwritten when another long file name appears in a directory list. Until then it renders short file names invisible that have the same checksum. Reset the checksum on first match. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Martin Mueller <martin.mueller5@de.bosch.com>
2011-12-23Merge branch 'next' of ../nextWolfgang Denk
* 'next' of ../next: mkenvimage: Add version info switch (-V) mkenvimage: Fix getopt() error handling mkenvimage: Fix some typos phy: add Micrel KS8721BL phy definition net: introduce per device index mvgbe: remove setting of ethaddr within the driver x86: Add support for specifying an initrd with the zboot command x86: Refactor the zboot innards so they can be reused with a vboot image x86: Add infrastructure to extract an e820 table from the coreboot tables x86: Add support for booting Linux using the 32 bit boot protocol x86: Clean up the x86 zimage code in preparation to extend it x86: Import code from coreboot's libpayload to parse the coreboot table x86: Initial commit for running as a coreboot payload CHECKPATCH: ./board/esd/hh405/logo_320_240_8bpp.c CHECKPATCH: ./board/esd/hh405/logo_1024_768_8bpp.c CHECKPATCH: ./board/esd/hh405/logo_320_240_4bpp.c CHECKPATCH: ./board/esd/hh405/logo_640_480_24bpp.c CHECKPATCH: ./board/esd/apc405/logo_640_480_24bpp.c CHECKPATCH: ./board/esd/voh405/logo_320_240_4bpp.c CHECKPATCH: ./board/esd/voh405/logo_640_480_24bpp.c CHECKPATCH: ./board/esd/hh405/fpgadata.c CHECKPATCH: ./board/esd/pci405/fpgadata.c CHECKPATCH: ./board/esd/tasreg/fpgadata.c CHECKPATCH: ./board/esd/apc405/fpgadata.c CHECKPATCH: ./board/esd/voh405/fpgadata.c CHECKPATCH: ./board/esd/ash405/fpgadata.c CHECKPATCH: ./board/esd/dasa_sim/fpgadata.c CHECKPATCH: ./board/esd/ar405/fpgadata_xl30.c CHECKPATCH: ./board/esd/ar405/fpgadata.c CHECKPATCH: ./board/esd/plu405/fpgadata.c CHECKPATCH: ./board/esd/wuh405/fpgadata.c CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405.c CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405ab.c CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci4052.c CHECKPATCH: ./board/esd/canbt/fpgadata.c CHECKPATCH: ./board/esd/du405/fpgadata.c CHECKPATCH: ./board/esd/cpciiser4/fpgadata.c CHECKPATCH: ./board/dave/PPChameleonEVB/fpgadata.c avr32:mmu.c: fix printf() length modifier fat.c: fix printf() length modifier cmd_sf.c: fix printf() length modifier Make printf and vprintf safe from buffer overruns vsprintf: Move function documentation into header file Add safe vsnprintf and snprintf library functions Move vsprintf functions into their own header Conflicts: tools/mkenvimage.c Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-20FAT: fix some issues in FAT write support codeAnatolij Gustschin
Writing a file to the FAT partition didn't work while a test using a CF card. The test was done on mpc5200 based board (powerpc). There is a number of problems in FAT write code: Compiler warning: fat_write.c: In function 'file_fat_write': fat_write.c:326: warning: 'counter' may be used uninitialized in this function fat_write.c:326: note: 'counter' was declared here 'l_filename' string is not terminated, so a file name with garbage at the end is used as a file name as shown by debug code. Return value of set_contents() is not checked properly so actually a file won't be written at all (as checked using 'fatls' after a write attempt with 'fatwrite' command). do_fat_write() doesn't return the number of written bytes if no error happened. However the return value of this function is used to show the number of written bytes in do_fat_fswrite(). The patch adds some debug code and fixes above mentioned problems and also fixes a typo in error output. NOTE: after a successful write to the FAT partition (under U-Boot) the partition was checked under Linux using fsck. The partition needed fixing FATs: -bash-3.2# fsck -a /dev/sda1 fsck 1.39 (29-May-2006) dosfsck 2.11, 12 Mar 2005, FAT32, LFN FATs differ but appear to be intact. Using first FAT. Performing changes. Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Donggeun Kim <dg77.kim@samsung.com> Cc: Aaron Williams <Aaron.Williams@cavium.com> Acked-by: Donggeun Kim <dg77.kim@samsung.com>
2011-12-17fat.c: fix printf() length modifierAndreas Bießmann
The DIRENTSPERBLOCK utilizes sizeof() which will return a size_t which has no fixed size. Therefor use correct length modifer for printf() statement to prevent compiler warnings. This patch fixes following warning: ---8<--- fat.c: In function 'do_fat_read': fat.c:879: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int' --->8--- Signed-off-by: Andreas Bießmann <biessmann@corscience.de> cc: Mike Frysinger <vapier@gentoo.org> cc: Thomas Chou <thomas@wytron.com.tw> cc: rjones@nexus-tech.net cc: kharris@nexus-tech.net Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-12fs/reiserfs/reiserfs.c: Fix compiler warningAnatolij Gustschin
Fix: reiserfs.c: In function 'reiserfs_mount': reiserfs.c:360:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-12-10fs/yaffs2/yaffs_guts.c: Fix GCC 4.6 compile warning (and bug)Wolfgang Denk
Fix: yaffs_guts.c: In function 'yaffs_GarbageCollectBlock': yaffs_guts.c:2761:6: warning: variable 'retVal' set but not used [-Wunused-but-set-variable] Here GCC actually detected a bug. The code was always returning OK instead of the previously set retrun code. Fix that. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: William Juul <wiljuul@cisco.com> Cc: Scott Wood <scottwood@freescale.com> Acked-by: William Juul <wiljuul@cisco.com>
2011-11-16Fix warnings in yaffsSimon Glass
Sorry if this is already fixed somewhere - I could not find it. This fixes the warnings show below. yaffs_tagscompat.c: In function 'yaffs_TagsCompatabilityReadChunkWithTagsFromNAND': yaffs_tagscompat.c:151: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:150: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:149: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:148: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:147: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:146: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:145: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:144: warning: dereferencing pointer 'tu' does break strict-aliasing rules yaffs_tagscompat.c:141: note: initialized from here Signed-off-by: Simon Glass <sjg@chromium.org>
2011-11-16fs/yaffs2/yaffs_guts.c: Fix some GCC 4.6 warningsAnatolij Gustschin
Fix: yaffs_guts.c: In function 'yaffs_CheckChunkErased': yaffs_guts.c:854:6: warning: variable 'result' set but not used yaffs_guts.c: In function 'yaffs_UpdateObjectHeader': yaffs_guts.c:3463:6: warning: variable 'result' set but not used yaffs_guts.c: In function 'yaffs_GrabChunkCache': yaffs_guts.c:3774:6: warning: variable 'pushout' set but not used yaffs_guts.c: In function 'yaffs_Scan': yaffs_guts.c:5237:6: warning: variable 'result' set but not used yaffs_guts.c: In function 'yaffs_CheckObjectDetailsLoaded': yaffs_guts.c:5748:6: warning: variable 'alloc_failed' set but not used yaffs_guts.c:5747:6: warning: variable 'result' set but not used yaffs_guts.c: In function 'yaffs_ScanBackwards': yaffs_guts.c:5808:6: warning: variable 'deleted' set but not used yaffs_guts.c:5806:6: warning: variable 'result' set but not used yaffs_guts.c: In function 'yaffs_GetObjectName': yaffs_guts.c:6657:7: warning: variable 'result' set but not used [-Wunused-but-set-variable] Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-11-07fs/fat/fat.c: Fix GCC 4.6 build warningWolfgang Denk
Fix: fat.c: In function 'fat_register_device': fat.c:74:19: warning: variable 'info' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-10-27GCC4.6: Squash warnings in yaffs_guts.cMarek Vasut
yaffs_guts.c: In function 'yaffs_ReadDataFromFile': yaffs_guts.c:4461:8: warning: 'chunk' may be used uninitialized in this function yaffs_guts.c:4462:8: warning: 'start' may be used uninitialized in this function yaffs_guts.c: In function 'yaffs_WriteDataToFile': yaffs_guts.c:4581:8: warning: 'chunk' may be used uninitialized in this function yaffs_guts.c:4582:8: warning: 'start' may be used uninitialized in this function yaffs_guts.c: In function 'yaffs_ResizeFile': yaffs_guts.c:4816:8: warning: 'newSizeOfPartialChunk' may be used uninitialized in this function yaffs_guts.c:4817:8: warning: 'newFullChunks' may be used uninitialized in this function Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org> Cc: William Juul <william.juul@tandberg.com>
2011-10-27GCC4.6: Drop dead code from yaffs_guts.cMarek Vasut
Drop yaffs_DeleteWorker(): yaffs_guts.c:1556:12: warning: 'yaffs_DeleteWorker' defined but not used Drop yaffs_VerifyTnodeWorker(): yaffs_guts.c:600:12: warning: 'yaffs_VerifyTnodeWorker' defined but not used Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org>
2011-10-27fat: correct ATTR_VFAT checkJ. Vijayanand
ATTR_VFAT condition requires multiple bits to be set but the present condition checking in do_fat_read() & get_dentfromdir() ends up passing on even a single bit being set. Signed-off-by: J. Vijayanand <vijayanand.jayaraman@in.bosch.com> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2011-10-27fs/fat/fat.c: fix warning: 'part_size' defined but not usedWolfgang Denk
Commit c30a15e "FAT: Add FAT write feature" introduced a compiler warning. Fix this. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Donggeun Kim <dg77.kim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com>
2011-10-26FAT: Add FAT write featureDonggeun Kim
In some cases, saving data in RAM as a file with FAT format is required. This patch allows the file to be written in FAT formatted partition. The usage is similar with reading a file. First, fat_register_device function is called before file_fat_write function in order to set target partition. Then, file_fat_write function is invoked with desired file name, start ram address for writing data, and file size. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2011-10-25ext2: Cache line aligned partial sector bounce bufferAnton staaf
Currently, if a device read request is done that does not begin or end on a sector boundary a stack allocated bounce buffer is used to perform the read, and then just the part of the sector that is needed is copied into the users buffer. This stack allocation can mean that the bounce buffer will not be aligned to the dcache line size. This is a problem when caches are enabled because unaligned cache invalidates are not safe. This patch uses ALLOC_CACHE_ALIGN_BUFFER to create a stack allocated cache line size aligned bounce buffer. Signed-off-by: Anton Staaf <robotboy@chromium.org> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Dave Liu <r63238@freescale.com> Cc: Andy Fleming <afleming@gmail.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Change-Id: I32e1594d90ef039137bb219b0f7ced55768744ff Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-15punt unused clean/distclean targetsMike Frysinger
The top level Makefile does not do any recursion into subdirs when cleaning, so these clean/distclean targets in random arch/board dirs never get used. Punt them all. MAKEALL didn't report any errors related to this that I could see. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-12ubifs bad superblock bugLars Poeschel
This patch fixes an issue when ubifs reads a bad superblock. Later it tries to free memory, that was not allocated, which freezes u-boot. This is fixed by looking for a non null pointer before free. The message I got before u-boot freezes: UBI: max/mean erase counter: 53/32 UBIFS: mounted UBI device 0, volume 1, name "rootfs" UBIFS: mounted read-only UBIFS: file system size: 49140 bytes (50319360 KiB, 0 MiB, 49140 LEBs) UBIFS: journal size: 49 bytes (6838272 KiB, 0 MiB, 6678 LEBs) UBIFS: media format: w4/r0 (latest is w4/r0) UBIFS: default compressor: LZO UBIFS: reserved for root: 0 bytes (0 KiB) UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 9) UBIFS error (pid 0): ubifs_read_node: bad node at LEB 330:13104 UBIFS error (pid 0): ubifs_iget: failed to read inode 1, error -22 Error reading superblock on volume 'ubi:rootfs'! Signed-off-by: Lars Poeschel <larsi@wh2.tu-dresden.de> Cc: Kyungmin Park <kmpark@infradead.org> Signed-off-by: Stefan Roese <sr@denx.de>
2011-10-09fs/jffs2/jffs2_1pass.c: fix warning: variable ... set but not usedWolfgang Denk
Fix: jffs2_1pass.c: In function 'jffs2_1pass_read_inode': jffs2_1pass.c:699:7: warning: variable 'ret' set but not used [-Wunused-but-set-variable] jffs2_1pass.c: In function 'jffs2_1pass_build_lists': jffs2_1pass.c:1578:14: warning: variable 'empty_start' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-10-01fat: replace LINEAR_PREFETCH_SIZE with PREFETCH_BLOCKSSergei Shtylyov
Currently in do_fat_read() when reading FAT sectors, we have to divide down LINEAR_PREFETCH_SIZE by the sector size, whereas it's defined as 2 sectors worth of bytes. In order to avoid redundant multiplication/division, introduce #define PREFETCH_BLOCKS instead of #define LINEAR_PREFETCH_SIZE. Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
2011-10-01fat: root directory cluster only makes sense for FAT32Sergei Shtylyov
The root directory cluster field only exists in a FAT32 boot sector, so the 'root_cluster' variable in do_fat_read() contains garbage in case of FAT12/16. Make it contain 0 instead as this is what is passed to get_vfatname() in that case anyway. Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
2011-10-01fat: cannot compare bytes and sectorsSergei Shtylyov
The code multiples the FAT size in sectors by the sector size and then tries to compare that to the number of sectors in the 'getsize' variable. While fixing this, also change the initial value of 'getsize' as the division of FATBUFSIZE by the sector size gets us FATBUFBLOCKS. Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
2011-10-01fat: fix crash with big sector sizeSergei Shtylyov
Apple iPod nanos have sector sizes of 2 or 4 KiB, which crashes U-Boot when it tries to read the boot sector into 512-byte buffer situated on stack. Make the FAT code indifferent to the sector size. Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
2011-09-10UBIFS: fix warning: format '%lX' expects type 'long unsigned int'Wolfgang Denk
Commit 46d7274 "UBIFS: Change ubifsload to set the filesize variable" introduced the follwing compiler warning: ubifs.c: In function 'ubifs_load': ubifs.c:742: warning: format '%lX' expects type 'long unsigned int', but argument 3 has type 'u32' Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
2011-09-10UBIFS: Change ubifsload to set the filesize variableBastian Ruppert
This is the same behaviour like tftp or fatload command. Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de> CC: kmpark@infradead.org Acked-by: Detlev Zundel <dzu@denx.de>
2011-09-10YAFFS2: fs/yaffs2/yaffs_guts.c - fix build warningsWolfgang Denk
Fix these: yaffs_guts.c: In function 'yaffs_ReadDataFromFile': yaffs_guts.c:4622: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c:4622: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c: In function 'yaffs_WriteDataToFile': yaffs_guts.c:4745: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c:4745: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c: In function 'yaffs_ResizeFile': yaffs_guts.c:4968: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c:4968: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c: In function 'yaffs_GutsInitialise': yaffs_guts.c:7235: warning: assignment from incompatible pointer type yaffs_guts.c: In function 'yaffs_CreateNewObject': yaffs_guts.c:2143: warning: 'tn' may be used uninitialized in this function yaffs_guts.c: In function 'yaffs_MknodObject': yaffs_guts.c:2258: warning: 'str' may be used uninitialized in this function Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-09-10YAFFS2: fs/yaffs2/yaffs_guts.c - fix build warningsWolfgang Denk
Fix these: yaffs_guts.c: At top level: yaffs_guts.c:400: warning: 'yaffs_SkipFullVerification' defined but not used Testing shows no changes of the image sizes. Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-09-10YAFFS2: fs/yaffs2/yaffs_nand.[hc] - fix build warningsWolfgang Denk
Fix these: yaffs_guts.c: In function 'yaffs_Scan': yaffs_guts.c:5436: warning: pointer targets in passing argument 4 of 'yaffs_QueryInitialBlockState' differ in signedness yaffs_guts.c: In function 'yaffs_ScanBackwards': yaffs_guts.c:6017: warning: pointer targets in passing argument 4 of 'yaffs_QueryInitialBlockState' differ in signedness yaffs_nand.c: In function 'yaffs_QueryInitialBlockState': yaffs_nand.c:109: warning: pointer targets in passing argument 4 of 'dev->queryNANDBlock' differ in signedness yaffs_nand.c:113: warning: pointer targets in passing argument 4 of 'yaffs_TagsCompatabilityQueryNANDBlock' differ in signedness Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-09-10YAFFS2: fs/yaffs2/Makefile - fix build warningsWolfgang Denk
Drop the "-DNO_Y_INLINE" setting to fix these: yaffs_guts.h:806: warning: 'yaffs_GetBlockInfo' defined but not used Impact on image size is negligible - for the VCMA9 board the text segment size grew from 496353 to 496357 bytes (i. e. 0.0008%); total image size even remained constant. Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-09-10YAFFS2: fs/yaffs2/yaffscfg.c - fix build warningsWolfgang Denk
Fix these: yaffscfg.c: In function 'cmd_yaffs_mread_file': yaffscfg.c:316: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'char *' yaffscfg.c: In function 'cmd_yaffs_ls': yaffscfg.c:371: warning: format '%7d' expects type 'int', but argument 3 has type 'off_t' Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-08-19ubifs: Fix bad free() sequence in ubifs_finddir()Wolfgang Denk
Free private_data member element before freeing file structure. This was causing malloc to crash. Also remove unnecessary variable assigments as file structure gets free'd as well. Signed-off-by: Rod Boyce <uboot@teamboyce.co.uk> Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2011-08-04Convert ISO-8859 files to UTF-8Albert ARIBAUD
There was a mix of UTF-8 and ISO-8859 files in the U-Boot source tree, which could cause issues with the patchwork review system. This commit converts all ISO-8859 files to UTF-8. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-07-28ext2: Simplify partial sector access logicAnton Staaf
Previously reading or writing zero full sectors (reading the end of one sector and the beginning of the next for example) was special cased and involved stack allocating a second sector buffer. This change uses the same code path for this case as well as when there are a non-zero number of full sectors to access. The result is easier to read and reduces the maximum stack used. Signed-off-by: Anton Staaf <robotboy@chromium.org> Cc: Andy Fleming <afleming@freescale.com> Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-28ext2: Fix checkpatch violationsAnton Staaf
Fix all checkpatch violations in the low level Ext2 block device reading code. This is done in preparation for cleaning up the partial sector access code. Signed-off-by: Anton Staaf <robotboy@chromium.org> Cc: Andy Fleming <afleming@freescale.com> Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-26scaled down version of generic libraries for SPLAneesh V
Signed-off-by: Aneesh V <aneesh@ti.com>
2011-05-10cramfs: make cramfs usable without a NOR flashHeiko Schocher
cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-04-12Fix misc spelling errors found by lintianLoïc Minier
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
2011-04-02fat32 root directory handlingErik Hansen
Fat directory handling didn't check reaching the end of the root directory. It relied on a stop condition based on a directory entry with a name starting with a '\0' character. This check in itself is wrong ('\0' indicates free entry, not end_of_directory) but outside the scope of this fix. For FAT32, the end of the rootdir is reached when the end of the cluster chain is reached. The code didn't check this condition and started to read an incorrect cluster. This caused a subsequent read request of a sector outside the range of the usb stick in use. On its turn, the usb stick protested with a stall handshake. Both FAT32 and non-FAT32 (FAT16/FAT12) end or rootdir checks have been put in. Signed-off-by: Erik Hansen <erik@makarta.com>
2011-01-11UBIFS: Fix dereferencing type-punned pointer compiler warningDirk Behme
Fix compiler warning In file included from ubifs.h:2137:0, from ubifs.c:26: misc.h: In function 'ubifs_idx_key': misc.h:263:26: warning: dereferencing type-punned pointer will break strict-aliasing rules seen with gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50). No functional change. CC: Stefan Roese <sr@denx.de> Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-16Merge branch 'master' of ../master into nextWolfgang Denk
2010-12-03ubifs.c: BUG: Error following linksRicardo Ribalda Delgado
The link_name variable is declared inside the if block and it is used outside it through the name pointer. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-03UBIFS: Change ubifsload to not read beyond the requested sizeStefan Roese
Until now ubifsload pads the destination with 0 up to a multiple of UBIFS_BLOCK_SIZE (4KiB) while reading a file to memory. This patch changes this behaviour to only read to the requested length. This is either the file length or the length/size provided as parameter to the ubifsload command. Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-03UBIFS: Add ubifsumount command to unmount an active volumeStefan Roese
This new ubifsumount command allows the user to unmount a previously mounted UBIFS volume. Signed-off-by: Stefan Roese <sr@denx.de>
2010-11-28ext2: constify file/dir namesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-17Switch from archive libraries to partial linkingSebastien Carlier
Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
2010-10-29Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOCWolfgang Denk
By now, the majority of architectures have working relocation support, so the few remaining architectures have become exceptions. To make this more obvious, we make working relocation now the default case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by: Wolfgang Denk <wd@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Tested-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-10-20FAT: buffer overflow with FAT12/16Stefano Babic
Last commit 3831530dcb7b71329c272ccd6181f8038b6a6dd0a was intended "explicitly specify FAT12/16 root directory parsing buffer size, instead of relying on cluster size". Howver, the underlying function requires the size of the buffer in blocks, not in bytes, and instead of passing a double sector size a request for 1024 blocks is sent. This generates a buffer overflow with overwriting of other structure (in the case seen, USB structures were overwritten). Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Mikhail Zolotaryov <lebon@lebon.org.ua>