summaryrefslogtreecommitdiff
path: root/fs/ubifs
Commit message (Collapse)AuthorAgeLines
* ARM: prevent misaligned array initsAlbert ARIBAUD2012-10-15-0/+3
| | | | | | | | | | | | | | Under option -munaligned-access, gcc can perform local char or 16-bit array initializations using misaligned native accesses which will throw a data abort exception. Fix files where these array initializations were unneeded, and for files known to contain such initializations, enforce gcc option -mno-unaligned-access. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> [trini: Switch to usign call cc-option for -mno-unaligned-access as Albert had done previously as that's really correct] Signed-off-by: Tom Rini <trini@ti.com>
* ubifs: Fix ubifsload when using ZLIBVeli-Pekka Peltola2012-09-10-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using ZLIB compression with UBIFS fails if last data node is not a size of UBIFS_BLOCK_SIZE (4096 bytes). Easiest way to test this is trying to read a file smaller than 4k: => ubifsload 41000000 /etc/fstab Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)... UBIFS error (pid 0): read_block: bad data node (block 0, inode 2506) UBIFS error (pid 0): do_readpage: cannot read page 0 of inode 2506, error -22 Error reading file '/etc/fstab' /etc/fstab not found! exit not allowed from main input shell. => With this patch: => ubifsload 41000000 /etc/fstab Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)... Done => Signed-off-by: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Cc: kmpark@infradead.org Tested-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Stefan Roese <sr@denx.de>
* ubifs: Fix memory leak in ubifs_finddirStefan Roese2012-09-03-5/+6
| | | | | | | This patch fixes a memory leak in ubifs_finddir(). Signed-off-by: Stefan Roese <sr@denx.de> Cc: dev.ma.dma@gmail.com
* UBIFS: Improve error message when reading superblock failedBernhard Walle2012-08-09-1/+1
| | | | | | | | | | | | | | In addition to the error message also display the error code. I had the problem that my malloc memory was not enough (ENOMEM), and if u-boot had displayed the error code immediately that would have saved me some debugging. Signed-off-by: Bernhard Walle <walle@corscience.de> Use ubifs_err instead of printf. Add "errno=%d" in output as suggested by Albert Aribaud. Signed-off-by: Thomas Weber <weber@corscience.de>
* ubifs bad superblock bugLars Poeschel2011-10-12-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* UBIFS: fix warning: format '%lX' expects type 'long unsigned int'Wolfgang Denk2011-09-10-1/+1
| | | | | | | | | | | 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>
* UBIFS: Change ubifsload to set the filesize variableBastian Ruppert2011-09-10-1/+5
| | | | | | | | 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>
* ubifs: Fix bad free() sequence in ubifs_finddir()Wolfgang Denk2011-08-19-4/+2
| | | | | | | | | | | 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>
* UBIFS: Fix dereferencing type-punned pointer compiler warningDirk Behme2011-01-11-1/+2
| | | | | | | | | | | | | | | | | 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>
* ubifs.c: BUG: Error following linksRicardo Ribalda Delgado2010-12-03-1/+1
| | | | | | | | 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>
* UBIFS: Change ubifsload to not read beyond the requested sizeStefan Roese2010-12-03-13/+58
| | | | | | | | | | 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>
* UBIFS: Add ubifsumount command to unmount an active volumeStefan Roese2010-12-03-1/+1
| | | | | | | This new ubifsumount command allows the user to unmount a previously mounted UBIFS volume. Signed-off-by: Stefan Roese <sr@denx.de>
* Switch from archive libraries to partial linkingSebastien Carlier2010-11-17-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOCWolfgang Denk2010-10-29-1/+1
| | | | | | | | | | | 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>
* ubifsmount fails due to not initialized listStefano Babic2010-04-28-0/+1
| | | | | | | | | ubifsmount is not working and causes an access with a pointer set to zero because the ubifs_fs_type is not initialized correctly. Signed-off-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* move prototypes for gunzip() and zunzip() to common.hWolfgang Wegner2009-12-21-3/+0
| | | | | | | | Prototype for gunzip/zunzip was only in lib_generic/gunzip.c and thus repeated in every file using it. This patch moves the prototypes to common.h and removes all prototypes distributed anywhere else. Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de>
* common: delete CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOULHeiko Schocher2009-12-08-4/+0
| | | | | | | | | There is more and more usage of printing 64bit values, so enable this feature generally, and delete the CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL defines. Signed-off-by: Heiko Schocher <hs@denx.de>
* Conditionally perform common relocation fixupsPeter Tyser2009-10-03-0/+4
| | | | | | | | | | | Add #ifdefs where necessary to not perform relocation fixups. This allows boards/architectures which support relocation to trim a decent chunk of code. Note that this patch doesn't add #ifdefs to architecture-specific code which does not support relocation. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* ubifs: Correct dereferencing of files-after-symlinksSimon Kagstrom2009-09-28-1/+1
| | | | | | | | | | | | | | | | | Files in directories which are symlinked to were not dereferenced correctly in last commit. E.g., with a symlink /boot/lnk -> /boot/real_dir loading /boot/lnk/uImage will fail. This patch fixes that by simply seeing to it that the target base directory has a slash after it. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: Stefan Roese <sr@denx.de>
* ubifs: Add support for looking up directory and relative symlinksSimon Kagstrom2009-09-23-25/+43
| | | | | | | | | This patch adds support for resolving symlinks to directories as well as relative symlinks. Symlinks are now always resolved during file lookup, so the load stage no longer needs to special-case them. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: Stefan Roese <sr@denx.de>
* Move __set/clear_bit from ubifs.h to bitops.hSimon Kagstrom2009-09-15-32/+0
| | | | | | | | | __set_bit and __clear_bit are defined in ubifs.h as well as in asm/include/bitops.h for some architectures. This patch moves the generic implementation to include/linux/bitops.h and uses that unless it's defined by the architecture. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
* ubifs: fix small error path mismatchDaniel Mack2009-06-09-4/+2
| | | | | | In do_readpage(), don't free 'dn' if its allocation failed. Signed-off-by: Daniel Mack <daniel@caiaq.de>
* ubifs: BUG: Blocks commpressed with zlibRicardo Ribalda Delgado2009-04-30-3/+5
| | | | | | | | Blocks compressed with zlib dont have the full gzip header. Without this patch, block compressed with zlib cannot be readed! Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
* ubifs: BUG realpath string must be ended with NULLRicardo Ribalda Delgado2009-04-28-0/+1
| | | | | | | | If the memory used to copy the link_make is "dirty" the string wont be ended with NULL, throwing out multiple memory bugs. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es> Acked-by: Stefan Roese <sr@denx.de>
* UBIFS: Remove tnc_commit.c which is not used in the read-only versionStefan Roese2009-04-28-1102/+0
| | | | | | | | I missed removing this file while implementing the UBIFS support. It's not referenced at all, so let's remove it. Thanks to Artem Bityutskiy for spotting. Signed-off-by: Stefan Roese <sr@denx.de>
* UBIFS: fix recovery bugAdrian Hunter2009-04-28-47/+23
| | | | | | | | | | | | UBIFS did not recovery in a situation in which it could have. The relevant function assumed there could not be more nodes in an eraseblock after a corrupted node, but in fact the last (NAND) page written might contain anything. The correct approach is to check for empty space (0xFF bytes) from then on. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Stefan Roese <sr@denx.de>
* Update CHANGELOG, coding style cleanup.Wolfgang Denk2009-04-05-1/+0
|
* UBIFS: add R/O compatibilityArtem Bityutskiy2009-04-04-11/+71
| | | | | | | | | | | | | | | Now UBIFS is supported by u-boot. If we ever decide to change the media format, then people will have to upgrade their u-boots to mount new format images. However, very often it is possible to preserve R/O forward-compatibility, even though the write forward-compatibility is not preserved. This patch introduces a new super-block field which stores the R/O compatibility version. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Acked-by: Adrian Hunter <Adrian.Hunter@nokia.com> Signed-off-by: Stefan Roese <sr@denx.de>
* UBIFS: Missing offset relocation for compressor 'none'Michael Lawnick2009-03-20-1/+4
| | | | | | | | | | | On systems where U-Boot is linked to another address than it really lays (e.g. backup image), calls via function pointers must be fixed with a '+= gd->reloc_off'. This was not done for none_compr in ubifs_compressors_init() what leads to system crash on ubifsmount command. Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de> Acked-by: Stefan Roese <sr@denx.de>
* UBIFS: Implement read-only UBIFS support in U-BootStefan Roese2009-03-20-0/+16971
The U-Boot UBIFS implementation is largely a direct copy from the current Linux version (2.6.29-rc6). As already done in the UBI version we have an "abstraction layer" to redefine or remove some OS calls (e.g. mutex_lock() ...). This makes it possible to use the original Linux code with very little changes. And by this we can better update to later Linux versions. I removed some of the Linux features that are not used in the U-Boot version (e.g. garbage-collection, write support). Signed-off-by: Stefan Roese <sr@denx.de> CC: Artem Bityutskiy <dedekind@infradead.org> CC: Adrian Hunter <ext-Adrian.Hunter@nokia.com>