OpenZFS/src 6ad9c3f.github/workflows/scripts qemu-6-tests.sh

CI: Fix race caused by shared ctr file updates

CTR is shared between the VMs and used as a global counter.  This 
uncoordinated shared access can result in a CI failure due to the
racing updates.  From the log:

`qemu-6-tests.sh: line 27: 1`
`6: syntax error in expression
(error token is "6")`

Resolve the issue by using separate ctr files by appending the ID.
The output now prints the total test cases count along with each VMs
individual count.

Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: tiehexue <tiehexue at hotmail.com>
Closes #18778
DeltaFile
+15-7.github/workflows/scripts/qemu-6-tests.sh
+15-71 files

OpenZFS/src 63385edconfig kernel-idmap_mnt_api.m4 kernel.m4, module/os/linux/zfs zpl_super.c

config: remove HAVE_IDMAP_MNT_API check

The check itself is not needed, since we only use it to decide whether
or not to use a define, we can just test the define anyway.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-25config/kernel-idmap_mnt_api.m4
+0-2config/kernel.m4
+1-1module/os/linux/zfs/zpl_super.c
+1-283 files

OpenZFS/src d09f952config kernel-acl.m4, module/os/linux/zfs zpl_inode.c

config/acl: narrow checks to userns inode->dentry change

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+9-25config/kernel-acl.m4
+1-1module/os/linux/zfs/zpl_inode.c
+10-262 files

OpenZFS/src 889966cconfig kernel-mkdir.m4, module/os/linux/zfs zpl_ctldir.c zpl_inode.c

config/mkdir: narrow checks to dentry return

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+3-3config/kernel-mkdir.m4
+2-2module/os/linux/zfs/zpl_ctldir.c
+2-2module/os/linux/zfs/zpl_inode.c
+7-73 files

OpenZFS/src 98addf6config kernel-tmpfile.m4, module/os/linux/zfs zpl_inode.c

config/tmpfile: narrow checks to userns dentry->file change

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+18-50config/kernel-tmpfile.m4
+6-6module/os/linux/zfs/zpl_inode.c
+24-562 files

OpenZFS/src 61cb6c7config kernel-xattr-handler.m4 kernel-mkdir.m4

config: remove obsolete idmap/userns checks

Everything has been converted to the new helpers built on the "global"
idmap/userns checks, so we can get rid of all the individual function
checks.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-91config/kernel-xattr-handler.m4
+0-84config/kernel-mkdir.m4
+0-81config/kernel-inode-create.m4
+0-68config/kernel-inode-getattr.m4
+0-66config/kernel-inode-setattr.m4
+0-64config/kernel-is_owner_or_cap.m4
+0-4547 files not shown
+4-79913 files

OpenZFS/src 5c99c3ainclude/os/linux/kernel/linux xattr_compat.h

xattr: use generic checks for ZPL_XATTR_SET_WRAPPER selection

We can't (yet) replace these wrappers but we can use the generic checks
as selector, obsoleting more configure checks.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+3-22include/os/linux/kernel/linux/xattr_compat.h
+3-221 files

OpenZFS/src 1f9f7f6include/os/linux/kernel/linux vfs_compat.h, module/os/linux/zfs zfs_acl.c

zpl_generic_permission: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+13-0include/os/linux/kernel/linux/vfs_compat.h
+1-6module/os/linux/zfs/zfs_acl.c
+14-62 files

OpenZFS/src c13174ainclude/os/linux/kernel/linux vfs_compat.h, include/os/linux/zfs/sys zpl.h

zpl_inode_owner_or_capable: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+13-0include/os/linux/kernel/linux/vfs_compat.h
+0-12module/os/linux/zfs/zpl_xattr.c
+0-10include/os/linux/zfs/sys/zpl.h
+13-223 files

OpenZFS/src 9b89e2finclude/os/linux/kernel/linux vfs_compat.h, include/os/linux/zfs/sys zpl.h

zpl_setattr_prepare: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+13-0include/os/linux/kernel/linux/vfs_compat.h
+0-10include/os/linux/zfs/sys/zpl.h
+0-6module/os/linux/zfs/zpl_inode.c
+13-163 files

OpenZFS/src 5d83dfainclude/os/linux/kernel/linux vfs_compat.h, module/os/linux/zfs zpl_ctldir.c zfs_vnops_os.c

