- Apr 07, 2021
-
-
The function jffs2_1pass_read_inode() was discarding the summary inodes and dirent because the value in datacrc flag wasn't initialized in function jffs2_sum_process_sum_data(). This fix initializes the status of all summary records to indicate that the CRC needs to be verified when they are loaded. Before this fix, the behaviors produced by the undefined value of datacrc was: - Summary's registries were discarded when 'b->datacrc' is equal as 'CRC_BAD'. - Summary's registries were not checked when b->datacrc differs of 'CRC_BAD' and 'CRC_UNKNOWN' So, almost all of the time the crc just isn't checked, and in some cases the registries are discarded. Signed-off-by:
Wagner Popov dos Santos <wpopov@gmail.com>
-
Fixes address violation in functions read_nand_cached() and read_onenand_cached(). This happens because these functions try to read a fixed amount of data even when the offset+length is above the nand's limit. Signed-off-by:
Wagner Popov dos Santos <wpopov@gmail.com>
-
- Mar 27, 2021
-
-
Simon Glass authored
The results of malloc() are a void * and so this cast is unnecessary. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
CBFS now supports compressed filed. Add support for reading this information so that the correct decompression can be applied. The decompression itself is not implemented in CBFS. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
In file_cbfs_next_file() there is a lot of complicated code to move to the next file. Use the ALIGN() macros to simplify this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The file_cbfs_next_file() function is already fairly long. Before expanding it further, move the core part into a separate function. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The file traversal functions currently use a single global CBFS. In some cases we need to access multiple CBFSs to obtain different files. Add new functions to support this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
In some cases CBFS does not start with a header but is just a collection of files. It is possible to support this so long as the size of the CBFS is provided. Update the cbfs_init_mem() function to support this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Rename this variable since there is no need to distinguish it from an old node. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
CBFS now supports attributes for things that cannot fit in the header as originally conceived. Add the structures for these. Also rename attributes_offset to something shorter, to ease code readability. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Mar 04, 2021
-
-
Commit 401d1c4f ("common: Drop asm/global_data.h from common header") broke compilation of squashfs filesystem when CONFIG_CMD_SQUASHFS=y is enabled. Compilation is failing on error: aarch64-linux-gnu-ld.bfd: u-boot/fs/squashfs/sqfs_inode.c:121: undefined reference to `le32_to_cpu' Fixes: 401d1c4f ("common: Drop asm/global_data.h from common header") Suggested-by:
Tom Rini <trini@konsulko.com> Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
- Mar 01, 2021
-
-
When the btrfs_read_fs_root() function is searching a ROOT_ITEM with location key offset other than -1, it currently fails via BUG_ON. The offset can have other value than -1, though. This can happen for example if a subvolume is renamed: $ btrfs subvolume create X && sync Create subvolume './X' $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: X$ location key (270 ROOT_ITEM 18446744073709551615) type DIR transid 283 data_len 0 name_len 1 name: X $ mv X Y && sync $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: Y$ location key (270 ROOT_ITEM 0) type DIR transid 285 data_len 0 name_len 1 name: Y As can be seen the offset changed from -1ULL to 0. Do not fail in this case. Signed-off-by:
Marek Behún <marek.behun@nic.cz> Cc: David Sterba <dsterba@suse.com> Cc: Qu Wenruo <wqu@suse.com> Cc: Tom Rini <trini@konsulko.com>
-
- Feb 24, 2021
-
-
Since commit 325dd1f6 ("fs: btrfs: Use btrfs_iter_dir() to ...") when btrfs is listing a directory, the output is not aligned: <SYMLINK> 15 Wed Sep 09 13:20:03 2020 boot.scr -> @/boot/boot.scr <DIR> 0 Tue Feb 02 12:42:09 2021 @ <FILE> 108 Tue Feb 02 12:54:04 2021 1.info Return back to how it was displayed previously, i.e.: <SYM> 15 Wed Sep 09 13:20:03 2020 boot.scr -> @/boot/boot.scr <DIR> 0 Tue Feb 02 12:42:09 2021 @ < > 108 Tue Feb 02 12:54:04 2021 1.info Instead of '<FILE>', print '< >', as ext4 driver. If an unknown directory item type is encountered, we will print the type number left padded with spaces, enclosed by '?', instead of '<' and '>', i.e.: ? 30? ............................. name Signed-off-by:
Marek Behún <marek.behun@nic.cz> Fixes: 325dd1f6 ("fs: btrfs: Use btrfs_iter_dir() to replace ...") Cc: David Sterba <dsterba@suse.com> Cc: Qu Wenruo <wqu@suse.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
Skip xattrs in directory listing. U-Boot filesystem drivers do not list xattrs. Signed-off-by:
Marek Behún <marek.behun@nic.cz> Cc: David Sterba <dsterba@suse.com> Cc: Qu Wenruo <wqu@suse.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
sqfs_opendir() called in sqfs_size(), sqfs_read(), sqfs_exists() may fail leading to sqfs_closedir(NULL) being called. Do not dereference NULL. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
- Feb 03, 2021
-
-
Heinrich Schuchardt authored
The FAT32 File System Specification [1] requires leading and trailing spaces as well as trailing periods of long names to be ignored. [1] Microsoft Extensible Firmware Initiative FAT32 File System Specification Version 1.03, December 6, 2000 Microsoft Corporation https://www.win.tue.nl/~aeb/linux/fs/fat/fatgen103.pdf Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
Directories or files called '.' or '..' cannot be created or written to in any directory. Move the test to normalize_longname() to check this early. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
This patch involves no functional change. It is just about code readability. Both in file_fat_write_at() and fat_mkdir() the incoming file or directory path are split into two parts: the parent directory and the base name. In file_fat_write_at() the value of the variable basename is assigned to the filename parameter and afterwards the variable filename is used instead of basename. It is more readable to use the variable basename and leave filename unchanged. In fat_mkdir() the base name variable is called directory. This is confusing. Call it basename like in file_fat_write_at(). This allows to rename parameter new_directory to directory in the implementation of fat_mkdir() to match the function declaration. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Feb 02, 2021
-
-
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Feb 01, 2021
-
-
The load command should not silently return to the console prompt if an invalid block device is specified and no file is loaded. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 29, 2021
-
-
Since commit 565a4147 ("fs: btrfs: Add more checksum algorithms") btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select it. This leads to compilation errors: fs/built-in.o: In function `hash_sha256': fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts' fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update' fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish' Signed-off-by:
Matthias Brugger <mbrugger@suse.com> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
Do not assign a value to a variable if it is not used. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
When copying short name plus extension refer to the encapsulating structure and not to the short name element. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
- Jan 23, 2021
-
-
Heinrich Schuchardt authored
The short name and extension of FAT files are stored in adjacent fields of the directory entry. For some operations like calculating a checksum or copying both fields it is preferable to treat both as one structure. Change the definition of the directory entry structure to include a structure comprising the name and the extension field. This resolves Coverity CID 316357, CID 316350, CID 316348. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
Provide function description for flush_dir(). Move all error messages for flush_dir() from the callers to the function. Move mapping of errors to -EIO to the function. Always check return value of flush_dir() (Coverity CID 316362). In fat_unlink() return -EIO if flush_dirty_fat_buffer() fails. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
- Jan 20, 2021
-
-
Before 'if (err)' we have to initialize the variable otherwise we use a random value from the stack. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
At the beginning of close_ctree_fs_info() the value 0 is assigned to err and never changed before testing it. Let's get rid of the superfluous variable. Fixes: f06bfcf5 ("fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progs") Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
SquashFS supports sprase blocks in files - that is, if a given block is composed only of zeros, it's not written to the output file to save space and it's on-disk length field is set to zero to indicate that. Previously the squashfs driver did not recognise that, and would attempt to read and decompress a zero-sized block, which obviously failed. The following command may be used to create a file for testing: cat <(dd if=/dev/urandom of=/dev/stdout bs=1M count=1) \ <(dd if=/dev/zero of=/dev/stdout bs=1M count=1) \ <(dd if=/dev/urandom of=/dev/stdout bs=1k count=200) >test_file Signed-off-by:
Campbell Suter <campbell@snapit.group>
-
In __btrfs_map_block() we do a int * int and assign it to u64. This is not safe as the result (int * int) is still evaluated as (int) thus it can overflow. Convert one of the multiplier to u64 to prevent such problem. In real world, this should not cause problem as we have device number limit thus it won't go beyond 4G for a single stripe. But it's harder to teach coverity about all these hidden limits, so just fix the possible overflow. Reported-by: Coverity CID 312957 Reported-by: Coverity CID 312948 Signed-off-by:
Qu Wenruo <wqu@suse.com>
-
- Jan 13, 2021
-
-
Heinrich Schuchardt authored
Up to now the bootefi command used the last file loaded to determine the boot partition. This has led to errors when the fdt had been loaded from another partition after the EFI binary. Before setting the boot device from a loaded file check if it is a PE-COFF image or a FIT image. For a PE-COFF image remember address and size, boot device and path. For a FIT image remember boot device and path. If the PE-COFF image is overwritten by loading another file, forget it. Do not allow to start an image via bootefi which is not the last loaded PE-COFF image. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
- Dec 31, 2020
-
-
Heinrich Schuchardt authored
The FAT file system does not have a UUID but a 4 byte volume ID. Let the fsuuid command show it in XXXX-XXXX format. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
The FAT filesystem implementation uses several marcros referring to a magic variable name mydata which renders the code less readable. Eliminate one of them which is only used for a debug() statement. Use log_debug() instead of debug(). Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Dec 10, 2020
-
-
Heinrich Schuchardt authored
Long file names are stored in multiple directory entries. When deleting a file we must delete all of them. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
A long name is split over multiple directory entries. When deleting a file with a long name we need the first directory entry to be able to delete the whole chain. Add the necessary fields to the FAT iterator: * cluster of first directory entry * address of first directory entry * remaining entries in cluster Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
When deleting a directory entry 0xe5 is written to name[0]. We have a constant for this value and should use it consistently. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
Searching for a file is not a write operation. So it should not lead to the allocation of a new cluster to the directory. If we reuse deleted entries, we might not even use the new cluster and due to not flushing it the directory could be corrupted. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
When creating new directory entries try to reuse entries marked as deleted. In fill_dir_slot() do not allocate new clusters as this has already been done in fat_find_empty_dentries(). Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
Provide a function to find a series of empty directory entries. The current directory is scanned for deleted entries. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
When handling long file names directory entries may be split over multiple clusters. We must make sure that new clusters are zero filled on disk. When allocating a new cluster for a directory flush it. The flushing should be executed before updating the FAT. This way if flushing fails, we still have a valid directory structure. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
When iterating over a child directory we set itr->start_clust. Do the same when over the root directory. When looking for deleted directory entries or existing short names we will have to iterate over directories a second and third time. With this patch we do not need any special logic for the root directory. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-