| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these tests create a md(4) device backed by a makefs-generated
image, then import the pool, using the md device as a pool vdev. When
a test finishes, it destroys the pool, then destroys the md device.
Once in a while md device destruction fails with EBUSY. This happens
when a GEOM consumer is holding the device open; kern_mddetach_locked()
simply fails if any consumers are present. zpool destruction is
synchronous so ZFS is innocent, rather, the problem seems to be that
GEOM re-tastes the device after the zpool reference goes away. This
operation creates a transient reference that causes the spurious
failure.
Use "mdconfig -o force" to work around this.
MFC after: 2 weeks
|
| |
|
|
|
|
| |
Reviewed by: ziaee
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54538
|
| |
|
|
| |
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a variable for mtree that includes the DEFAULT_MTREE_KEYWORDS, in
order to avoid missing the important "time" keyword or passing an
unimplemented "nlink" keyword.
Unskip the "failing" tests, and comment out the specific failing checks,
these will be addressed (or at least discussed) in a different revision.
For MS-DOS tests, use an even value timestamp, as precision is 2s.
For ZFS tests, use import_image instead of mount_image consistently.
Reviewed by: bnovkov, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54429
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As stated in the manual page:
-F is almost certainly not the option you are looking for. To
create an image from a list of files in an mtree format manifest,
specify it as the last argument on the command line, not as the
argument to -F.
This change does exactly that. Also bug #192839 has already been fixed.
Reviewed by: ngie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54428
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleanup and remove default atf_check flags for clarity. The following
two lines are equivalent:
atf_check $cmd
atf_check -s exit:0 -e empty -o empty $cmd
Update the links to the reference documents.
Remove the D_flag_cleanup function, as common_cleanup() for these
particular set of tests does two things:
1. Unmount the md(4) device.
2. Destroy the md(4) device.
Essentially, one should only call common_cleanup() if the test body
invokes mount_image(). This is not the case for D_flag_body().
No functional changes intended.
Reviewed by: ngie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54427
|
| |
|
|
|
|
|
|
|
|
| |
The test makefs_zfs_tests:file_extend is timing out on ci.freebsd.org.
Double the default timeout to allow it to finish.
Reported by: Jenkins
Reviewed by: asomers
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54425
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The test makefs_zfs_tests:compression is timing out on ci.freebsd.org.
Double the default timeout to allow it to finish.
While here, check if the file exists before cleaning up, otherwise, cat
may fail.
Reported by: Jenkins
Reviewed by: asomers
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54424
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mark `direntry::deName` as `__non_string`, to avoid warnings from clang
21 similar to:
usr.sbin/makefs/msdos/msdosfs_vnops.c:512:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
512 | { ". ", /* the . entry */
| ^~~~~~~~~~~~~
usr.sbin/makefs/msdos/msdosfs_vnops.c:522:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
522 | { ".. ", /* the .. entry */
| ^~~~~~~~~~~~~
MFC after: 3 days
|
| |
|
|
|
|
|
| |
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Pull Request: https://github.com/freebsd/freebsd-src/pull/1870
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building an ffs image containing large file(s), space requirements
were calculated incorrectly yielding a bigger image than necessary.
The reason is that amount of indirect blocks estimation was done wrong:
- single indirect block was treated as it can hold just 12 data blocks
- nested indirect blocks were not taken into account at all
Add support for indirect blocks and fix another tiny bug with
underestimated space requirement for files with size between
(UFS_NDADDR-1)*blksz+fragsz ... (UFS_NDADDR)*blksz requesting N>1
fragments instead of a whole block.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D52120
|
| |
|
|
|
|
|
|
|
|
|
| |
The shift used to calculate uberblock location depends both
on minimum size (UBERBLOCK_SHIFT) and MAX_UBERBLOCK_SHIFT.
Since makefs defaults to use ashift 12, it incidentally
does get the correct size, but ashift 9 does not work with
current code.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51860
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The dataset mountpoints get link count and size calculated by
content of dataset root directory, but this will break libzfs
dir_is_empty_stat() test.
For fix, we need to check if the directory is mountpoint for
dataset, and calculate the link count and size accordingly.
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D51593
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
zfs/fs.c:
zfs/objset.c:
zfs/vdev.c:
zfs/zap.c:
Add include sys/param.h
dsl_dir_alloc() needs to set parent = NULL to silence warning
about 'parent' may be used uninitialized. Warning is given because
we break the loop when nextdir == NULL and parent was not previously set.
(it should not happen, but compiler does not know that).
zap_add() and zap_fat_write_array_chunk() takes uint8_t *, use type
cast.
zap_fat_write_array_chunk() should check sz for 0 to avoid
use of uninitialized pointer.
unchecked function returns.
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D51592
|
| |
|
|
|
|
|
|
| |
Use the script PID as a pool GUID. This way, tests running in parallel
will have pool GUIDs that won't collide, and the tests no longer need to
be serialized.
MFC after: 1 month
|
| |
|
|
|
|
|
| |
This will be used by the test suite to enable running makefs/zfs tests
in parallel.
MFC after: 1 month
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
makefs currently does not implement compression for ZFS datasets, as
doing so seems somewhat fraught with compatibility issues. As a result,
the root dataset has compression disabled, and all others inherit from
that.
However, it may be useful to enable compression for new files once the
generated pool is actually imported. Thus, implement a per-data
compression option. By default, compression is inherited from the
parent dataset and disabled on the root dataset.
Add a regression test.
PR: 288241
MFC after: 1 month
|
| |
|
|
|
| |
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
| |
Fix a UBSAN-reported error in `ffs_make_dirbuf` where a zero offset
gets applied to a NULL pointer.
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51037
Reviewed by: emaste, mckusick
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets other bits of userspace expose these various definitions too.
In particular, this will be used by libprocstat so it can stop defining
_KERNEL.
The function prototypes surely won't be useful in other contexts, but
the various types are, and it's not worth hiding the prototypes unless
they end up causing issues, but so long as they aren't called they
shouldn't be a problem.
Note the MAKEFS define continues to exist, but only for use in
newfs_msdos, as those sources are reused by makefs with some changed
behaviour.
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D50718
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the unlikely event of a hash collision, the collision differentiator
is used to create a unique lookup key for ZAP entries. While the fat
ZAP implementation in makefs implemented this, the micro ZAP
implementation did not, so it's possible to end up with collisions in
directory entries. These are caught deterministically by OpenZFS, but
the result is a panic.
Implement a simple differentiator by simply assigning a unique value to
each ZAP entry. This scheme works since the 16-bit space of
differentiators is larger than the maximum number of entries in a micro
ZAP. (While the on-disk encoding provides 32 bits of space for the
differentiator, the in-memory representation of micro ZAP entries is
smaller.)
PR: 287482
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
| |
Add tests for the -T flag to each makefs backend. This includes tests
for both mtree and directory scan options.
PR: 285630
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Reviewed by: markj, emaste, kevans, jlduran
Differential Revision: https://reviews.freebsd.org/D49492
|
| |
|
|
|
|
|
|
| |
PR: 285630
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D49601
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
makefs backends rely on the fsnode structure to derive most
of the information about the underlying filesystem objects.
Depending on how the image is built, the fsnode structures
are initialized in the walk_dir or read_mtree functions.
However, read_mtree fails to take timestamps passed by -T into account,
leading to nonreproducible images in backends that do not check for -T.
Fix this and make -T backend-agnostic by adding an appropriate check
in read_mtree_keywords while making sure that mtree entries can
still override -T timestamps.
PR: 285630
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D49531
|
| |
|
|
|
|
|
|
|
|
|
| |
Otherwise the output file's contents will depend on the configured time
zone.
Reviewed by: emaste
MFC after: 1 month
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50198
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When walking a directory hierarchy (as opposed to reading an mtree),
makefs builds up a tree of file nodes. Within a directory, the order of
the sibling nodes is determined by the order they're returned by
readdir(), which isn't very reproducible (e.g., depends on filesystem,
build parallelism).
Add a routine which sorts entries within a directory after its contents
have been read. This is a bit more expensive, but I wasn't able to
measure a significant runtime cost (and I don't think makefs has been
optimized very much to begin with), and we avoid this cost in mtree mode
anyway. This fixes some sources of reproducibility problems.
In mtree mode, for now we let the ordering of METALOG entries determine
the ordering in the fsnode tree. It might be worth sorting these too,
since with parallel installworld they won't have a consistent ordering,
and single-threaded installworld is pretty slow.
Reviewed by: emaste
MFC after: 1 month
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50197
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The superblock structure has space reserved for a pointer to an
in-memory structure that gets created at mount time. makefs populates
it since that simplifies code elsewhere. However, the pointer value
ends up in the output file, which breaks reproducibility.
Zero the field when writing the superblock instead, as its on-disk value
is ignored.
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50196
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux's struct stat does not have an st_flags member, but we still want
to be able to create FreeBSD disk images with non-zero st_flags. Add a
replacement member to struct fsinode to store it on Linux.
Note that we add a fallback definition of HAVE_STRUCT_STAT_ST_FLAGS for
makefs.h since etdump reaches into makefs and won't have it defined in
its CFLAGS like makefs itself does, and on FreeBSD we don't provide an
nbtool_config.h.
Note also that strtofflags is currently a stub on Linux so this doesn't
yet properly mirror the mtree, but that will change in a future commit.
Reviewed by: emaste, markj
Differential Revision: https://reviews.freebsd.org/D50078
|
| |
|
|
|
|
|
|
|
|
| |
These macros are meant to be 0/1 not undefined/1. Currently we don't
actually have nbtool_config.h included for these files so these are
always false, but that will change in a future commit and break building
on Linux where they are defined to 0.
Reviewed by: emaste, markj
Differential Revision: https://reviews.freebsd.org/D50077
|
| |
|
|
|
|
|
|
| |
Error introduced during a refactoring; cd9660_susp_initialize calls
itself recursively.
Sponsred by: The FreeBSD Foundation
Fixes: 35a2e286157a ("makefs: Record inode for all entries in mtree mode")
|
| |
|
|
|
|
| |
Reported by: rpokala
Sponsred by: The FreeBSD Foundation
Fixes: 35a2e286157a ("makefs: Record inode for all entries in mtree mode")
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rock Ridge extensions include an inode field:
"POSIX File Serial Number" shall have the same meaning as and may be
used for the st_ino field of POSIX:5.6.1. This field shall be
recorded according to ISO 9660:7.3.3. Directory Records which share
the value of this field are defined as links (see POSIX:2.2.2.17)
and, by definition, point to the same file or directory.
Previously we'd store the source file's st_ino (except that in metalog
mode we'd record 0 for files with nlink = 1). This had two issues: the
generated ISO image was nonreproducible due to the arbitrary inode
numbers, and files without hard links would falsely be detected (by
certain tools) as hard links to each other.
Note that the kernel's cd9660(5) file system ignores the Rock Ridge
PX File Serial Number, so this issue isn't observed by mounting such a
file system.
Instead of using the source inode directly, assign target inode numbers
sequentially. Use a map so that files with the same source inode (hard
links) still receive the same target inode number.
PR: 284795
PR: 285027
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49141
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tracking newer versions of C (and C++) permits assuming newer language
features in the base system. Some C11 extensions are already used in
the base system but implemented on top of GNU C extensions such as
_Alignas and _Static_assert. In some cases the fallback versions in
cdefs.h are more limited than the native C11 extensions.
Even though C11 is the next major version of C, C17 is chosen instead
since C17 does not add new features to C but merely fixes defects in
C11. It is also well supported by a wide range of clang (7.0.0+) and
GCC (8.1+) versions.
Along with changing the default, this change also removes explicit
requests for c11 via the CSTD variable in various Makefiles.
Libraries and binaries for ZFS continue to use c99.
PR: 284039 (exp-run)
Reviewed by: imp, arichardson, emaste
Differential Revision: https://reviews.freebsd.org/D43237
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each program that operates on UFS on-disk inodes defines its own
version of a dinode. They all (of necessity) define the same
layout but use different names. This change adds a definition of
a dinode (a union of a UFS1 on-disk inode and a UFS2 on-disk inode)
as well as a dinodep (a union of a pointer to a UFS1 on-disk inode
and a pointer to a UFS2 on-disk inode) in sys/ufs/ufs/dinode.h.
It then deletes the definitions of dinode and dinodep in all the
programs that operate on them and instead uses these standard
definitions.
No functional change intended.
MFC-after: 1 week
|
| |
|
|
|
|
|
|
|
|
| |
Previously, anything other than a regular file, directory or symlink
would cause makefs to exit with an assertion failure. Make it a bit
more resilient to user error: print a warning and skip the file. Add a
regression test wherein we create an image from a devfs mount.
PR: 283583
MFC after: 2 weeks
|
| |
|
|
|
|
| |
No functional change intended.
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we could create cd9660 images with duplicate short (level 2)
names.
cd9660_level2_convert_filename used a 30-character limit (for files and
directories), not including the '.' separator. cd9660_rename_filename
used a 31-character limit, including the '.'. Directory names 31
characters or longer (without '.') were shortened to 30 characters, and
if a collision occurred cd9660_rename_filename uniquified them starting
with the 31st character. Unfortunately the directory record's name_len
was already set, so the unique part of the name was stripped off.
Directories are up to 31 d-characters (i.e., A-Z 0-9 and _); there is no
provision for a '.' in a directory name. Increase the name length limit
to 31 for directories, and exclude '.'s.
This name mapping and deduplication code is still fragile and convoluted
and would beenfit from a more holistic effort.
PR: 283238, 283112
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48251
|
| |
|
|
|
|
|
|
|
| |
This test is inside the else block for `if (*oldname == '.')`, so
*oldname cannot be '.' here.
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48243
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The maximum length is 30 characters for name and extension, two
separators (. and ;) and 5 characters for file version from 1 to 32767,
which is 37 characters. Add one for the null term as we treat these
buffers as C strings.
This is not an issue in practice, as the file version is always 1 in
makefs.
While here, drop `_WITH_PADDING` from the macro name and update the
previously-unused ISO_FILENAME_MAXLENGTH for the corrected length.
A 0x00 padding byte is used by ISO9660 when needed for alignment, which
can be the null byte at the end of the string.
Use sizeof where appropriate.
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48193
|
| |
|
|
|
| |
Obtained from: OpenBSD c8f48d9b1ea9
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
| |
Reviewed by: kevans
Obtained from: OpenBSD d95291fdb2dc
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48178
|
| |
|
|
|
| |
PR: 282832
MFC after: 1 week
|
| |
|
|
|
|
|
| |
This should have been done with commit d9fe71828797 but was missed.
Fixes: d9fe71828797 ("makefs: Remove the warning printed when makefs -t zfs is used")
MFC after: 3 days
|
| |
|
|
| |
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
By default, OpenZFS will perform metadata verification of the most
recent TXGs, but this can be very slow since all data in a pool
generated by makefs was logically written in a single transaction.
Avoid triggering this verification by default, but add an option to
restore the previous behaviour and enable it in regression test cases.
Reported by: cperciva
Tested by: cperciva (previous version)
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
| |
We haven't seen bug reports relating to this feature for a while, so
stop printing a warning.
Reviewed by: cperciva
MFC after: 2 weeks
|
| | |
|
| |
|
|
|
|
|
| |
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
| |
Some ZAPs are used to represent sets, in which keys and values are the
same. Add a helper function for this case. No functional change
intended.
MFC after: 1 week
|