]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agocontrib: dracut: zfs-lib: remove find_bootfs
наб [Mon, 4 Apr 2022 21:16:59 +0000 (23:16 +0200)]
contrib: dracut: zfs-lib: remove find_bootfs

Upstream-commit: dac0b0785a795efe3bbb5367af35e2c4fbe32040
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13291

2 years agocontrib: dracut: zfs-lib: simplify ask_for_password
наб [Mon, 4 Apr 2022 20:57:35 +0000 (22:57 +0200)]
contrib: dracut: zfs-lib: simplify ask_for_password

The only user is mount-zfs.sh (non-systemd systems),
so reduce it to what it needs

Upstream-commit: 5d31169d7c8810baf87f1dc778c97a7024c8c205
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13291

2 years agocontrib; dracut: flatten zfs-load-key, simplify zfs-env-bootfs
наб [Mon, 4 Apr 2022 20:52:43 +0000 (22:52 +0200)]
contrib; dracut: flatten zfs-load-key, simplify zfs-env-bootfs

Upstream-commit: fec2c613a49192942200d26bd20bf434649687b7
Upstream-change: drop 90zfs/module-setup.sh.in cleanups that don't apply
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13291

2 years agocontrib; dracut: centralise root= parsing, actually support root=s
наб [Mon, 4 Apr 2022 20:45:58 +0000 (22:45 +0200)]
contrib; dracut: centralise root= parsing, actually support root=s

So far, everything parsed root= manually, which meant that while
zfs-parse.sh was updated, and supposedly supported + -> ' ' conversion,
it meant nothing

Instead, centralise parsing, and allow:
  root=
  root=zfs
  root=zfs:
  root=zfs:AUTO

  root=ZFS=data/set
  root=zfs:data/set
  root=zfs:ZFS=data/set (as a side-effect; allowed but undocumented)

  rootfstype=zfs AND root=data/set <=> root=data/set
  rootfstype=zfs AND root=         <=> root=zfs:AUTO

So rootfstype=zfs /also/ behaves as expected, and + decoding works

Upstream-commit: 245529d85fb807bfc4525b3b1858896d2860995b
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13291

2 years agocontrib: dracut: parse-zfs: stop pretending we support FILESYSTEM=
наб [Mon, 4 Apr 2022 18:59:53 +0000 (20:59 +0200)]
contrib: dracut: parse-zfs: stop pretending we support FILESYSTEM=

It was added in the original ae26d0465a ("Add dracut support") commit
in 2011, and was then broken a bit later with the advent of
dracut-zfs-generator, or maybe earlier as part of other churn

Either way, it's broken, and has been in 2.0+ as well, and no-one
complained. Stop pretending we support it at all

Upstream-commit: 2c74617bcf76b305937097278b614443d47681a0
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13291

2 years agocontrib: dracut: parse-zfs: drop initqueue-finished for i/f
наб [Mon, 4 Apr 2022 16:38:07 +0000 (18:38 +0200)]
contrib: dracut: parse-zfs: drop initqueue-finished for i/f

The switch was released in dracut 009 in March 2011,
we can safely get rid of the compatibility hook

Upstream-commit: 47636f5661abf202c725f1975939878e7156d3c8
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13291

2 years agocontrib/dracut: zfs-lib: export_all: replace with inline zpool export -a
наб [Sat, 12 Feb 2022 13:08:02 +0000 (14:08 +0100)]
contrib/dracut: zfs-lib: export_all: replace with inline zpool export -a

07a3312f170ac56cb480b0df9fdf4c83f116b59b, which introduced this in
October of 2014, didn't have zpool export -a available; we do

Upstream-commit: 6a41310c7099ca4532f2d8134bba37261f72410e
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13093

2 years agoRemove REMAKE_INITRD
jokersus [Tue, 30 Nov 2021 19:09:15 +0000 (22:09 +0300)]
Remove REMAKE_INITRD

The option has been deprecated in dkms and will break packaging in
future versions. See https://github.com/dell/dkms/commit/7114c62

Upstream-commit: b5c16861e9fa91871540a101e92013e05182fc2f
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: jokersus <jokersus.cava@gmail.com>
Closes #12781

2 years agoPython 3.10 fixes, part 2
Rich Ercolani [Fri, 29 Oct 2021 22:36:01 +0000 (18:36 -0400)]
Python 3.10 fixes, part 2

There was a fallback case I overlooked in the initial patch, with
a similarly imperfect version extractor.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12045
Closes #12673

2 years agoSilence unused-but-set-variable warnings
Brian Behlendorf [Fri, 29 Apr 2022 17:11:20 +0000 (10:11 -0700)]
Silence unused-but-set-variable warnings

Clang 13.0.0 added support for `Wunused-but-set-parameter` and
`-Wunused-but-set-variable` which correctly detects two unused
variables in zstd resulting in a build failure.  This commit
annotates these instances accordingly.

  https://releases.llvm.org/13.0.1/tools/clang/docs/ReleaseNotes.html#id6

In FSE_createCTable(), malloc() is intentionally defined as NULL when
compiled in the kernel so the variable is unused.

  zstd/lib/compress/fse_compress.c:307:12: error: variable 'size'
  set but not used [-Werror,-Wunused-but-set-variable]

Additionally, in ZSTD_seqDecompressedSize() the assert is compiled
out similarly resulting in an unused variable.

  zstd/lib/compress/zstd_compress_superblock.c:412:12: error: variable
  'litLengthSum' set but not used [-Werror,-Wunused-but-set-variable]

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2 years agomodule: zfs: freebsd: fix unused, remove argsused
наб [Wed, 22 Dec 2021 17:35:13 +0000 (18:35 +0100)]
module: zfs: freebsd: fix unused, remove argsused

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12844

2 years agoFreeBSD: remove unused variable
наб [Thu, 23 Dec 2021 20:47:43 +0000 (21:47 +0100)]
FreeBSD: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #12899

2 years agozvol: remove unused variable
наб [Mon, 27 Dec 2021 18:33:58 +0000 (19:33 +0100)]
zvol: remove unused variable

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12917

2 years agofm: remove unused variables
наб [Mon, 27 Dec 2021 18:33:38 +0000 (19:33 +0100)]
fm: remove unused variables

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12917

2 years agozvol: remove unused variable
наб [Mon, 27 Dec 2021 18:33:16 +0000 (19:33 +0100)]
zvol: remove unused variable

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12917