zpl_generic_fillattr: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+3-40module/os/linux/zfs/zpl_ctldir.c
+17-22include/os/linux/kernel/linux/vfs_compat.h
+1-4module/os/linux/zfs/zfs_vnops_os.c
+21-663 files

OpenZFS/src 0b6b2e9include/os/linux/zfs/sys zfs_vnops_os.h, module/os/linux/zfs zpl_inode.c zpl_ctldir.c

zfs_getattr_fast: single version

The caller always has an idmap of some sort, so we can just call it directly.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-6module/os/linux/zfs/zpl_inode.c
+0-6module/os/linux/zfs/zpl_ctldir.c
+0-4include/os/linux/zfs/sys/zfs_vnops_os.h
+0-4module/os/linux/zfs/zfs_vnops_os.c
+0-204 files

OpenZFS/src 0897997module/os/linux/zfs zpl_inode.c

zfs_setattr_idmap: always use idmap version

We added zfs_setattr_idmap in dee19fae05; just use it for all cases now
that we always have an idmap available.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-6module/os/linux/zfs/zpl_inode.c
+0-61 files

OpenZFS/src 0011703include/os/linux/kernel/linux vfs_compat.h, module/os/linux/zfs zpl_ctldir.c zpl_inode.c

zpl_inode: use ZPL_IDMAP_IOP_DEFINE for getattr/setattr callbacks

ZPL_GETATTR_WRAPPER and ZPL_SETATTR_WRAPPER were earlier concept of
these defines that didn't actually do enough. Since these are just
regular inode_operations callbacks, we can use ZPL_IDMAP_IOP_DEFINE for
those too and remove the old wrappers.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+9-42module/os/linux/zfs/zpl_ctldir.c
+5-24module/os/linux/zfs/zpl_inode.c
+0-28include/os/linux/kernel/linux/vfs_compat.h
+14-943 files

OpenZFS/src e436d60module/os/linux/zfs zpl_inode.c zpl_ctldir.c

zpl_inode: use ZPL_IDMAP_IOP_DEFINE for iops callbacks

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+39-117module/os/linux/zfs/zpl_inode.c
+8-31module/os/linux/zfs/zpl_ctldir.c
+47-1482 files

OpenZFS/src faf314dinclude/os/linux/kernel/linux idmap_compat.h

idmap_compat: macros for handling idmap types in iops callbacks

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+83-0include/os/linux/kernel/linux/idmap_compat.h
+83-01 files

OpenZFS/src 0a3241finclude/os/linux/spl/sys cred.h types.h, module/os/linux/spl spl-cred.c

spl/cred: move remaining idmap compat, use generic checks

Move the remaining idmap/cred checks from sys/types.h to sys/cred.h, the
only direct user, and change them to use the generic macros.

These should be folded back into idmap_compat at some point but they
need careful auditing first.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+25-4include/os/linux/spl/sys/cred.h
+0-22include/os/linux/spl/sys/types.h
+1-1module/os/linux/spl/spl-cred.c
+26-273 files

OpenZFS/src ed11654include/os/linux/spl/sys cred.h, module/os/linux/zfs zpl_inode.c zfs_vnops_os.c

linux/zpl: standardise on 'idmap' nomenclature

Wherever we use zidmap_t, name it idmap, since that is its purpose and
we have no idea whether or not there's a user_namespace or a mnt_idmap
under there.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+46-46module/os/linux/zfs/zpl_inode.c
+34-34module/os/linux/zfs/zfs_vnops_os.c
+26-26module/os/linux/zfs/zpl_ctldir.c
+26-26module/os/linux/zfs/zfs_acl.c
+16-16include/os/linux/spl/sys/cred.h
+12-12module/os/linux/zfs/zpl_xattr.c
+160-1604 files not shown
+175-17510 files

OpenZFS/src 0cfe9dcinclude/os/linux Makefile.am, include/os/linux/kernel/linux idmap_compat.h

idmap_compat: types and defines for idmap/userns compat

Setting up the header where we'll do all our idmap compat stuff. To
start, lift zidmap_t and zfs_init_idmap out from sys/types.h, and switch
zidmap_t type switch to use the generic checks.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+78-0include/os/linux/kernel/linux/idmap_compat.h
+0-5include/os/linux/spl/sys/types.h
+1-0include/os/linux/spl/sys/cred.h
+1-0include/os/linux/zfs/sys/zpl.h
+1-0include/os/linux/Makefile.am
+81-55 files

