| 5175923e | 28-Sep-2023 |
Mark Johnston <[email protected]> |
makefs/zfs: Ensure that the last block of a file has the right size
When copying a file's contents into the pool, a loop copies blocks of the maximum size (128KB), allocating space from the vdev for
makefs/zfs: Ensure that the last block of a file has the right size
When copying a file's contents into the pool, a loop copies blocks of the maximum size (128KB), allocating space from the vdev for each block. The space allocator rounds up to the nearest block size, but for files larger than the maximum size, this can result in the last block having a smaller logical size than the rest of the blocks belonging to that dnode. This violates some ZFS invariants when appending to that file.
Modify fs_populate_file() to use the same block size for the final block.
Reported by: cperciva MFC after: 1 week Sponsored by: The FreeBSD Foundation
(cherry picked from commit ef20cd33d3287ebead0d30f2e177fc57a97dc2d5)
show more ...
|
| 0074d055 | 27-Sep-2023 |
Mark Johnston <[email protected]> |
makefs/zfs: Remove a nonsensical comment
When populating files, makefs needs to copy their contents into userspace in order to compute a checksum, so copy_file_range(2) is out of the question. Thou
makefs/zfs: Remove a nonsensical comment
When populating files, makefs needs to copy their contents into userspace in order to compute a checksum, so copy_file_range(2) is out of the question. Though, it could possibly be used when building other types of filesystems.
MFC after: 1 week Sponsored by: The FreeBSD Foundation
(cherry picked from commit 60c95af88f6a63fb7c2c86c6ff9c18743f6bbf0d)
show more ...
|
| 6e011d15 | 12-Jan-2023 |
Brooks Davis <[email protected]> |
makefs: don't needlessly require directories to exist
If a type=dir entry exists and all contents are directories, files added with contents=, or symlinks with link= attributes then it doesn't need
makefs: don't needlessly require directories to exist
If a type=dir entry exists and all contents are directories, files added with contents=, or symlinks with link= attributes then it doesn't need to exist. Just let openat fail in that case. It's conceivable this will make debugging some cases weird, but it's sufficent to handle the way we add /root/.ssh in CheriBSD VM images.
This is a recommit of 794154149f95d0cbc11aade166f9da919747e397 with bugfixes.
Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38029
show more ...
|
| 79415414 | 12-Jan-2023 |
Brooks Davis <[email protected]> |
makefs: don't needlessly require directories to exist
If a type=dir entry exists and all contents are directories, files added with contents=, or symlinks with link= attributes then it doesn't need
makefs: don't needlessly require directories to exist
If a type=dir entry exists and all contents are directories, files added with contents=, or symlinks with link= attributes then it doesn't need to exist. Just let openat fail in that case. It's conceivable this will make debugging some cases weird, but it's sufficent to handle the way we add /root/.ssh in CheriBSD VM images.
Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38029
show more ...
|
| b78d5b42 | 12-Jan-2023 |
Brooks Davis <[email protected]> |
makefs: handle mtree link= for ZFS
When a link target is specified use it rather than attempting to read a potentially non-existant file.
Reviewed by: markj Differential Revision: https://reviews.f
makefs: handle mtree link= for ZFS
When a link target is specified use it rather than attempting to read a potentially non-existant file.
Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38028
show more ...
|
| c6890399 | 18-Aug-2022 |
Jessica Clarke <[email protected]> |
makefs: Fix issues building as a cross-tool on non-FreeBSD
This adds missing includes, uses the standard dirent.h rather than the BSD-specific sys/dirent.h subset (which works on macOS but not Linux
makefs: Fix issues building as a cross-tool on non-FreeBSD
This adds missing includes, uses the standard dirent.h rather than the BSD-specific sys/dirent.h subset (which works on macOS but not Linux) and works around Linux's lack of st_birthtim.
This allows usr.sbin/makefs to be added to LOCAL_XTOOL_DIRS again on macOS and Linux so that disk images can be cross-built.
Reviewed by: markj Fixes: 240afd8c1fcc ("makefs: Add ZFS support") Differential Revision: https://reviews.freebsd.org/D36135
show more ...
|
| b0ce7dfc | 18-Aug-2022 |
Jessica Clarke <[email protected]> |
makefs: Fix 32-bit issues in ZFS time attributes setting
Currently the code copies a struct timespec's raw bits as a pair of uint64_t. On 64-bit systems this has the same representation, but on 32-b
makefs: Fix 32-bit issues in ZFS time attributes setting
Currently the code copies a struct timespec's raw bits as a pair of uint64_t. On 64-bit systems this has the same representation, but on 32-bit issues there are two issues:
1. tv_sec is a time_t which is 32-bit on i386 specifically 2. tv_nsec is a long not a 64-bit integer
On i386, this means the assertion should fire as the size doesn't match. On other 32-bit systems there are 4 bytes of padding after tv_nsec, which in practice are probably 0, as this data is ultimately coming from the kernel, so it's deterministic (though the padding bytes are not required to be preserved by the compiler, so are strictly unspecified). However, on 32-bit big-endian systems, the padding bytes are in the wrong half to be harmless, resulting in the nanoseconds being multiplied by 2^32.
Fix this all by marshalling via a real uint64_t pair like is done by the real ZFS_TIME_ENCODE.
Reviewed by: markj Fixes: 240afd8c1fcc ("makefs: Add ZFS support") Differential Revision: https://reviews.freebsd.org/D36131
show more ...
|