2 years agomodule/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable
наб [Thu, 3 Jun 2021 16:33:01 +0000 (18:33 +0200)]
module/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agomodule/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable
наб [Thu, 3 Jun 2021 16:32:38 +0000 (18:32 +0200)]
module/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agomodule/zfs: dbuf: dbuf_read_impl: remove unused variable
наб [Thu, 3 Jun 2021 16:31:58 +0000 (18:31 +0200)]
module/zfs: dbuf: dbuf_read_impl: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agomodule/zfs: arc: arc_hdr_realloc_crypt: remove unused variables
наб [Thu, 3 Jun 2021 16:31:21 +0000 (18:31 +0200)]
module/zfs: arc: arc_hdr_realloc_crypt: remove unused variables

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agolibzfs: zfs_send: remove unused variable
наб [Thu, 3 Jun 2021 16:30:23 +0000 (18:30 +0200)]
libzfs: zfs_send: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agolibzutil: zpool_find_config: remove unused variable
наб [Thu, 3 Jun 2021 15:10:41 +0000 (17:10 +0200)]
libzutil: zpool_find_config: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agoSkip spacemaps reading in case of pool readonly import
Brian Behlendorf [Thu, 28 Apr 2022 23:47:12 +0000 (16:47 -0700)]
Skip spacemaps reading in case of pool readonly import

The only zdb utility require to read metaslab-related data during
read-only pool import because of spacemaps validation. Add global
variable which will allow zdb read spacemaps in case of readonly
import mode.

Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Fedor Uporov <fuporov.vstack@gmail.com>
Closes #9095
Closes #12687

2 years agozfs: holds: dequadratify
наб [Thu, 28 Apr 2022 22:18:47 +0000 (00:18 +0200)]
zfs: holds: dequadratify

Before:
  15  0m0.177s
  30  0m0.653s
  45  0m1.289s
  60  0m2.129s
  75  0m3.264s
  90  0m4.397s
  100 0m5.996s
  117 0m8.552s

After:
  30  0m0.053s
  117 0m0.125s

Upstream-commit: 2a70a090729dade59967bbfe6a4984c18613e0ee
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13372
Closes #13373

2 years agoLinux 5.18 compat: replace __set_page_dirty_nobuffers
Brian Behlendorf [Thu, 28 Apr 2022 22:17:38 +0000 (15:17 -0700)]
Linux 5.18 compat: replace __set_page_dirty_nobuffers

Replace __set_page_dirty_nobuffers with filemap_dirty_folio.

