Go to file
Matthew Ahrens 069bf406b4
vdev_draid_min_asize() ignores reserved space
vdev_draid_min_asize() returns the minimum size of a child vdev.  This
is used when determining if a disk is big enough to replace a child.
It's also used by zdb to determine how big of a child to make to test
replacement.

vdev_draid_min_asize() says that the child’s asize has to be at least
1/Nth of the entire draid’s asize, which is the same logic as raidz.
However, this contradicts the code in vdev_draid_open(), which
calculates the draid’s asize based on a reduced child size:

  An additional 32MB of scratch space is reserved at the end of each
  child for use by the dRAID expansion feature

So the problem is that you can replace a draid disk with one that’s
vdev_draid_min_asize(), but it actually needs to be larger to accommodate
the additional 32MB.  The replacement is allowed and everything works at
first (since the reserved space is at the end, and we don’t try to use
it yet), but when you try to close and reopen the pool,
vdev_draid_open() calculates a smaller asize for the draid, because of
the smaller leaf, which is not allowed.

I think the confusion is that vdev_draid_min_asize() is correctly
returning the amount of required *allocatable* space in a leaf, but the
actual *size* of the leaf needs to be at least 32MB more than that.
ztest_vdev_attach_detach() assumes that it can attach that size of
device, and it actually can (the kernel/libzpool accepts it), but it
then later causes zdb to not be able to open the pool.

This commit changes vdev_draid_min_asize() to return the required size
of the leaf, not the size that draid will make available to the metaslab
allocator.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #11459
Closes #12221
2021-06-13 10:48:53 -07:00
.github Correct a flaw in the Python 3 version checking 2021-06-08 18:20:16 -06:00
cmd Forbid basename(3) and dirname(3) 2021-06-11 09:10:21 -07:00
config Forbid basename(3) and dirname(3) 2021-06-11 09:10:21 -07:00
contrib dracut: 90zfs: respect zfs_force=1 on systemd systems 2021-06-10 09:26:37 -07:00
etc dracut: 90zfs: respect zfs_force=1 on systemd systems 2021-06-10 09:26:37 -07:00
include libzutil: add zfs_{base,dir}name() 2021-06-11 09:10:05 -07:00
lib Forbid basename(3) and dirname(3) 2021-06-11 09:10:21 -07:00
man zgenhostid.8: revisit 2021-06-09 14:36:03 -07:00
module vdev_draid_min_asize() ignores reserved space 2021-06-13 10:48:53 -07:00
rpm Added uncompress requirement 2021-06-11 09:38:23 -06:00
scripts scripts/commitcheck.sh: fix false positive for signed commits 2021-06-11 09:10:25 -07:00
tests Forbid basename(3) and dirname(3) 2021-06-11 09:10:21 -07:00
udev udev/rules.d: .gitignore: glob all rules 2021-06-01 11:38:45 -07:00
.editorconfig Add an .editorconfig; document git whitespace settings 2020-01-27 13:32:52 -08:00
.gitignore Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
.gitmodules .gitmodules: link to openzfs github repository 2021-04-12 09:37:23 -07:00
AUTHORS Add zstd support to zfs 2020-08-20 10:30:06 -07:00
autogen.sh Cause autogen.sh to fail if autoreconf fails 2018-07-06 09:27:37 -07:00
CODE_OF_CONDUCT.md Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
configure.ac man: use one Makefile, use OpenZFS for .Os 2021-06-09 14:34:47 -07:00
copy-builtin copy-builtin: posix conformance 2021-05-08 08:58:26 -07:00
COPYRIGHT Fix typos 2020-06-09 21:24:09 -07:00
LICENSE Update build system and packaging 2018-05-29 16:00:33 -07:00
Makefile.am mancheck: accept lints, accept lint overrides 2021-06-04 12:48:26 -07:00
META Update META 2021-03-30 10:50:55 -07:00
NEWS Fix NEWS file 2020-08-26 21:44:41 -07:00
NOTICE Update build system and packaging 2018-05-29 16:00:33 -07:00
README.md Update FreeBSD versions 2021-03-16 15:03:28 -07:00
RELEASES.md Add RELEASES.md file 2021-04-02 16:33:40 -07:00
TEST Remove CI builder customization from TEST 2020-03-16 10:46:03 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

img

OpenZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the OpenZFS community. This repository contains the code for running OpenZFS on Linux and FreeBSD.

codecov coverity

Official Resources

Installation

Full documentation for installing OpenZFS on your favorite operating system can be found at the Getting Started Page.

Contribute & Develop

We have a separate document with contribution guidelines.

We have a Code of Conduct.

Release

OpenZFS is released under a CDDL license. For more details see the NOTICE, LICENSE and COPYRIGHT files; UCRL-CODE-235197

Supported Kernels

  • The META file contains the officially recognized supported Linux kernel versions.
  • Supported FreeBSD versions are any supported branches and releases starting from 12.2-RELEASE.