- Dec 21, 2023
-
-
If FS_LOADER is enabled for the SPL then the build fails with the error: fs/fs.o:(.data.rel.fstypes+0x128): undefined reference to `smh_fs_set_blk_dev' fs/fs.o:(.data.rel.fstypes+0x140): undefined reference to `smh_fs_size' fs/fs.o:(.data.rel.fstypes+0x148): undefined reference to `smh_fs_read' fs/fs.o:(.data.rel.fstypes+0x150): undefined reference to `smh_fs_write' Fix the error by populating the semihosting entry in the fs_types array only for non-SPL builds. Signed-off-by:
Mayuresh Chitale <mchitale@ventanamicro.com> Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Sean Anderson <seanga2@gmail.com>
-
Tom Rini authored
In order to make it easier to move on to dropping common.h from code directly, remove common.h inclusion from the rest of the header file which had been including it. Reviewed-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Dec 13, 2023
-
-
Add some functions which provide an argument to a command, or NULL if the argument does not exist. Use the same numbering as argv[] since it seems less confusing than the previous idea. Signed-off-by:
Simon Glass <sjg@chromium.org> Suggested-by:
Tom Rini <trini@konsulko.com>
-
- Nov 29, 2023
-
-
The performed checks are similar to the checks performed by the Linux kernel in the function fat_read_bpb() in the file fs/fat/inode.c. Signed-off-by:
Christian Taedcke <christian.taedcke@weidmueller.com>
-
This simplifies the code a little bit. Signed-off-by:
Christian Taedcke <christian.taedcke@weidmueller.com>
-
This fixes an issue where the FAT type (FAT12, FAT16) is not correctly detected, e.g. when the BPB field BS_FilSysType contains the valid value "FAT ". According to the FAT spec the field BS_FilSysType has only informational character and does not determine the FAT type. The logic of this code is based on the linux kernel implementation from the file fs/fat/inode.c function fat_fill_super(). For details about FAT see http://elm-chan.org/docs/fat_e.html Signed-off-by:
Christian Taedcke <christian.taedcke@weidmueller.com>
-
This reduces code duplications. Signed-off-by:
Christian Taedcke <christian.taedcke@weidmueller.com>
-
- Nov 16, 2023
-
-
The btrfs read function limits the read length to ensure that it and the read offset do not together exceed the size of the file. However, this size was only being queried if the read length was passed a value of zero (meaning "whole file"), and the size is defaulted to 0 otherwise. This means the clamp will just zero out the length if one is specified, preventing reading of the file. Fix this by checking the file size unconditionally, and unifying the default length and clamping logic as a single range check instead. This bug was discovered when trying to boot Linux with initrd= via 'bootefi' from a btrfs partition. The EFI stub entered an infinite loop of zero-length reads while trying to read the initrd, and the boot process stalled indefinitely. Signed-off-by:
Sam Edwards <CFSworks@gmail.com> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
Now that we have time conversion defines from in time.h there is no need for each driver to define their own version. Signed-off-by:
Igor Prusov <ivprusov@salutedevices.com> Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com> # tegra Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com> #at91 Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> #qcom geni Reviewed-by: Stefan Bosch <stefan_b@posteo.net> #nanopi2 Reviewed-by:
Patrice Chotard <patrice.chotard@foss.st.com>
-
The part_length parameter is not used. Remove it. Signed-off-by:
Sean Anderson <seanga2@gmail.com>
-
The structure is identical to the existing compressor implementations, trivially adding lz4 decompression to sqfs_decompress. The changes were tested using a sandbox build. An LZ4 compressed squashfs image was bound as a host block device. Signed-off-by:
David Oberhollenzer <goliath@infraroot.at> Reviewed-by:
Joao Marcos Costa <jmcosta944@gmail.com>
-
This patch removes a number of struct and macro declaration that were found through `git-grep` to be unused. Most of those are related to compressor options and super block flags. For reading a SquashFS image, we do not need the compressor options or the flags. Those only encode settings used for packing the image, mksquashfs uses them when appending data to an existing image. The kernel implementation does not touch those, and we don't need them either. Signed-off-by:
David Oberhollenzer <goliath@infraroot.at>
-
- Oct 30, 2023
-
-
Similar change was done by commit b4c2c151 ("Kconfig: Remove all default n/no options") and again sync is required. default n/no doesn't need to be specified. It is default option anyway. Signed-off-by:
Michal Simek <michal.simek@amd.com> Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com> # tegra Reviewed-by:
Tom Rini <trini@konsulko.com> Reviewed-by:
Angelo Dureghello <angelo@kernel-space.org>
-
- Oct 18, 2023
-
-
Don't bother compiling the sandbox filesystem in SPL for now, as it is not needed. Signed-off-by:
Sean Anderson <seanga2@gmail.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
This check breaks small partitions (under 1024 blocks) because part_length is in units of part.blksz and not bytes. Given the purpose of this function, we really want to make sure the partition is SUPERBLOCK_START + SUPERBLOCK_SIZE (2048) bytes so we can call ext4_read_superblock without error. The obvious solution is to convert callers from things like ext4fs_mount(part_info.size) to ext4fs_mount(part_info.size * part_info.blksz); However, I'm not really a fan of the bloat that would cause, especially since the error is now suppressed. I think the best course of action here is to just revert the patch. This reverts commit 9905cae6. Signed-off-by:
Sean Anderson <seanga2@gmail.com> Reviewed-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Patrick Delaunay <patrick.delaunay@foss.st.com>
-
- Sep 24, 2023
-
-
This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Sep 14, 2023
-
-
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162a ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by:
Marek Vasut <marek.vasut+renesas@mailbox.org>
-
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162a ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by:
Marek Vasut <marek.vasut+renesas@mailbox.org>
-
- Aug 25, 2023
-
-
This field is only present when a CONFIG is set. To avoid annoying #ifdefs in the source code, add accessors. Update all code to use it. Note that the accessor is optional. It can be omitted if it is known that the option is enabled. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Aug 19, 2023
-
-
At present listing a partition produces lots of errors about this filesystem: => part list mmc 4 cannot find valid erofs superblock cannot find valid erofs superblock cannot read erofs superblock: -5 [9 more similar lines] Use debugging rather than errors when unable to find a signature, as is done with other filesystems. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-
- Aug 14, 2023
-
-
The product of two 32 bit integers is a 32 bit integer. Hence clustcount * bytesperclust may overflow on > 4 GiB devices. Change the type of clustcount. Fixes: cb8af8af ("fs: fat: support write with non-zero offset") Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-
- Aug 08, 2023
-
-
The btrfs_decompress() function mostly (u32)-1 on error but it can also return -EPERM or other kernel error codes from zstd_decompress(). The "ret" variable is an int, so we could just check for negatives. Signed-off-by:
Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
This line break is not done correctly. We don't want to have all those tabs in the printed output. Signed-off-by:
Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
If btrfs_read_fs_root() fails with -ENOENT, then we go to the next entry. Fine. But if it fails for a different reason then we need to clean up and return an error code. In the current code it doesn't clean up but instead dereferences "root" and crashes. Signed-off-by:
Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by:
Marek Behún <kabel@kernel.org> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
- Aug 07, 2023
-
-
In [1] Sam points out an assertion does not hold true for 32-bit platforms, which only impacts Large File Support (LFS) API usage in erofs-utils according to Xiang [2]. We don't think these APIs are used in u-boot and this restriction could be safely removed. [1] https://lists.denx.de/pipermail/u-boot/2023-July/524679.html [2] https://lists.denx.de/pipermail/u-boot/2023-July/524727.html Fixes: 3a21e92f ("fs/erofs: Introduce new features including ztailpacking, fragments and dedupe") Signed-off-by:
Yifan Zhao <zhaoyifan@sjtu.edu.cn> Tested-by:
Sam Edwards <CFSworks@gmail.com>
-
- Aug 03, 2023
-
-
The FAT file systems uses character '\xe5' to mark a deleted directory entry. If a file name starts with this character, it is substituted by '\x05' in the directory entry. While (signed char)'\xe5' is a negative number 0xe5 is a positive integer number. We therefore have define a constant DELETED_MARK which matches the signedness of the characters in the directory entry. Correct a comparison where we used the constant 0xe5 with the wrong sign. Use the constant aRING instead of 0x05 like in the rest of the code. Reported-by:
Dan Carpenter <dan.carpenter@linaro.org> Fixes: 57b745e2 ("fs: fat: call set_name() only once") Fixes: 28cef9ca ("fs: fat: create correct short names") Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jul 17, 2023
-
-
This patch updates erofs driver code to catch up with the latest code of erofs_utils (commit e4939f9eaa177e05d697ace85d8dc283e25dc2ed). LZMA will be supported in the separate patch later. Signed-off-by:
Yifan Zhao <zhaoyifan@sjtu.edu.cn> Reviewed-by:
Huang Jianan <jnhuang95@gmail.com>
-
Simon Glass authored
To save a few bytes, replace Error with ** and try to use the same string for multiple messages where possible. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
- Jul 16, 2023
-
-
Simon Glass authored
It seems better to call this a 'bootdev' since this is name used in the documentation. The older 'Bootdevice' name is no-longer used and may cause confusion with the 'bootdevice' environment variable. Update throughout to use bootdev. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
- Jul 14, 2023
-
-
This functionality current sits in bootstd, but it is more generally useful. Add a function to load a file into memory, allocating it as needed. Adjust bootstd to use this version. Note: Tests are added in the subsequent patch which converts the 'cat' command to use this function. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jun 12, 2023
-
-
Michal Simek authored
Use proper project name in comments, Kconfig, readmes. Reviewed-by:
Neil Armstrong <neil.armstrong@linaro.org> Acked-by:
Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Qu Wenruo <wqu@suse.com> Signed-off-by:
Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/0dbdf0432405c1c38ffca55703b6737a48219e79.1684307818.git.michal.simek@amd.com
-
- Jun 06, 2023
-
-
The ubifsload command is truncating any address above 4GiB as it casts this address to an u32, instead of using an unsigned long which most of the other load commands do. Change this to an unsigned long to allow loading into high memory for boards which use these areas. Fixes the following error: => ubifsload 0x2100000000 /boot/Image.lzma Loading file '/boot/Image.lzma' to addr 0x00000000... Unhandled exception: Store/AMO access fault Signed-off-by:
Ben Dooks <ben.dooks@sifive.com> Signed-off-by:
Ben Dooks <ben.dooks@codethink.co.uk>
-
- May 31, 2023
-
-
If a file does not exist, it should be created. Fixes: f676b451 ("fs: Add semihosting filesystem") Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-
Use asm/unaligned.h instead of linux/unaligned/access_ok.h for unaligned access. This is needed on architectures that doesn't handle unaligned accesses directly. Signed-off-by:
Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by:
Ilias Apalodimas <ilias.apalodimas@linaro.org>
-
- May 08, 2023
-
-
btrfs_read_extent_reg correctly computed the extent offset in the BTRFS_COMPRESS_NONE case, but did not account for the 'offset - key.offset' part correctly in the compressed case, making the function read incorrect data. In the case I examined, the last 4k of a file was corrupted and contained data from a few blocks prior, e.g. reading a 10k file with a single extent: btrfs_file_read() -> btrfs_read_extent_reg (aligned part loop, until 8k) -> read_and_truncate_page -> btrfs_read_extent_reg (re-reads the last extent from 8k to the end, incorrectly reading the first 2k of data) This can be reproduced as follow: $ truncate -s 200M btr $ mount btr -o compress /mnt $ pat() { dd if=/dev/zero bs=1M count=$1 iflag=count_bytes status=none | tr '\0' "\\$2"; } $ { pat 4K 1; pat 4K 2; pat 2K 3; } > /mnt/file $ sync $ filefrag -v /mnt/file File size of /mnt/file is 10240 (3 blocks of 4096 bytes) ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 2: 3328.. 3330: 3: last,encoded,eof $ umount /mnt Then in u-boot: => load scsi 0 2000000 file 10240 bytes read in 3 ms (3.3 MiB/s) => md 2001ff0 02001ff0: 02020202 02020202 02020202 02020202 ................ 02002000: 01010101 01010101 01010101 01010101 ................ 02002010: 01010101 01010101 01010101 01010101 ................ (02002000 onwards should contain '03' pattern but went back to 01, start of the extent) After patch, data is read properly: => md 2001ff0 02001ff0: 02020202 02020202 02020202 02020202 ................ 02002000: 03030303 03030303 03030303 03030303 ................ 02002010: 03030303 03030303 03030303 03030303 ................ Note that the code previously (before commit e3427184 ("fs: btrfs: Implement btrfs_file_read()")) did not split that read in two, so this is a regression even if the previous code might not have been handling offsets correctly either (something that booted now fails to boot) Fixes: a26a6bed ("fs: btrfs: Introduce btrfs_read_extent_inline() and btrfs_read_extent_reg()") Signed-off-by:
Dominique Martinet <dominique.martinet@atmark-techno.com> Reviewed-by:
Qu Wenruo <wqu@suse.com>
-
- Apr 25, 2023
-
-
yaffsfs_deviceList is only referenced in yaffsfs.c Signed-off-by:
Bin Meng <bmeng@tinylab.org>
-
- Mar 30, 2023
-
-
The deletion process handles special case for symlinks whose target are small enough that it fits in struct ext2_inode.b.symlink. So no block had been allocated. But the check of file type wrongly considered regular files as symlink. So, no block was freed. So, the EXT4 partition could be corrupted because of no free block available. Signed-off-by:
Corentin GUILLEVIC <corentin.guillevic@smile.fr>
-
Do not mangle lower or mixed case filenames which fit into the upper case 8.3 short filename. This ensures FAT standard compatible short filenames (SFN) to support systems without long filename (LFN) support like boot roms (ex. SFN BOOT.BIN instead of BOOT~1.BIN for LFN boot.bin). Signed-off-by:
Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
-
- Mar 22, 2023
-
-
No need to mount a too small partition to handle a EXT4 file system. This patch add a test on partition size before to read the SUPERBLOCK_SIZE buffer and avoid error latter in fs_devread() function. Signed-off-by:
Patrick Delaunay <patrick.delaunay@foss.st.com>
-
- Feb 23, 2023
-
-
[BUG] There is a bug report that btrfs driver caused hang during file read: This breaks btrfs on the HiFive Unmatched. => pci enum PCIE-0: Link up (Gen1-x8, Bus0) => nvme scan => load nvme 0:2 0x8c000000 /boot/dtb/sifive/hifive-unmatched-a00.dtb [hangs] [CAUSE] The reporter provided some debug output: read_extent_data: cur=615817216, orig_len=16384, cur_len=16384 read_extent_data: btrfs_map_block: cur_len=479944704; ret=0 read_extent_data: ret=0 read_extent_data: cur=615833600, orig_len=4096, cur_len=4096 read_extent_data: btrfs_map_block: cur_len=479928320; ret=0 Note the second and the last line, the @cur_len is 450+MiB, which is almost a chunk size. And inside __btrfs_map_block(), we limits the returned value to stripe length, but that's depending on the chunk type: if (map->type & (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID1C3 | BTRFS_BLOCK_GROUP_RAID1C4 | BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6 | BTRFS_BLOCK_GROUP_RAID10 | BTRFS_BLOCK_GROUP_DUP)) { /* we limit the length of each bio to what fits in a stripe */ *length = min_t(u64, ce->size - offset, map->stripe_len - stripe_offset); } else { *length = ce->size - offset; } This means, if the chunk is SINGLE profile, then we don't limit the returned length at all, and even for other profiles, we can still return a length much larger than the requested one. [FIX] Properly clamp the returned length, preventing it from returning a much larger range than expected. Reported-by:
Andreas Schwab <schwab@linux-m68k.org> Signed-off-by:
Qu Wenruo <wqu@suse.com>
-