- Sep 23, 2016
-
-
Stefan Brüns authored
e2fsck warns about "Group descriptor 0 marked uninitialized without feature set." The bg_itable_unused field is only defined if FEATURE_RO_COMPAT_GDT_CSUM is set, and should be set (kept) zero otherwise. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
Scanning only the direct blocks of the directory file may falsely report an existing file as nonexisting, and worse can also lead to creation of a duplicate entry on file creation. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
While directories can be read using the old linear scan method, adding a new file would require updating the index tree (alternatively, the whole tree could be removed). Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
Previously, only the last directory block was scanned for available space. Instead, scan all blocks back to front, and if no sufficient space is found, eventually append a new block. Blocks are only appended if the directory does not use extents or the new block would require insertion of indirect blocks, as the old code does. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
The following command crashes u-boot: ./sandbox/u-boot -c 'i=0; host bind 0 ./sandbox/test/fs/3GB.ext4.img ; while test $i -lt 200 ; do echo $i; setexpr i $i + 1; ext4write host 0 0 /foobar${i} 0; done' Previously, the code updated the direct_block even for extents, and fortunately crashed before pushing garbage to the disk. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
In case the dir entry creation failed, ext4fs_write would later overwrite a random inode, as inodeno was never initialized. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
The following command triggers a segfault in search_dir: ./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ; ext4write host 0 0 /./foo 0x10' The following command triggers a segfault in check_filename: ./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ; ext4write host 0 0 /. 0x10' "." is the first entry in the directory, thus previous_dir is NULL. The whole previous_dir block in search_dir seems to be a bad copy from check_filename(...). As the changed data is not written to disk, the statement is mostly harmless, save the possible NULL-ptr reference. Typically a file is unlinked by extending the direntlen of the previous entry. If the entry is the first entry in the directory block, it is invalidated by setting inode=0. The inode==0 case is hard to trigger without crafted filesystems. It only hits if the first entry in a directory block is deleted and later a lookup for the entry (by name) is done. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Michael Walle authored
le32_to_cpu() must only convert the revision_level and not the boolean result. Signed-off-by:
Michael Walle <michael@walle.cc>
-
Michael Walle authored
All fields were accessed directly instead of using the proper byte swap functions. Thus, ext4 write support was only usable on little-endian architectures. Fix this. Signed-off-by:
Michael Walle <michael@walle.cc>
-
Michael Walle authored
Instead of __{be,le}{16,32}_to_cpu use {be,le}{16,32}_to_cpu. Signed-off-by:
Michael Walle <michael@walle.cc>
-
Michael Walle authored
Change all the types of ext2/4 fields to little endian types and all the JBD fields to big endian types. Now we can use sparse (make C=1) to check for statements where we need byteswaps. Signed-off-by:
Michael Walle <michael@walle.cc>
-
Stefan Brüns authored
Current description does not match the function behaviour. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
The code caches 6 sectors of the FAT. On FAT traversal, the old contents needs to be flushed to disk, but only if any FAT entries had been modified. Explicitly flag the buffer on modification. Currently, creating a new file traverses the whole FAT up to the first free cluster and rewrites the on-disk blocks. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
Stefan Brüns authored
fatlength is a local variable which is no more used after the assignment. s_name is not used in the function, save the strncpy. Signed-off-by:
Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by:
Lukasz Majewski <l.majewski@samsung.com> Acked-by:
Stephen Warren <swarren@nvidia.com> Reviewed-by:
Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
-
- Aug 16, 2016
-
-
Yaroslav K authored
This fixes incorrect filenames in cbfsls output. Signed-off-by:
Yaroslav K. <yar444@gmail.com> Reviewed-by:
Simon Glass <sjg@chromium.org> [clean up checkpatch errors and warnings] Signed-off-by:
Bin Meng <bmeng.cn@gmail.com>
-
- Aug 05, 2016
-
-
Tom Rini authored
With e2fsprogs after 1.43 the 64bit and metadata_csum features are enabled by default. The metadata_csum feature changes how ext4_group_desc->bg_checksum is calculated, which would break write support. The 64bit feature however introduces changes such that it cannot be read by implementations that do not support it. Since we do not support this, we must not mount it. Cc: Stephen Warren <swarren@nvidia.com> Cc: Simon Glass <sjg@chromium.org> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Stefan Roese <sr@denx.de> Reported-by:
Andrew Bradford <andrew.bradford@kodakalaris.com> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Jun 19, 2016
-
-
Guillaume GARDET authored
Fix the following build errors when building sandbox on x86 32-bit: In file included from fs/cbfs/cbfs.c:8:0: include/malloc.h:364:7: error: conflicting types for 'memset' void* memset(void*, int, size_t); ^ In file included from include/compiler.h:123:0, from include/cbfs.h:10, from fs/cbfs/cbfs.c:7: include/linux/string.h:78:15: note: previous declaration of 'memset' was here extern void * memset(void *,int,__kernel_size_t); ^ In file included from fs/cbfs/cbfs.c:8:0: include/malloc.h:365:7: error: conflicting types for 'memcpy' void* memcpy(void*, const void*, size_t); ^ In file included from include/compiler.h:123:0, from include/cbfs.h:10, from fs/cbfs/cbfs.c:7: include/linux/string.h:81:15: note: previous declaration of 'memcpy' was here extern void * memcpy(void *,const void *,__kernel_size_t); ^ scripts/Makefile.build:280: recipe for target 'fs/cbfs/cbfs.o' failed Signed-off-by:
Guillaume GARDET <guillaume.gardet@free.fr> Cc: Tom Rini <trini@konsulko.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jun 04, 2016
-
-
Scott Wood authored
These functions are part of the Linux 4.6 sync. They are being added before the main sync patch in order to make it easier to address the issue across all NAND drivers (many/most of which do not closely track their Linux counterparts) separately from other merge issues. Signed-off-by:
Scott Wood <oss@buserror.net>
-
Scott Wood authored
nand_info[] is now an array of pointers, with the actual mtd_info instance embedded in struct nand_chip. This is in preparation for syncing the NAND code with Linux 4.6, which makes the same change to struct nand_chip. It's in a separate commit due to the large amount of changes required to accommodate the change to nand_info[]. Signed-off-by:
Scott Wood <oss@buserror.net>
-
Scott Wood authored
This typedef serves no purpose other than causing confusion with struct nand_chip. Signed-off-by:
Scott Wood <oss@buserror.net>
-
- May 17, 2016
-
-
Simon Glass authored
This option currently enables both the command and the SCSI functionality. Rename the existing option to CONFIG_SCSI since most of the code relates to the feature. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- May 02, 2016
-
-
Ronald Zachariah authored
The function ext4fs_read_symlink was unable to handle a symlink which had target name of exactly 60 characters. Signed-off-by:
Ronald Zachariah <rozachar@cisco.com> Signed-off-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Stephen Warren <swarren@nvidia.com> Cc: Tom Rini <trini@konsulko.com>
-
- Apr 22, 2016
-
-
Heiko Schocher authored
In list "super_blocks" ubifs collects allocated super_block structs. U-Boot frees on unmount the allocated struct, so the pointer stored in this list is free after the umount. On a new ubifs mount, the new allocated super_block struct get inserted into the super_blocks list ... which contains now a freed pointer, and the list_add_tail() corrupts the freed memory ... 2 solutions are possible: - remove the super_block from the super_blocks list on umount - as U-Boot does not use the super_blocks list ... remove it complete for U-Boot. Both solutions should not introduce problems for porting to newer linux version, so this patch removes the unused super_blocks list, as it saves code size and execution time. Signed-off-by:
Heiko Schocher <hs@denx.de>
-
- Apr 01, 2016
-
-
Tom Rini authored
We only use 'ofs' in jffs2_sum_scan_sumnode when debugging as it's part of a dbg_summary call. Mark this as __maybe_unused. Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Mar 22, 2016
-
-
Vagrant Cascadian authored
Signed-off-by:
Vagrant Cascadian <vagrant@debian.org> Reviewed-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Peter Griffin <peter.griffin@linaro.org>
-
- Mar 14, 2016
-
-
Simon Glass authored
To ease conversion to driver model, add helper functions which deal with calling each block device method. With driver model we can reimplement these functions with the same arguments. Use inline functions to avoid increasing code size on some boards. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Stephen Warren <swarren@nvidia.com>
-
Simon Glass authored
This is a device number, and we want to use 'dev' to mean a driver model device. Rename the member. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Stephen Warren <swarren@nvidia.com>
-
Simon Glass authored
Rename three partition functions so that they start with part_. This makes it clear what they relate to. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Stephen Warren <swarren@nvidia.com>
-
Simon Glass authored
Rename this function to blk_get_device_part_str(). This is a better name because it makes it clear that the function returns a block device and parses a string. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Stephen Warren <swarren@nvidia.com>
-
Simon Glass authored
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Stephen Warren <swarren@nvidia.com>
-
- Jan 25, 2016
-
-
Masahiro Yamada authored
BUILD_BUG_* macros have been defined in several headers. It would be nice to collect them in include/linux/bug.h like Linux. This commit is cherry-picking useful macros from include/linux/bug.h of Linux 4.4. I did not import BUILD_BUG_ON_MSG() because it would not work if it is used with include/common.h in U-Boot. I'd like to postpone it until the root cause (the "error()" macro in include/common.h causes the name conflict with "__attribute__((error()))") is fixed. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
- Jan 19, 2016
-
-
Tom Rini authored
In a number of places we had wordings of the GPL (or LGPL in a few cases) license text that were split in such a way that it wasn't caught previously. Convert all of these to the correct SPDX-License-Identifier tag. Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Jan 14, 2016
-
-
Tom Rini authored
As noted by Coverity, when we have an error in alloc_triple_indirect_block we will leak ti_pbuff_start_addr as it's not being freed. Further inspection here shows that we could also leak ti_cbuff_start_addr in one corner case so free that as well. Reported-by: Coverity (CID 131205, 131206) Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Stephen Warren authored
This will allow the implementation to make use of data in the block_dev structure beyond the base device number. This will be useful so that eMMC block devices can encompass the HW partition ID rather than treating this out-of-band. Equally, the existence of the priv field is crying out for this patch to exist. Signed-off-by:
Stephen Warren <swarren@nvidia.com> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
- Jan 08, 2016
-
-
David Müller (ELSOFT AG) authored
Signed-off-by:
David Müller <d.mueller@elsoft.ch>
-
- Nov 23, 2015
-
-
Thomas Fitzsimmons authored
If the ext3 journal gets out of sync with what is written on disk, for example because of an unexpected power cut, ext4fs_read_file can return an all-zero directory entry. In that case, ext4fs_iterate_dir would infinite loop. This patch detects when a directory entry's direntlen member is 0 and returns a failure status, which breaks out of the infinite loop. As a result, U-Boot will not find files that may subsequently be recovered when the journal is replayed. This is better behaviour than hanging in an infinite loop, but as a further improvement maybe U-Boot could interpret the ext3 journal and actually find the unsynced entries. Signed-off-by:
Thomas Fitzsimmons <fitzsim@cisco.com> Reviewed-by:
Stefan Roese <sr@denx.de>
-
- Nov 10, 2015
-
-
Tom Rini authored
After consulting with some of the SPDX team, the conclusion is that Makefiles are worth adding SPDX-License-Identifier tags too, and most of ours have one. This adds tags to ones that lack them and converts a few that had full (or in one case, very partial) license blobs into the equivalent tag. Cc: Kate Stewart <kstewart@linuxfoundation.org> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Nov 05, 2015
-
-
Fabio Estevam authored
Use the is_power_of_2() definition from log2.h to align with the kernel implementation. Signed-off-by:
Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Heiko Schocher <hs@denx.de> Reviewed-by:
Jagan Teki <jteki@openedev.com>
-
- Oct 26, 2015
-
-
Heiko Schocher authored
sync with linux v4.2 commit 64291f7db5bd8150a74ad2036f1037e6a0428df2 Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Aug 30 11:34:09 2015 -0700 Linux 4.2 This update is needed, as it turned out, that fastmap was in experimental/broken state in kernel v3.15, which was the last base for U-Boot. Signed-off-by:
Heiko Schocher <hs@denx.de> Tested-by:
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
-
- Oct 24, 2015
-
-
Hans de Goede authored
Add generic fs support, so that commands like ls, load and test -e can be used on ubifs. Signed-off-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Heiko Schocher <hs@denx.de>
-