OpenZFS/src 2228984config kernel-idmap.m4 kernel.m4

config: detect idmap method via generic_permission test

Since the switch from implicit to explicit userns, and to idmap,
happened right across the kernel in major releases, so it is enough to
use a single test and apply the results everywhere.

generic_permission() is a nice simple function with a simple interface,
so useful for an unambiguous test.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+64-0config/kernel-idmap.m4
+2-0config/kernel.m4
+66-02 files

OpenZFS/src d896258include/os/linux/zfs/sys zpl.h, module/os/linux/zfs zpl_xattr.c zpl_inode.c

zpl_inode: move zpl_set_acl/zpl_get_acl from zpl_xattr

These are inode operations functions, better here than there. This will
make it easier to clean them up with the rest, and keeps the actual
implementation functions tidier.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+13-55module/os/linux/zfs/zpl_xattr.c
+42-0module/os/linux/zfs/zpl_inode.c
+2-19include/os/linux/zfs/sys/zpl.h
+57-743 files

OpenZFS/src 7d88285config kernel-setattr-prepare.m4, include/os/linux/kernel/linux vfs_compat.h

config: remove HAVE_SETATTR_PREPARE_NO_USERNS

The change it checks for was introduced in 4.9
(torvalds/linux at 31051c85b5e2a), well beyond the versions we support.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-24config/kernel-setattr-prepare.m4
+0-13include/os/linux/kernel/linux/vfs_compat.h
+0-372 files

OpenZFS/src bff8c36config kernel-inode-getattr.m4, include/os/linux/kernel/linux vfs_compat.h

config: remove HAVE_PATH_IOPS_GETATTR

The change its checking for was introduced in 4.11
(torvalds/linux at a528d35e8bfcc). This syncs up with the
HAVE_*_IOPS_SETATTR checks.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-30config/kernel-inode-getattr.m4
+8-15include/os/linux/kernel/linux/vfs_compat.h
+8-452 files

OpenZFS/src cdf5121config kernel-rename.m4, module/os/linux/zfs zpl_ctldir.c zpl_inode.c

zpl_inode: remove zpl_rename no-flags variants

Removed in 4.9.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-27config/kernel-rename.m4
+3-20module/os/linux/zfs/zpl_ctldir.c
+3-20module/os/linux/zfs/zpl_inode.c
+6-673 files

OpenZFS/src 2289f4ctests/test-runner/bin zts-report.py.in, tests/zfs-tests/tests/functional/cli_root/zpool_initialize zpool_initialize_import_export.ksh zpool_initialize_suspend_resume.ksh

ZTS: stop zpool_initialize tests racing initialize to completion

zpool_initialize_import_export and zpool_initialize_suspend_resume start
initializing a one-disk pool, wait a fixed couple of seconds, and then
expect initializing to still be running so it can be observed across an
export/import and suspended.  On a small or fast vdev the default 1 MiB
initialize chunk lets the whole disk finish within that window, after
which "zpool initialize -s" fails with "there is no active
initialization" and the test fails.

Throttle initializing with zfs_initialize_chunk_size, exactly as the
zpool_wait_initialize_* tests already do, so it stays active long enough
to observe regardless of vdev size or speed.  The tunable is saved and
restored per test.  Cleanup destroys the pool before restoring the chunk
size: the initialize thread rereads zfs_initialize_chunk_size on every
write but allocates its fill buffer once at the smaller size, so raising
it back while the thread is still running would issue a write larger
than that buffer.


    [13 lines not shown]
DeltaFile
+19-0tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export.ksh
+19-0tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh
+0-4tests/test-runner/bin/zts-report.py.in
+38-43 files

OpenZFS/src 5be00eatests/zfs-tests/tests/functional/migration setup.ksh

ZTS: migration/setup: clear stale zfs_member label before new_fs

During a full ZTS run functional/migration/setup fails intermittently
when it mounts the non-ZFS device.  That device is often one an earlier
test used as a pool vdev.  'zpool destroy' leaves the vdev labels in
place and new_fs only overwrites the front of the device, so the
trailing labels can survive.  libblkid then probes the device as
ambiguous (both the new filesystem and zfs_member) and the
auto-detecting mount refuses, which setup reports as a spurious failure.