Upstream-commit: 6b1f86f8e9c7f9de7ca1cb987b2cf25e99b1ae3a
("Merge tag 'folio-5.18b' of
git://git.infradead.org/users/willy/pagecache ")

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Authored-by: Satadru Pramanik <satadru@gmail.com>
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Closes #13325
Closes #13380

2 years agoFix O_APPEND for Linux 3.15 and older kernels
Brian Behlendorf [Thu, 28 Apr 2022 22:15:28 +0000 (15:15 -0700)]
Fix O_APPEND for Linux 3.15 and older kernels

When using a Linux kernel which predates the iov_iter interface the
O_APPEND flag should be applied in zpl_aio_write() via the call to
generic_write_checks().  The updated pos variable  was incorrectly
ignored resulting in the current offset being used.

This issue should only realistically impact the RHEL/CentOS 7.x
kernels which are based on Linux 3.10.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13370
Closes #13377

2 years agoLinux 5.18 compat: kobj_type.default_attrs replaced with default_groups
наб [Thu, 21 Apr 2022 14:27:15 +0000 (16:27 +0200)]
Linux 5.18 compat: kobj_type.default_attrs replaced with default_groups

Upstream-commit: cdb4f26a63c391317e335e6e683a614358e70aeb ("kobject:
 kobj_type: remove default_attrs")
Upstream-commit: 0cdda2edb3f312d56518934811960ad57564c1bb
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13357

2 years agoFreeBSD: Fix translation from ABD to physical pages.
Alexander Motin [Tue, 19 Apr 2022 00:25:49 +0000 (20:25 -0400)]
FreeBSD: Fix translation from ABD to physical pages.

In hypothetical case of non-linear ABD with single segment, multiple
to page size but not aligned to it, vdev_geom_fill_unmap_cb() could
fill one page less into bio_ma array.

I am not sure it is expoitable, but better to be safe than sorry.

Reported-by: Mark Johnston <markj@FreeBSD.org>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
(cherry picked from commit 5352f85cddce44e82fb1c4caec3b333e3666d7fd)

2 years agoCorrected oversight in ZERO_RANGE behavior
Rich Ercolani [Wed, 20 Apr 2022 23:07:03 +0000 (19:07 -0400)]
Corrected oversight in ZERO_RANGE behavior

It turns out, no, in fact, ZERO_RANGE and PUNCH_HOLE do
have differing semantics in some ways - in particular,
one requires KEEP_SIZE, and the other does not.

Also added a zero-range test to catch this, corrected a flaw
that made the punch-hole test succeed vacuously, and a typo
in file_write.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #13329
Closes #13338

2 years agoDocument zfs inherit -S's interaction with noninheritable properties
наб [Sat, 16 Apr 2022 14:07:04 +0000 (16:07 +0200)]
Document zfs inherit -S's interaction with noninheritable properties

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Upstream-commit: 92295af8004b07a58e0860d66dd565143486a757
Closes #11894
Closes #13335

2 years agoLinux 5.17 compat: GENHD_FL_EXT_DEVT / GENHD_FL_NO_PART_SCAN
Brian Behlendorf [Tue, 19 Apr 2022 17:38:04 +0000 (10:38 -0700)]
Linux 5.17 compat: GENHD_FL_EXT_DEVT / GENHD_FL_NO_PART_SCAN

As of the 5.17 kernel the GENHD_FL_EXT_DEVT flag has been removed
and the GENHD_FL_NO_PART_SCAN flag renamed GENHD_FL_NO_PART. Update
zvol_alloc() to set GENHD_FL_NO_PART for the newer kernels which
is sufficient.  The behavior for prior kernels remains unchanged.

1ebe2e5f ("block: remove GENHD_FL_EXT_DEVT")
46e7eac6 ("block: rename GENHD_FL_NO_PART_SCAN to GENHD_FL_NO_PART")

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13294
Closes #13297

2 years agoFreeBSD: Return Mach error codes from VOP_(GET|PUT)PAGES
Mark Johnston [Thu, 7 Apr 2022 21:13:18 +0000 (17:13 -0400)]
FreeBSD: Return Mach error codes from VOP_(GET|PUT)PAGES

FreeBSD's memory management system uses its own error numbers and gets
confused when these VOPs return EIO.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reported-by: Peter Holm <pho@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #13311

2 years agoFreeBSD: Parameterize ZFS_ENTER/ZFS_VERIFY_VP with an error code
Mark Johnston [Thu, 7 Apr 2022 21:11:00 +0000 (17:11 -0400)]
FreeBSD: Parameterize ZFS_ENTER/ZFS_VERIFY_VP with an error code

For legacy reasons, a couple of VOPs have to return error numbers that
don't come from the usual errno namespace.  To handle the cases where
ZFS_ENTER or ZFS_VERIFY_ZP fail, we need to be able to override the
default error return value of EIO.  Extend the macros to permit this.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #13311

2 years agolibzfs: import: zpool_clear_label: actually fail if clearing l2arc header fails
наб [Thu, 7 Apr 2022 02:32:27 +0000 (04:32 +0200)]
libzfs: import: zpool_clear_label: actually fail if clearing l2arc header fails

Found with -Wunused-but-set-variable on Clang trunk

Upstream-commit: a4e0cee1780cbd8f2cb9a263a0ed8d91dbe68b4a
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13304

2 years agolibzfs: sendrecv: always cancel progress thread in zfs_send_one()
наб [Mon, 4 Apr 2022 12:25:01 +0000 (14:25 +0200)]
libzfs: sendrecv: always cancel progress thread in zfs_send_one()

This is in line with all the other uses of the progress thread

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11560
Closes #13284

2 years agoLinux 5.18 compat: use address_space_operations->readahead
Riccardo Schirone [Fri, 1 Apr 2022 23:15:25 +0000 (01:15 +0200)]
Linux 5.18 compat: use address_space_operations->readahead

->readpages was removed and replaced by ->readahead. Define
zpl_readahead for kernels that don't have ->readpages.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Riccardo Schirone <rschirone91@gmail.com>
Closes #13278

2 years agoLinux 5.18 compat: blkg_tryget is moved to private headers
Riccardo Schirone [Fri, 1 Apr 2022 21:47:36 +0000 (23:47 +0200)]
Linux 5.18 compat: blkg_tryget is moved to private headers

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Riccardo Schirone <rschirone91@gmail.com>
Closes #13278

2 years agoLinux 5.18 compat: replace genhd.h with blkdev.h includes
наб [Thu, 24 Mar 2022 15:33:40 +0000 (16:33 +0100)]
Linux 5.18 compat: replace genhd.h with blkdev.h includes

blkdev.h includes genhd.h since dawn of upstream git, so this is
globally safe

Upstream-commit: 322cbb50de711814c42fb088f6d31901502c711a ("block:
 remove genhd.h")

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13251

2 years agoLinux 5.18 compat: 4-argument bio_alloc()
наб [Thu, 24 Mar 2022 14:22:53 +0000 (15:22 +0100)]
Linux 5.18 compat: 4-argument bio_alloc()

  bio_alloc(gfp_t gfp_mask, unsigned short nr_iovecs)

became

  bio_alloc(struct block_device *bdev, unsigned short nr_vecs,
            unsigned int opf, gfp_t gfp_mask)
passing NULL/0 continues previous behaviour

Upstream-commit: 07888c665b405b1cd3577ddebfeb74f4717a84c4 ("block:
 pass a block_device and opf to bio_alloc")

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13251

2 years agoFreeBSD: Use NDFREE_PNBUF if available
Ryan Moeller [Sat, 2 Apr 2022 19:10:55 +0000 (15:10 -0400)]
FreeBSD: Use NDFREE_PNBUF if available

NDF_ONLY_PNBUF has been removed from FreeBSD in favor of NDFREE_PNBUF.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #13277

2 years agoExport minimal zfs_refcount interfaces
Brian Behlendorf [Mon, 11 Oct 2021 17:54:39 +0000 (10:54 -0700)]
Export minimal zfs_refcount interfaces

Lustre makes light use of the zfs_refcount interfaces which
isn't a problem when using a non-debug build of OpenZFS. However,
when debugging is enabled the required symbols are not exported.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12613

2 years agoDefault to zfs_dmu_offset_next_sync=1
Brian Behlendorf [Tue, 30 Nov 2021 18:38:09 +0000 (10:38 -0800)]
Default to zfs_dmu_offset_next_sync=1

Strict hole reporting was previously disabled by default as a
performance optimization.  However, this has lead to confusion
over the expected behavior and a variety of workarounds being
adopted by consumers of ZFS.  Change the default behavior to
always report holes and force the TXG sync.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Upstream-commit: 05b3eb6d232009db247882a39d518e7282630753
Ref: #13261
Closes #12746

2 years agoetc/systemd/zfs-mount-generator: serialise, handle keylocation=http[s]://
наб [Tue, 30 Nov 2021 16:29:50 +0000 (17:29 +0100)]
etc/systemd/zfs-mount-generator: serialise, handle keylocation=http[s]://

* etc/systemd/zfs-mount-generator: serialise

The wins for a relatively normal workload are rather slim:
real 0.02119s/0.00985s=2.15029x
user 0.02130s/0.00346s=6.15560x
sys 0.03858s/0.00643s=6.00062x

wall-total 0.014518s/0.005925s=2.45009x
wall-init 0.014518s/0.002457s=5.90684x
wall-real 0.014518s/0.003467s=4.18668x

But this is a big win on machines with a lot of datasets and expensive
forks.

For example, the gain on a VM on my work laptop with 900+ legacy-mount
Docker datasets, the original gains from the C rewrite were
only five-fold:
real    0.516s/0.102s=5.05882x
user    0.237s/0.143s=1.65734x
sys     0.287s/0.100s=2.87x

And this serial variant gains this back there as well:
real    0.102s/0.008s=12.75x
user    0.143s/0.007s=20.42857
sys     0.100s/0.001s=100x

wall-total 0.09717s/0.00319s=30.40255x
wall-init 0.00203s/0.00200s=1.015941x
wall-real 0.09513s/0.00118s=80.02043x

For a total of
real    0.516s/0.008s=64.5x
user    0.237s/0.007s=33.85714x
sys     0.287s/0.001s=287x

Suggested-by: Richard Laager <rlaager@wiktel.com>
* etc/systemd/zfs-mount-generator: pull in network for keylocation=https

Also simplify RequiresMountsFor= handling
Ref: #11956

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Upstream-commit: 4325de09cd2993837bc32a83d61872b57e58298e
Closes #12138

2 years agolibzfs: diff: stream_bytes: use fputc, %hho formats chars
наб [Thu, 9 Dec 2021 22:42:02 +0000 (23:42 +0100)]
libzfs: diff: stream_bytes: use fputc, %hho formats chars

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Upstream-commit: a72129edcb7353f5301096ea9541e8e345f052d4
Closes #12829

2 years agozfs, libzfs: diff: accept -h/ZFS_DIFF_NO_MANGLE, disabling path escaping
наб [Thu, 9 Dec 2021 23:02:52 +0000 (00:02 +0100)]
zfs, libzfs: diff: accept -h/ZFS_DIFF_NO_MANGLE, disabling path escaping

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Upstream-commit: 344bbc82e7054f61d5e7b3610b119820285fd2cb
Closes #12829

2 years agoTag zfs-2.1.4
Tony Hutter [Mon, 21 Mar 2022 21:38:12 +0000 (14:38 -0700)]
Tag zfs-2.1.4

META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
2 years agozed: Fix mpath autoreplace on Centos 7
Tony Hutter [Fri, 18 Mar 2022 21:06:40 +0000 (14:06 -0700)]
zed: Fix mpath autoreplace on Centos 7

A prior commit included a udev check for MPATH_DEVICE_READY to
determine if a path was multipath when doing an autoreplace:

    f2f6c18 zed: Misc multipath autoreplace fixes

However, MPATH_DEVICE_READY is not provided by the older version of
udev that's on Centos 7 (it is on Centos 8).

This patch instead looks for 'mpath-' in the UUID, which works on
both Centos 7 and 8.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #13222

2 years agozed: Misc multipath autoreplace fixes
Tony Hutter [Thu, 24 Feb 2022 19:43:39 +0000 (11:43 -0800)]
zed: Misc multipath autoreplace fixes

We recently had a case where our operators replaced a bad
multipathed disk, only to see it fail to autoreplace.  The
zed logs showed that the multipath replacement disk did not pass
the 'is_dm' test in zfs_process_add() even though it should have.
is_dm is set if there exists a sysfs entry for to the
underlying /dev/sd* paths for the multipath disk.  It's
possible this path didn't exist due to a race condition where
the sysfs paths weren't created at the time the udev event came
in to zed, but this was never verified.

This patch updates the check to look for udev properties that
indicate if the new autoreplace disk is an empty multipath disk,
rather than looking for the underlying sysfs entries. It also
adds in additional logging, and fixes a bug where zed allowed
you to use an already zfs-formatted disk from another pool
as a multipath auto-replacement disk.

Furthermore, while testing this patch, I also ran across a case
where a force-faulted disk did not have a ZPOOL_CONFIG_PHYS_PATH
entry in its config.  This prevented it from being autoreplaced.
I added additional logic to derive the PHYS_PATH from the PATH if
the PATH was a /dev/disk/by-vdev/ path.  For example, if PATH
was /dev/disk/by-vdev/L28, then PHYS_PATH would be L28.  This is
safe since by-vdev paths represent physical locations and do not
change between boots.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #13023

2 years agoFix ACL checks for NFS kernel server
Brian Behlendorf [Mon, 21 Mar 2022 04:21:18 +0000 (21:21 -0700)]
Fix ACL checks for NFS kernel server

This PR changes ZFS ACL checks to evaluate
fsuid / fsgid rather than euid / egid to avoid
accidentally granting elevated permissions to
NFS clients.

Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Andrew Walker <awalker@ixsystems.com>
Co-authored-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #13221

2 years agoLinux 5.16 compat: restore FSR and FSAVE
Brian Behlendorf [Sat, 19 Mar 2022 19:48:28 +0000 (12:48 -0700)]
Linux 5.16 compat: restore FSR and FSAVE

Commit 3b52ccd7d introduced a flaw where FSR and FSAVE are not restored
when using a Linux 5.16 kernel.  These instructions are only used when
XSAVE is not supported by the processor meaning only some systems will
encounter this issue.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13210
Closes #13236

2 years agomodule: freebsd: avoid a taking a destroyed lock in zfs_zevent bits
Kyle Evans [Thu, 17 Mar 2022 17:14:00 +0000 (12:14 -0500)]
module: freebsd: avoid a taking a destroyed lock in zfs_zevent bits

At shutdown time, we drain all of the zevents and set the
ZEVENT_SHUTDOWN flag.  On FreeBSD, we may end up calling
zfs_zevent_destroy() after the zevent_lock has been destroyed while
the sysevent thread is winding down; we observe ESHUTDOWN, then back
out.

Events have already been drained, so just inline the kmem_free call in
sysevent_worker() to avoid the race, and document the assumption that
zfs_zevent_destroy doesn't do anything else useful at that point.

This fixes a panic that can occur at module unload time.

Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Closes #13220

2 years agoFreeBSD: add missing replay check to an assert in zfs_xvattr_set
Mateusz Guzik [Thu, 17 Mar 2022 17:30:10 +0000 (18:30 +0100)]
FreeBSD: add missing replay check to an assert in zfs_xvattr_set

Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #13219

2 years agoget_key_material_https: removed bogus free() call
наб [Thu, 17 Mar 2022 17:22:13 +0000 (18:22 +0100)]
get_key_material_https: removed bogus free() call

The get_key_material_https() function error code path had a bogus
free() call, either resulting in double-free or free() of undefined
pointer.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ahelenia Ziemia<C5><84>ska <nabijaczleweli@nabijaczleweli.xyz>
Co-authored-by: Harry Sintonen <sintonen@iki.fi>
Signed-off-by: Harry Sintonen <sintonen@iki.fi>
Closes #13198

2 years agoFix module build with -Werror
Ryan Moeller [Thu, 17 Mar 2022 17:18:23 +0000 (13:18 -0400)]
Fix module build with -Werror

This is a direct commit to zfs-2.1-release to fix release builds that
error out on an unused variable.  The issue is avoided on master by a
huge series of commits that change how the ASSERT macros work, but that
is not feasible to backport.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #13194
Closes #13196

2 years agoTag zfs-2.1.3
Tony Hutter [Wed, 9 Mar 2022 02:03:54 +0000 (18:03 -0800)]
Tag zfs-2.1.3

META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
2 years agoFix ENOSPC when unlinking multiple files from full pool
Brian Behlendorf [Tue, 8 Mar 2022 17:16:35 +0000 (09:16 -0800)]
Fix ENOSPC when unlinking multiple files from full pool

When unlinking multiple files from a pool at 100% capacity, it was
possible for ENOSPC to be returned after the first unlink.  e.g.

    rm -f /mnt/fs/test1.0.0 /mnt/fs/test1.1.0 /mnt/fs/test1.2.0
    rm: cannot remove '/mnt/fs/test1.1.0': No space left on device
    rm: cannot remove '/mnt/fs/test1.2.0': No space left on device

After waiting for the pending deferred frees from the first unlink to
be processed the remaining files can then be unlinked.  This is caused
by the quota limit in dsl_dir_tempreserve_impl() being temporarily
decreased to the allocatable pool capacity less any deferred free
space.

This is resolved using the existing mechanism of returning ERESTART
when over quota as long as we know enough space will shortly be
available after processing the pending deferred frees.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13172

2 years agoZTS: deadman_sync fix
Brian Behlendorf [Mon, 11 Oct 2021 17:49:13 +0000 (10:49 -0700)]
ZTS: deadman_sync fix

In the CI environment it's possible for events to be slightly
delayed resulting in 4, instead of 5, events appearing in the
log file.  This isn't a problem and should be considered a
success to avoid false positive test results.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12625

2 years agozfs: Fix a deadlock between page busy and the teardown lock
Mark Johnston [Sat, 20 Nov 2021 16:21:25 +0000 (11:21 -0500)]
zfs: Fix a deadlock between page busy and the teardown lock

When rolling back a dataset, ZFS has to purge file data resident in the
system page cache.  To do this, it loops over all vnodes for the
mountpoint and calls vn_pages_remove() to purge pages associated with
the vnode's VM object.  Each page is thus exclusively busied while the
dataset's teardown write lock is held.

When handling a page fault on a mapped ZFS file, FreeBSD's page fault
handler busies newly allocated pages and then uses VOP_GETPAGES to fill
them.  The ZFS getpages VOP acquires the teardown read lock with vnode
pages already busied.  This represents a lock order reversal which can
lead to deadlock.

To break the deadlock, observe that zfs_rezget() need only purge those
pages marked valid, and that pages busied by the page fault handler are,
by definition, invalid.  Furthermore, ZFS pages always transition from
invalid to valid with the teardown lock held, and ZFS never creates
partially valid pages.  Thus, zfs_rezget() can use the new
vn_pages_remove_valid() to skip over pages busied by the fault handler.

PR: 258208
Tested by: pho
Reviewed by: avg, sef, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32931

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #12828

2 years agoReally zero the zero page
Alexander Motin [Fri, 17 Sep 2021 17:17:18 +0000 (13:17 -0400)]
Really zero the zero page

While switching abd_zero_buf allocation KPI I've missed the fact
that kmem_zalloc() zeroed the allocation, while kmem_cache_alloc()
does not.  Add explicit bzero() after it.

I don't think it should have caused real problems, but leaking one
memory page content all over the pool is not good.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Closes #12569

2 years ago ZTS: Fix import_devices_missing.ksh
Brian Behlendorf [Wed, 2 Mar 2022 19:03:53 +0000 (11:03 -0800)]
 ZTS: Fix import_devices_missing.ksh

Related to commit 90b77a036.  Retry the `zpool export` if the pool
is "busy" indicating there is a process accessing the mount point.
This can happen after an import, allowing it to be retried will
avoid spurious test failures.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13169

2 years agoZTS: Retry in import_rewind_config_changed.ksh
Brian Behlendorf [Mon, 21 Feb 2022 03:21:31 +0000 (19:21 -0800)]
ZTS: Retry in import_rewind_config_changed.ksh

As explained by the disclaimer in the test case,

    "This test can fail since nothing guarantees that old
    MOS blocks aren't overwritten."

This behavior is expected and correct, but results in a
flaky test case which is problematic for the CI.  The best
we can do to resolve this is to retry the sub-test which
failed when the MOS blocks have clearly been overwritten.

When testing failures were rare enough that a single retry
should normally be sufficient.  However, we allow up to
five for good measure.

Reviewed by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13119

2 years agoZTS: Modify receive-o-x_props_override.ksh exception
Brian Behlendorf [Tue, 1 Mar 2022 16:47:30 +0000 (08:47 -0800)]
ZTS: Modify receive-o-x_props_override.ksh exception

As previously noted in #12272 the receive-o-x_props_override.ksh test
reliably fails on FreeBSD.  Since we don't expect this test to pass
move the exception from the "maybe" to "known" section.  This way we
don't retry the FAILED test when it is not expected to pass.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13167

2 years agoZTS: Move largest_pool_001_pos.ksh to Linux runfile
Brian Behlendorf [Tue, 1 Mar 2022 16:46:00 +0000 (08:46 -0800)]
ZTS: Move largest_pool_001_pos.ksh to Linux runfile

On FreeBSD pools are not allowed to be created using vdevs which are
backed by ZFS volumes.  This configuration is not recommended for any
supported platform, nevertheless the largest_pool_001_pos.ksh test
case makes use of it as a convenience.  This causes the test case to
fail reliably on FreeBSD.  The layout is still tolerated on Linux
so only perform this test on Linux.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13166

2 years agoFix erroneous zstreamdump warning
Paul Dagnelie [Sat, 26 Feb 2022 19:24:27 +0000 (11:24 -0800)]
Fix erroneous zstreamdump warning

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #13154

2 years agoFix FreeBSD reporting on reruns
наб [Sat, 26 Feb 2022 19:19:05 +0000 (20:19 +0100)]
Fix FreeBSD reporting on reruns

Turns out, when your test-suite fails on FreeBSD the rerun logic
would fail as follows:

Results Summary
PASS  1358
FAIL    7
SKIP   47

Running Time: 04:00:02
Percent passed: 96.2%
Log directory: /var/tmp/test_results/20220225T092538
mktemp: illegal option -- p
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
mktemp: illegal option -- p
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
/usr/local/share/zfs/zfs-tests.sh: cannot create :
                                   No such file or directory
...

This change resolves a flaw from the original commit, 2320e6eb4
("Add zfs-test  facility to automatically rerun failing tests")

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13156

2 years agoFix cpu hotplug atomic sleep issue
Paul Dagnelie [Tue, 2 Nov 2021 16:23:48 +0000 (09:23 -0700)]
Fix cpu hotplug atomic sleep issue

We move the spinlock unlock before the thread creation. This should be
safe because the thread creation code doesn't actually manipulate any
taskq data structures; that's done by the thread once it's created.

We also remove the assertion that the maxthreads is the current threads
plus one; that assertion could fail if multiple hotplug events come in
quick succession, and the first new taskq thread hasn't had a chance to
start processing yet.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
eviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #12714

2 years agoFix directory detection in `dkms.mkconf`
Damian Szuberski [Thu, 24 Feb 2022 18:33:48 +0000 (19:33 +0100)]
Fix directory detection in `dkms.mkconf`

Fix `zfs-dkms` installation on Debian-derived distributions by
aligning the directory detection logic to #13096.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #11449
Closes #13141

2 years agoLinux 5.11 compat: x86 SIMD: fix kernel_fpu_{begin,end}() detection
Attila Fülöp [Thu, 24 Feb 2022 17:23:41 +0000 (18:23 +0100)]
Linux 5.11 compat: x86 SIMD: fix kernel_fpu_{begin,end}() detection

Linux 5.11 changed kernel_fpu_begin() to an inlined function and
moved the functionality to kernel_fpu_begin_mask(). This breaks the
existing detection mechanism since it checks if kernel_fpu_begin is
an exported kernel symbol, which isn't the case for an inlined
function.

To avoid assumptions about internal implementation, replace
ZFS_LINUX_TEST_RESULT_SYMBOL in favor of  ZFS_LINUX_TEST_RESULT
which already makes sure kernel_fpu_{begin,end}() is usable by us.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #13147

2 years agoFix Linux kernel directories detection
Damian Szuberski [Wed, 16 Feb 2022 23:17:16 +0000 (00:17 +0100)]
Fix Linux kernel directories detection

Most modern Linux distributions have separate locations for bare
source and prebuilt ("build") files. Additionally, there are `source`
and `build` symlinks in `/lib/modules/$(KERNEL_VERSION)` pointing to
them. The order of directory search is now:
- `configure` command line values if both `--with-linux` and
  `--with-linux-obj` were defined
- If only `--with-linux` was defined, `--with-linux-obj` is assumed
  to have the same value as `--with-linux`
- If neither `--with-linux` nor `--with-linux-obj` were defined
  autodetection is used:
  - `/lib/modules/$(uname -r)/{source,build}` respectively, if exist
  - The first directory in `/lib/modules` with the highest version
    number according to `sort -V` which contains `source` and `build`
    symlinks/directories
  - The first directory matching `/usr/src/kernels/*` and
    `/usr/src/linux-*` with the highest version number according to
    `sort -V`. Here the source and prebuilt directories are assumed
    to be the same.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #9935
Closes #13096

2 years agoEnable encrypted raw sending to pools with greater ashift
George Amanakis [Wed, 16 Feb 2022 19:52:02 +0000 (20:52 +0100)]
Enable encrypted raw sending to pools with greater ashift

Raw sending from pool1/encrypted with ashift=9 to pool2/encrypted with
ashift=12 results to failure when mounting pool2/encrypted (Input/Output
error). Notably, the opposite, raw sending from a greater ashift to a
lower one does not fail.

This happens because zio_compress_write() falsely checks only
ZIO_FLAG_RAW_COMPRESS and not ZIO_FLAG_RAW_ENCRYPT which is also set in
encrypted raw send streams. In this case it rounds up the psize and if
not equal to the zio->io_size it modifies the block by zeroing out
the extra bytes. Because this happens in a SA attr. registration object
(type=46), the decryption fails upon mounting the filesystem, and zpool
status falsely reports an error.

Fix this by checking both ZIO_FLAG_RAW_COMPRESS and ZIO_FLAG_RAW_ENCRYPT
before deciding whether to zero-pad a block.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #13067
Closes #13074

2 years agoAvoid dirtying the final TXGs when exporting a pool
George Amanakis [Tue, 15 Feb 2022 23:48:59 +0000 (00:48 +0100)]
Avoid dirtying the final TXGs when exporting a pool

There are two codepaths than can dirty final TXGs:

1) If calling spa_export_common()->spa_unload()->
   spa_unload_log_sm_flush_all() after the spa_final_txg is set, then
   spa_sync()->spa_flush_metaslabs() may end up dirtying the final
   TXGs. Then we have the following panic:
   Call Trace:
    <TASK>
    dump_stack_lvl+0x46/0x62
    spl_panic+0xea/0x102 [spl]
    dbuf_dirty+0xcd6/0x11b0 [zfs]
    zap_lockdir_impl+0x321/0x590 [zfs]
    zap_lockdir+0xed/0x150 [zfs]
    zap_update+0x69/0x250 [zfs]
    feature_sync+0x5f/0x190 [zfs]
    space_map_alloc+0x83/0xc0 [zfs]
    spa_generate_syncing_log_sm+0x10b/0x2f0 [zfs]
    spa_flush_metaslabs+0xb2/0x350 [zfs]
    spa_sync_iterate_to_convergence+0x15a/0x320 [zfs]
    spa_sync+0x2e0/0x840 [zfs]
    txg_sync_thread+0x2b1/0x3f0 [zfs]
    thread_generic_wrapper+0x62/0xa0 [spl]
    kthread+0x127/0x150
    ret_from_fork+0x22/0x30
    </TASK>

2) Calling vdev_*_stop_all() for a second time in spa_unload() after
   spa_export_common() unnecessarily delays the final TXGs beyond what
   spa_final_txg is set at.

Fix this by performing the check and call for
spa_unload_log_sm_flush_all() before the spa_final_txg is set in
spa_export_common(). Also check if the spa_final_txg has already been
set in spa_unload() and skip those calls in this case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
External-issue: https://www.illumos.org/issues/9081
Closes #13048
Closes #13098

2 years agozfs-receive.8: properly unlight = in option setting
наб [Mon, 14 Feb 2022 12:22:52 +0000 (13:22 +0100)]
zfs-receive.8: properly unlight = in option setting

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13101

2 years agozfs-receive.8: fix Op Fl x Ar encryption in running text
наб [Mon, 14 Feb 2022 12:20:33 +0000 (13:20 +0100)]
zfs-receive.8: fix Op Fl x Ar encryption in running text

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13101

2 years agoRemove unneeded "extern inline" function declarations
Tomohiro Kusumi [Tue, 8 Feb 2022 18:48:57 +0000 (03:48 +0900)]
Remove unneeded "extern inline" function declarations

All of these externs are already #included as static inline
functions via corresponding headers.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #13073

2 years agomodule: zfs: fix unused, remove argsused
наб [Sun, 12 Dec 2021 15:06:44 +0000 (16:06 +0100)]
module: zfs: fix unused, remove argsused

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12844

2 years agoZTS: Fix checkpoint_ro_rewind.ksh
Brian Behlendorf [Sun, 13 Feb 2022 22:22:49 +0000 (14:22 -0800)]
ZTS: Fix checkpoint_ro_rewind.ksh

Related to commit 90b77a036.  Retry the `zpool export` if the pool is
"busy" indicating there is a process accessing the mount point.  This
can happen after an import and allowing it to be retried will avoid
spurious test failures.

Reviewed by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13092

2 years agoZTS: Fix zpool_expand_001_pos
Brian Behlendorf [Sun, 13 Feb 2022 22:22:00 +0000 (14:22 -0800)]
ZTS: Fix zpool_expand_001_pos

The dRAID section of the zpool_expand_001_pos test would reliably fail
because the calculated expansion size assumed the dRAID top-level vdev
was created with a distributed spare.  Create the vdev as expected to
resolve the test failure.

This test case flaw was accidentally caused by changing the default
number of dRAID distributed spares from one to zero while dRAID was
being developed.

Additionally, remove zpool_expand_005_pos from the list of possible
faulty tests.  It appears to be passing consistently in my testing.

Reviewed by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13091

2 years agoFix gcc warning in kfpu_begin()
Brian Behlendorf [Fri, 11 Feb 2022 22:31:45 +0000 (14:31 -0800)]
Fix gcc warning in kfpu_begin()

Observed when building on CentOS 8 Stream.  Remove the `out`
label at the end of the function and instead return.

  linux/simd_x86.h: In function 'kfpu_begin':
  linux/simd_x86.h:337:1: error: label at end of compound statement

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13089

2 years agozpool-import.8: WARNING should be emphasised
наб [Thu, 10 Feb 2022 18:43:25 +0000 (19:43 +0100)]
zpool-import.8: WARNING should be emphasised

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13082

2 years agozpool-import.8: newpool is Ar, not Sy
наб [Thu, 10 Feb 2022 18:43:08 +0000 (19:43 +0100)]
zpool-import.8: newpool is Ar, not Sy

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13082

2 years agozpoolprops.7: document leaked
наб [Fri, 11 Feb 2022 19:49:07 +0000 (20:49 +0100)]
zpoolprops.7: document leaked

It's noted very scarcely in the code as it stands, indeed the only
actual comment on this is

  /*
   * We have finished background destroying, but there is still
   * some space left in the dp_free_dir. Transfer this leaked
   * space to the dp_leak_dir.
   */

Introduced in fbeddd60b79690b6a6ececc9b00b6014d21405aa ("Illumos 4390 -
I/O errors can corrupt space map when deleting fs/vol"),
which explains, alongside the references, that this can only happen
with a corrupted pool

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13081

2 years agoCorrect a typo in zfs-receive.8
Zhu Chuang [Fri, 11 Feb 2022 19:47:35 +0000 (03:47 +0800)]
Correct a typo in zfs-receive.8

Should be  `-o keyformat=passphrase` instead of `-o -keyformat=passphrase`

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chuang Zhu <chuang@melty.land>
Closes #13072

2 years agoZTS: Fix zvol_misc_volmode test
Brian Behlendorf [Thu, 10 Feb 2022 01:00:03 +0000 (17:00 -0800)]
ZTS: Fix zvol_misc_volmode test

Changing volmode may need to remove minors, which could be open, so
call udev_wait() before we "zfs set volmode=<value>".  This ensures
no udev process has the zvol open (i.e. blkid) and the kernel
zvol_remove_minor_impl() function won't skip removing the in use
device.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13075

2 years agoAdd dataset_kstats_update.. to mmap read/write paths
drowfx [Wed, 9 Feb 2022 22:41:42 +0000 (23:41 +0100)]
Add dataset_kstats_update.. to mmap read/write paths

This allows reads/writes caused by accesses to mmap files to be
accounted correctly in the per-dataset kstats for both Linux and
FreeBSD.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
Closes #12994
Closes #13044

2 years agoReceive checks should allow unencrypted child datasets
Attila Fülöp [Wed, 9 Feb 2022 22:38:33 +0000 (23:38 +0100)]
Receive checks should allow unencrypted child datasets

dmu_recv_begin_check() unconditionally sets the DS_HOLD_FLAG_DECRYPT
flag before calling dsl_dataset_hold_flags(). If the key on the
receiving side isn't loaded or the send stream contains embedded
blocks, the receive check fails for a stream which is perfectly
valid and could be received without any problem. This seems like
a remnant of the initial design, where unencrypted datasets below
encrypted ones weren't allowed.

Add a condition to set `DS_HOLD_FLAG_DECRYPT` only for encrypted
datasets, modify an existing test to detect this regression and add
a test for raw replication streams.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Co-authored-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #13033
Closes #13076

2 years agoPropagate KERNEL_* to *.spec
Damian Szuberski [Tue, 8 Feb 2022 22:17:37 +0000 (17:17 -0500)]
Propagate KERNEL_* to *.spec

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Authored-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: Peter Levine <plevine457@gmail.com>
Closes #13046

2 years agoAdd support for $KERNEL_{CC,LD,LLVM} variables
Peter Levine [Wed, 2 Feb 2022 05:44:59 +0000 (00:44 -0500)]
Add support for $KERNEL_{CC,LD,LLVM} variables

Currently, $(CC), $(LD), and $(LLVM) variables aren't passed to kbuild
while building modules.  This causes modules to build with the default
GNU GCC toolchain and prevents experimenting with other toolchains such
as CLANG/LLVM.  It can also lead to build failure if the CFLAGS/LDFLAGS
passed are incompatible with gcc/ld.

Pass $KERNEL_CC, $KERNEL_LD, and $KERNEL_LLVM as $(CC), $(LD), and
$(LLVM), respectively, to kbuild for each that is defined in the
environment.  This should take care of the majority of alternative
toolchain use cases.

Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Peter Levine <plevine457@gmail.com>
Closes #13046

2 years agomodule: Makefile: simplify clean and install jobs
наб [Mon, 27 Dec 2021 01:21:38 +0000 (02:21 +0100)]
module: Makefile: simplify clean and install jobs

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12979

2 years agomodule: Makefile: flatten subdir loop, use $PWD instead of `pwd`
наб [Thu, 23 Dec 2021 20:57:44 +0000 (21:57 +0100)]
module: Makefile: flatten subdir loop, use $PWD instead of `pwd`

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #12899

2 years agoLinux 5.16 compat: don't use XSTATE_XSAVE to save FPU state
Attila Fülöp [Wed, 9 Feb 2022 20:50:10 +0000 (21:50 +0100)]
Linux 5.16 compat: don't use XSTATE_XSAVE to save FPU state

Linux 5.16 moved XSTATE_XSAVE and XSTATE_XRESTORE out of our reach,
so add our own XSAVE{,OPT,S} code and use it for Linux 5.16.

Please note that this differs from previous behavior in that it
won't handle exceptions created by XSAVE an XRSTOR. This is sensible
for three reasons.

 - Exceptions during XSAVE and XRSTOR can only occur if the feature
   is not supported or enabled or the memory operand isn't aligned
   on a 64 byte boundary. If this happens something else went
   terribly wrong, and it may be better to stop execution.

 - Previously we just printed a warning and didn't handle the fault,
   this is arguable for the above reason.

 - All other *SAVE instruction also don't handle exceptions, so this
   at least aligns behavior.

Finally add a test to catch such a regression in the future.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #13042
Closes #13059

2 years ago`mount.zfs -o zfsutil` leverages `zfs_mount_at()`
Damian Szuberski [Tue, 8 Feb 2022 18:53:23 +0000 (19:53 +0100)]
`mount.zfs -o zfsutil` leverages `zfs_mount_at()`

Using `zfs_mount_at()` gives opportunity to properly propagate
mountopts from what's stored in a pool to the `mount(2)` syscall
invocation. It fixes cases when mount options are set to incorrect
values and rectification is impossible (e. g. Linux initrd boot
sequence in #7947).
Moved debug information printing after all variables are
initialized - printed text reflects what is passed to `mount(2)`.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Issue #7947
Closes #13021

2 years agodsl_dir_tempreserve_impl: remove unused `deferred` variable
Christian Schwarz [Fri, 4 Feb 2022 18:33:34 +0000 (19:33 +0100)]
dsl_dir_tempreserve_impl: remove unused `deferred` variable

The following commit moved the users of `deferred` into function
dsl_pool_unreserved_space:

    commit d2734cce68cf740e015312314415f9034c67851c
    Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
    Date:   Fri Dec 16 14:11:29 2016 -0800

        OpenZFS 9166 - zfs storage pool checkpoint

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Christian Schwarz <christian.schwarz@nutanix.com>
Closes #13056

2 years agolibfetch: unquote @LIBFETCH_SONAME@ subst
наб [Thu, 6 Jan 2022 19:26:40 +0000 (20:26 +0100)]
libfetch: unquote @LIBFETCH_SONAME@ subst

@LIBFETCH_SONAME@ is no longer quoted. The C define still is.

Ref: 153f7c9f72082d7ef5ee27fcbec1bcb94ba88151
Ref: https://github.com/openzfs/zfs/pull/12835#discussion_r776833743
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12922

2 years agocontrib/initrd hooks: properly quote @LIBFETCH_SONAME@
наб [Sat, 11 Dec 2021 01:41:23 +0000 (02:41 +0100)]
contrib/initrd hooks: properly quote @LIBFETCH_SONAME@

Bullseye shellcheck picks these up as SC2140, and it's right!
@LIBFETCH_SONAME@ is already quoted, so dracut had
  "$d/"libcurl.so.4""
and i-t had
  ""libcurl.so.4""

Partially reverts 34eef3e9a7a74d24a59d016051d547afc55dbaa0 (#12760),
which broke this

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12835

2 years agoRemove basename(1). Clean up/shorten some coreutils pipelines
наб [Thu, 11 Nov 2021 20:27:37 +0000 (21:27 +0100)]
Remove basename(1). Clean up/shorten some coreutils pipelines

Basenames that remain, in cmd/zed/zed.d/statechange-led.sh:
dev=$(basename "$(echo "$therest" | awk '{print $(NF-1)}')")
vdev=$(basename "$ZEVENT_VDEV_PATH")
I don't wanna interfere with #11988

scripts/zfs-tests.sh:
SINGLETESTFILE=$(basename "$SINGLETEST")
tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.kshlib:
ACTUAL=$(basename $dataset)
ACTUAL=$(basename $dataset)
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/
zpool_iostat_-c_homedir.ksh:
typeset USER_SCRIPT=$(basename "$USER_SCRIPT_FULL")
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/
zpool_iostat_-c_searchpath.ksh:
typeset CMD_1=$(basename "$SCRIPT_1")
typeset CMD_2=$(basename "$SCRIPT_2")
tests/zfs-tests/tests/functional/cli_user/zpool_status/
zpool_status_-c_homedir.ksh:
typeset USER_SCRIPT=$(basename "$USER_SCRIPT_FULL")
tests/zfs-tests/tests/functional/cli_user/zpool_status/
zpool_status_-c_searchpath.ksh
typeset CMD_1=$(basename "$SCRIPT_1")
typeset CMD_2=$(basename "$SCRIPT_2")
tests/zfs-tests/tests/functional/migration/migration.cfg:
export BNAME=`basename $TESTFILE`
tests/zfs-tests/tests/perf/perf.shlib:
typeset logbase="$(get_perf_output_dir)/$(basename \
tests/zfs-tests/tests/perf/perf.shlib:
typeset logbase="$(get_perf_output_dir)/$(basename \

These are potentially Of Directories, where basename is actually
useful

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12652

2 years agoautoconf: allow Release to contain hyphen
Jorgen Lundman [Thu, 2 Sep 2021 13:51:29 +0000 (22:51 +0900)]
autoconf: allow Release to contain hyphen

To avoid clashing with tags and releases, we'll use "zfs-macOS".

Meta:          1
Name:          zfs-macOS

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #12437

2 years agoZTS: Update enospc_002_pos test case
Brian Behlendorf [Fri, 4 Feb 2022 17:36:46 +0000 (09:36 -0800)]
ZTS: Update enospc_002_pos test case

The on-disk cost of creating a snapshot or bookmark is sufficiently low
that it is difficult to make it reliably fail even when the pool is
"full".  In order to avoid false positives remove these two checks from
the test case.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13060

2 years agoFix clearing set-uid and set-gid bits on a file when replying a write
Pawel Jakub Dawidek [Thu, 3 Feb 2022 22:37:57 +0000 (14:37 -0800)]
Fix clearing set-uid and set-gid bits on a file when replying a write

POSIX requires that set-uid and set-gid bits to be removed when an
unprivileged user writes to a file and ZFS does that during normal
operation.

The problem arrises when the write is stored in the ZIL and replayed.
During replay we have no access to original credentials of the process
doing the write, so zfs_write() will be performed with the root
credentials. When root is doing the write set-uid and set-gid bits
are not removed from the file.

To correct that, log a separate TX_SETATTR entry that removed those bits
on first write to such file.

Idea from: Christian Schwarz

Add test for ZIL replay of setuid/setgid clearing.

Improve various edge cases when clearing setid bits:
- The setid bits can be readded during a single write, so make sure to check
  for them on every chunk write.
- Log TX_SETATTR record at most once per transaction group (if the setid bits
  are keep coming back).
- Move zfs_log_setattr() outside of zp->z_acl_lock.

Reviewed-by: Dan McDonald <danmcd@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Christian Schwarz <me@cschwarz.com>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #13027

2 years agoAdd enumerated vdev names to 'zpool iostat -v' and 'zpool list -v'
Akash B [Thu, 3 Feb 2022 22:29:29 +0000 (03:59 +0530)]
Add enumerated vdev names to 'zpool iostat -v' and 'zpool list -v'

This commit adds enumerated names to disambiguate between the
different vdevs. Previously only 'zpool status' showed enumerated
vdev names, now 'zpool list -v' and 'zpool iostat -v' also shows
the enumerated vdev names.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Dipak Ghosh <dipak.ghosh@hpe.com>
Signed-off-by: Akash B <akash-b@hpe.com>
Closes #12510
Closes #13031

2 years agoReport dnodes with faulty bonuslen
George Amanakis [Thu, 3 Feb 2022 22:28:19 +0000 (23:28 +0100)]
Report dnodes with faulty bonuslen

In files created/modified before 4254acb there may be a corruption of
xattrs which is not reported during scrub and normal send/receive. It
manifests only as an error when raw sending/receiving. This happens
because currently only the raw receive path checks for discrepancies
between the dnode bonus length and the spill pointer flag.

In case we encounter a dnode whose bonus length is greater than the
predicted one, we should report an error. Modify in this regard
dnode_sync() with an assertion at the end, dump_dnode() to error out,
dsl_scan_recurse() to report errors during a scrub, and zstream to
report a warning when dumping. Also added a test to verify spill blocks
are sent correctly in a raw send.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #12720
Closes #13014

2 years agoRPM: Add missing BuildRequires for PAM component
ColMelvin [Tue, 25 Jan 2022 21:14:43 +0000 (15:14 -0600)]
RPM: Add missing BuildRequires for PAM component

When the optional PAM binaries are included in a build, ./configure will
look for security/pam_modules.h and - if it doesn't find it - recommend
the user install `libpam0g-dev`.  On Red Hat systems, `pam-devel` is the
package that supplies this requirement; `libpam0g-dev` does not exist.

By encoding this requirement in the spec file, we give packagers more
appropriate (and timely) recommendations for completing the build.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Lindee <chris.lindee+github@gmail.com>
Closes #13001