OpenZFS on Linux and FreeBSD
Go to file
Andriy Gapon 7cb437a2a8 fix a subtle bug in dnode_next_offset() with txg > 0
Only stop the search when the upward search cannot find a matching
block pointer in the requested direction from the current offset.
That definitely means that the search is exhausted.

But if the downward search cannot find a suitable block at the
requested level, then cycle back to the upward search for farther
offsets.

This also accounts for a special case of a search for an unallocated
dnode that's been introduced with the large dnode support.  That search
is a level-0 search in a meta-dnode.  It can fail without trying a
subsequent L0 block if the current L0 block is full and at least one
dnode occupies more than one slot.  So, from the fill count perspective
the block appears to have some free space, but it actually does not have
any.

Also, do not ascend needlessly beyond the maximum level that covers all
possible offsets.  Going above that level is bound to be fruitless.
This change reworks a change to dnode_next_offset_level made in
commit 031d7c2fe6.  After this change the span can never be too
large for a shift.

The described situation can happen with a (meta-)dnode like this:

    Object  lvl   iblk   dblk  dsize  dnsize  lsize   %full  type
         0    6   128K    16K   575K     512   608K    3.78  DMU dnode

That is, dn_datablkshift = 14, dn_indblkshift = 17, dn_nlevels = 6
and 64-bit offsets.  Level 5 already covers all possible disk offsets.

In addition, explicit handle too far offsets when working at the top
level.  For lower level we try hold a dbuf at the correct level and
offset.  If the offset is too far then the hold will fail and we will
handle that accordingly.  But at the top level we never checked that the
requested offset is within the range that can be covered by the dnode's
block pointers.

Signed-off-by: Andriy Gapon <avg@FreeBSD.org>
2021-06-24 23:31:11 +03:00
.github Update libera webchat client URL 2021-06-23 17:14:58 -07:00
cmd Annotated dprintf as printf-like 2021-06-22 21:53:45 -07:00
config Forbid basename(3) and dirname(3) 2021-06-11 09:10:21 -07:00
contrib gcc 11 cleanup 2021-06-23 17:57:06 -06:00
etc systemd: import: expand $ZPOOL_IMPORT_OPTS correctly 2021-06-14 09:48:53 -06:00
include gcc 11 cleanup 2021-06-23 17:57:06 -06:00
lib Fix flag copying in resume case 2021-06-24 13:42:01 -06:00
man zgenhostid.8: revisit 2021-06-09 14:36:03 -07:00
module fix a subtle bug in dnode_next_offset() with txg > 0 2021-06-24 23:31:11 +03: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 Stop using "zstreamdump" in tests/ 2021-06-24 09:38:33 -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
CODE_OF_CONDUCT.md Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -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
META Linux 5.12 compat: META 2021-06-21 08:22:40 -07:00
Makefile.am mancheck: accept lints, accept lint overrides 2021-06-04 12:48:26 -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
autogen.sh Cause autogen.sh to fail if autoreconf fails 2018-07-06 09:27:37 -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
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

README.md

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.