Wipe any residual signatures with wipefs before laying down the new
filesystem so the device carries a single, unambiguous type, and let
udev settle before the mount.  Skip the wipe in the single-disk case,
where the non-ZFS device is the same one the test pool was just created
on, so the live pool is left untouched.

Verified on Linux: after a pool create and destroy the scratch device
still carries a zfs_member label (blkid -p reports zfs_member); a
wipefs -a removes it so the following new_fs is the only signature and

    [6 lines not shown]
DeltaFile
+20-0tests/zfs-tests/tests/functional/migration/setup.ksh
+20-01 files

OpenZFS/src 7d565cdcmd/zfs zfs_main.c, man/man8 zfs-bookmark.8

zfs bookmark: add recursive (-r) bookmark creation

"zfs snapshot -r" and "zfs destroy -r" already operate recursively, but
there was no way to create bookmarks for a recursive snapshot in one
step, so users had to script a loop over every dataset.

Add a -r flag to "zfs bookmark" that, given a snapshot source, creates
a bookmark of that snapshot on every descendant dataset that has it.
Descendants that lack the snapshot (for example one created after the
recursive snapshot) or that are still inconsistent are skipped instead
of failing the whole request, mirroring how "zfs snapshot -r" gathers
its targets.  The pairs are submitted to lzc_bookmark() in a single
call and any per-dataset failures are reported individually.  The -r
flag requires a snapshot source; a bookmark source is rejected.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: MorganaFuture <103630661+MorganaFuture at users.noreply.github.com>
Closes #9460
Closes #18763
DeltaFile
+137-43cmd/zfs/zfs_main.c
+94-0tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_recursive.ksh
+9-0man/man8/zfs-bookmark.8
+1-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+242-445 files

OpenZFS/src 74b796bcmd/zstream zstream_dump.c zstream_dump.h

zstream: open up dump API to non-dump subcommands

The upcoming `zstream raw` would like to dump records as part of its
operation when a `-v` flag is passed.

This PR adds `zstream_dump.h` and publicly declares the
`serial_dump_records()` chain module for access by other parts of
zstream. It also makes a couple of other changes to make the dump
module more friendly toward clients.

- The record-type table no longer has to be passed into
  `zstream_dump_records()` as a context struct. It's now a file static.

- `zstream dump` has command-line options for "verbose", "very verbose",
  and "dump data", which each enable one or more functions. This patch
  replaces the generic CA_VERBOSE and CA_VERY_VERBOSE internal flags
  with options that request specific behaviors:

```

    [17 lines not shown]
DeltaFile
+57-35cmd/zstream/zstream_dump.c
+36-0cmd/zstream/zstream_dump.h
+15-13cmd/zstream/zstream_chain.h
+1-0cmd/zstream/Makefile.am
+1-0cmd/zstream/zstream_modules.h
+110-485 files

OpenZFS/src 0d0eae2cmd/zpool zpool_main.c, man/man8 zpool-scrub.8

implement thorough scrub support (zpool scrub -t)

This introduces the -t (thorough) flag to 'zpool scrub' command.
A thorough scrub decrypts and decompresses blocks as they are read,
allowing ZFS to catch rare corruption scenarios where the block's
checksum matches the data on disk, but the block fails to decrypt
or decompress.

For encrypted datasets, the keys must be loaded to perform a thorough
scrub. If the keys are not loaded, or are unloaded while the scrub is
in progress, the scrub will fall back to a normal scrub
for those encrypted blocks with key unloaded.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Alek Pinchuk <Alek.Pinchuk at connectwise.com>
Closes #18474
DeltaFile
+218-66module/zfs/dsl_scan.c
+197-0tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_thorough.ksh
+99-36cmd/zpool/zpool_main.c
+100-17man/man8/zpool-scrub.8
+98-17module/zfs/zfs_ioctl.c
+37-10tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh
+749-14615 files not shown
+844-16821 files

OpenZFS/src 465ed3a. AUTHORS .mailmap

mailmap/AUTHORS: update with recent new contributors

"When you rest, you are a king surveying your estate. Look at the
woodland, the peacocks on the lawn. Be the king of your own calm
kingdom."

Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18775
DeltaFile
+6-0AUTHORS
+2-0.mailmap
+8-02 files