- 24 9月, 2016 1 次提交
-
-
由 Masahiro Yamada 提交于
We are supposed to use #include <...> to include headers in the public include paths. We should use #include "..." only for headers in local directories. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
- 23 9月, 2016 29 次提交
-
-
由 Stefan Brüns 提交于
Enable mounting of ext4 fs with 64bit feature, as it is supported now. These had been disabled in 6f94ab66. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
Also adjust high 16/32 bits when free inode/block counts are modified. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
The descriptor size is variable, thus array indices are not generically applicable. The larger group descriptors also contain e.g. high parts of block numbers, which have to be read and written. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
The correct descriptor size must be used when calculating offsets, and also to read the correct amount of data. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
The helper functions encapsulate access of the block group descriptors, independent of group descriptor size. The helpers also deal with the endianess of the fields, and with split fields like free_blocks/ free_blocks_high. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from the superblocks, otherwise it defaults to 32. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
If the same block is updated multiple times in a row during a single file system operation, gd_index is decremented to use the same journal entry again. Avoid loosing the already allocated buffer. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
read_allocated block may return block number 0, which is just an indicator a chunk of the file is not backed by a block, i.e. it is sparse. During file deletions, just continue with the next logical block, for other operations treat blocknumber <= 0 as an error. For writes, blocknumber 0 should never happen, as U-Boot always allocates blocks for the whole file. Reading already handles this correctly, i.e. the read buffer is 0-fillled. Not treating block 0 as sparse block leads to FS corruption, e.g. ./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ; ext4write host 0 0 /2.5GB.file 1 ' The 2.5GB.file from the fs test is actually a sparse file. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
The data blocks are identical for files using traditional direct/indirect block allocation scheme and extent trees, thus this code part can be common. Only the code to deallocate the indirect blocks to record the used blocks has to be seperate, respectively the code to release extent tree index blocks. Actually the code to release the extent tree index blocks is still missing, but at least add a FIXME at the appropriate place. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
Make sure the the extra_isize field (offset 128) is initialized to 0, to mark any extra data as invalid. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
fs->inodesz is already correctly (i.e. dependent on fs revision) initialized in ext4fs_mount. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
temp_ptr should always be freed, even if the function is left via goto fail. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
If the blocksize is 1024, count is initialized with 1. Incrementing count by 8 will never match (count == fs->blksz * 8), and ptr may be incremented beyond the buffer end if the bitmap is filled. Add the startblock offset after the loop. Remove the second loop, as only the first iteration will be done. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
The last free block of a block group may be in its middle. After it has been allocated, the next block group should be scanned from its beginning. The following command triggers the bad behaviour (on a blocksize 1024 fs): ./sandbox/u-boot -c 'i=0; host bind 0 ./disk.raw ; while test $i -lt 260 ; do echo $i; setexpr i $i + 1; ext4write host 0:2 0 /X${i} 0x1450; done ; ext4write host 0:2 0 /X240 0x2000 ; ' When 'X240' is extended from 5200 byte to 8192 byte, the new blocks should start from the first free block (8811), but it uses the blocks 8098-8103 and 16296-16297 -- 8103 + 1 + 8192 = 16296. This can be shown with debugfs, commands 'ffb' and 'stat X240'. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
zero_buffer is never written, thus clearing it is pointless. journal_buffer is completely initialized by ext4fs_devread (or in case of failure, not used). Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
In case the dir entry creation failed, ext4fs_write would later overwrite a random inode, as inodeno was never initialized. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Michael Walle 提交于
le32_to_cpu() must only convert the revision_level and not the boolean result. Signed-off-by: NMichael Walle <michael@walle.cc>
-
由 Michael Walle 提交于
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: NMichael Walle <michael@walle.cc>
-
由 Michael Walle 提交于
Instead of __{be,le}{16,32}_to_cpu use {be,le}{16,32}_to_cpu. Signed-off-by: NMichael Walle <michael@walle.cc>
-
由 Michael Walle 提交于
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: NMichael Walle <michael@walle.cc>
-
由 Stefan Brüns 提交于
Current description does not match the function behaviour. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
由 Stefan Brüns 提交于
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: NStefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: NLukasz Majewski <l.majewski@samsung.com> Acked-by: NStephen Warren <swarren@nvidia.com> Reviewed-by: NBenoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
-
- 16 8月, 2016 1 次提交
-
-
由 Yaroslav K 提交于
This fixes incorrect filenames in cbfsls output. Signed-off-by: NYaroslav K. <yar444@gmail.com> Reviewed-by: NSimon Glass <sjg@chromium.org> [clean up checkpatch errors and warnings] Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
-
- 05 8月, 2016 1 次提交
-
-
由 Tom Rini 提交于
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: NAndrew Bradford <andrew.bradford@kodakalaris.com> Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 19 6月, 2016 1 次提交
-
-
由 Guillaume GARDET 提交于
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: NGuillaume GARDET <guillaume.gardet@free.fr> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
- 04 6月, 2016 3 次提交
-
-
由 Scott Wood 提交于
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: NScott Wood <oss@buserror.net>
-
由 Scott Wood 提交于
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: NScott Wood <oss@buserror.net>
-
由 Scott Wood 提交于
This typedef serves no purpose other than causing confusion with struct nand_chip. Signed-off-by: NScott Wood <oss@buserror.net>
-
- 17 5月, 2016 1 次提交
-
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
- 03 5月, 2016 1 次提交
-
-
由 Ronald Zachariah 提交于
The function ext4fs_read_symlink was unable to handle a symlink which had target name of exactly 60 characters. Signed-off-by: NRonald Zachariah <rozachar@cisco.com> Signed-off-by: NStefan Roese <sr@denx.de> Reviewed-by: NStephen Warren <swarren@nvidia.com> Cc: Tom Rini <trini@konsulko.com>
-
- 22 4月, 2016 1 次提交
-
-
由 Heiko Schocher 提交于
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: NHeiko Schocher <hs@denx.de>
-
- 02 4月, 2016 1 次提交
-
-
由 Tom Rini 提交于
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: NTom Rini <trini@konsulko.com>
-