- May 06, 2024
-
-
Tom Rini authored
Remove <common.h> from all "fs/" files and when needed add missing include files directly. Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Apr 18, 2024
-
-
This patch adds DEFLATE compression algorithm support. It's a good choice to trade off between compression ratios and performance compared to LZ4. Alternatively, DEFLATE could be used for some specific files since EROFS supports multiple compression algorithms in one image. Signed-off-by:
Jianan Huang <jnhuang95@gmail.com> Reviewed-by:
Gao Xiang <hsiangkao@linux.alibaba.com>
-
- Apr 17, 2024
-
-
The FAT specification requires that the change date is set. If a DM RTC device exists, set the creation and change date to the current date when updating the directory entry. Otherwise use the date 2020-01-01. Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-
The month is stored in 5 - 8. We need to shift it by 5 bits. Cf. Microsoft FAT Specification, 2005-08-30 Fixes: 13c11c66 ("fs: fat: add file attributes to struct fs_dirent") Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by:
Alexander Dahl <ada@thorsis.com> Reviewed-by:
Ilias Apalodimas <ilias.apalodimas@linaro.org>
-
Without this patch, the while loop being modified goes on infinitely, but with the patch I am able to boot linux on zfs on a jetson tx2 nx. It seems like this code was never tested because the logic is clearly wrong. The function do_div(a,b) does a division that modifies the first parameter to have a = a / b, and returns the remainder of the division. So clearly in the usual case when file->offset = 0, the line "blkid = do_div(blkid, blksz);" just results in blkid being set to zero on every iteration of the loop, rather than being incremented as blocks are read. Hence the zeroth block is read over and over and this becomes an infinite loop. So instead capture the remainder of the division in a "blkoff" variable, and use that to properly calculate the memory address to move from in memmove() below. For example, if file->offset were 1337, on the first iteration of the loop blkid would be 0 and blkoff would be 1337. If the blksz is 131072 (as it was for me), that amount of data would be copied into data->file_buf. movesize would be 131072 - 1337 = 129735 so 129735 bytes would be moved into buf. On the second iteration of the loop (assuming there is one), red would be 129735, blkid would be 1, blkoff would be 0, and 131072 bytes would be copied into buf. And so on... Signed-off-by:
Phaedrus Leeds <mwleeds@mailtundra.com>
-
As evidenced by how other filesystems handle it, a return value of 0 from fs_devread() means failure; nonzero means success. The opposite assumption was being made in zfs.c for the use of zfs_devread() so fix the confusion by making zfs_devread() return 0 on success. It probably doesn't make sense to change the handling of zfs_devread() in zfs.c instead, because as it is it matches the semantics of the other functions there. Signed-off-by:
Phaedrus Leeds <mwleeds@mailtundra.com>
-
Without this patch, when trying to boot zfs using U-Boot on a Jetson TX2 NX (which is aarch64), I get a CPU reset error like so: "Synchronous Abort" handler, esr 0x96000021 elr: 00000000800c9000 lr : 00000000800c8ffc (reloc) elr: 00000000fff77000 lr : 00000000fff76ffc x0 : 00000000ffb40f04 x1 : 0000000000000000 x2 : 000000000000000a x3 : 0000000003100000 x4 : 0000000003100000 x5 : 0000000000000034 x6 : 00000000fff9cc6e x7 : 000000000000000f x8 : 00000000ff7f84a0 x9 : 0000000000000008 x10: 00000000ffb40f04 x11: 0000000000000006 x12: 000000000001869f x13: 0000000000000001 x14: 00000000ff7f84bc x15: 0000000000000010 x16: 0000000000002080 x17: 00000000001fffff x18: 00000000ff7fbdd8 x19: 00000000ffb405f8 x20: 00000000ffb40dd0 x21: 00000000fffabe5e x22: 000000ea77940000 x23: 00000000ffb42090 x24: 0000000000000000 x25: 0000000000000000 x26: 0000000000000000 x27: 0000000000000000 x28: 0000000000bab10c x29: 00000000ff7f85f0 Code: d00001a0 9103a000 94006ac6 f9401ba0 (f9400000) Resetting CPU ... This happens when be64_to_cpu() is called on a value that exists at a memory address that's 4 byte aligned but not 8 byte aligned (e.g. an address ending in 04). The call stack where that happens is: check_pool_label() -> zfs_nvlist_lookup_uint64(vdevnvlist, ZPOOL_CONFIG_ASHIFT,...) -> be64_to_cpu() Signed-off-by:
Phaedrus Leeds <mwleeds@mailtundra.com> Fixes: 4d3c95f5 ("zfs: Add ZFS filesystem support")
-
Signed-off-by:
Phaedrus Leeds <mwleeds@mailtundra.com>
-
This code was hitting the error code path whenever malloc() succeeded rather than when it failed, so presumably this part of the code hasn't been tested. I had to apply this fix (and others) to get U-Boot to boot from ZFS on an Nvidia Jetson TX2 NX SoM (an aarch64 computer). Signed-off-by:
Phaedrus Leeds <mwleeds@mailtundra.com>
-
- Apr 10, 2024
-
-
U-Boot only knows absolute file paths. It is inconsistent to require that saving to an ext4 file system should use a leading '/' while reading does not. Remove the superfluous check. Reported-by:
Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by:
Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by:
Patrice Chotard <patrice.chotard@foss.st.com>
-
When accessing an ext2 system the message "File System is consistent\n" is shown after each write. This is superfluous noise. Only write a debug message. Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-
When a file is created in the linux and corresponding file permission is set, if the file needs to be modified in uboot during the startup process, the modified file permission will be reset to 755. Therefore, when the ext4fs_write() function is called, if the file already exists, the file permission of the new file is equal to the file permission of the existing file.
-
- Mar 04, 2024
-
-
While fat_exists() reports directories and files as existing ext4fs_exists() only recognizes files. This lead to errors when using systemd-boot with an ext4 file-system. Change ext4fs_exists() to find any type of inode: files, directories, symbolic links. Fixes: a1596438 ("ext4fs ls load support") Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-
It was only included by a single board which doesn't appear to have ever used it for any default use cases so drop the filesystem now that isn't used by any in-tree configurations. Signed-off-by:
Peter Robinson <pbrobinson@gmail.com>
-
- Jan 17, 2024
-
-
Now it is clear that the feature actually depends on efi interfaces, not "bootefi" command. efi_set_bootdev() will automatically be nullified if necessary efi component is disabled. Signed-off-by:
AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- 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>
-