mirror of
https://github.com/openzfs/zfs.git
synced 2025-10-01 19:56:28 +00:00
Compare commits
No commits in common. "master" and "zfs-2.4.0-rc1" have entirely different histories.
master
...
zfs-2.4.0-
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -14,7 +14,7 @@ Please check our issue tracker before opening a new feature request.
|
||||
Filling out the following template will help other contributors better understand your proposed feature.
|
||||
-->
|
||||
|
||||
### Describe the feature you would like to see added to OpenZFS
|
||||
### Describe the feature would like to see added to OpenZFS
|
||||
|
||||
<!--
|
||||
Provide a clear and concise description of the feature.
|
||||
|
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -2,6 +2,11 @@
|
||||
|
||||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
|
||||
<!---
|
||||
Documentation on ZFS Buildbot options can be found at
|
||||
https://openzfs.github.io/openzfs-docs/Developer%20Resources/Buildbot%20Options.html
|
||||
-->
|
||||
|
||||
### Motivation and Context
|
||||
<!--- Why is this change required? What problem does it solve? -->
|
||||
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||
|
@ -65,7 +65,7 @@ if __name__ == '__main__':
|
||||
|
||||
# check last (HEAD) commit message
|
||||
last_commit_message_raw = subprocess.run([
|
||||
'git', 'show', '-s', '--format=%B', head
|
||||
'git', 'show', '-s', '--format=%B', 'HEAD'
|
||||
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
for line in last_commit_message_raw.stdout.decode().splitlines():
|
||||
|
10
.github/workflows/scripts/qemu-1-setup.sh
vendored
10
.github/workflows/scripts/qemu-1-setup.sh
vendored
@ -6,13 +6,6 @@
|
||||
|
||||
set -eu
|
||||
|
||||
# We've been seeing this script take over 15min to run. This may or
|
||||
# may not be normal. Just to get a little more insight, print out
|
||||
# a message to stdout with the top running process, and do this every
|
||||
# 30 seconds. We can delete this watchdog later once we get a better
|
||||
# handle on what the timeout value should be.
|
||||
(while [ 1 ] ; do sleep 30 && echo "[watchdog: $(ps -eo cmd --sort=-pcpu | head -n 2 | tail -n 1)}')]"; done) &
|
||||
|
||||
# install needed packages
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
sudo apt-get -y update
|
||||
@ -72,6 +65,3 @@ sudo zpool create -f -o ashift=12 zpool $SSD1 $SSD2 -O relatime=off \
|
||||
for i in /sys/block/s*/queue/scheduler; do
|
||||
echo "none" | sudo tee $i
|
||||
done
|
||||
|
||||
# Kill off our watchdog
|
||||
kill $(jobs -p)
|
||||
|
2
.github/workflows/scripts/qemu-2-start.sh
vendored
2
.github/workflows/scripts/qemu-2-start.sh
vendored
@ -121,7 +121,7 @@ case "$OS" in
|
||||
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||
;;
|
||||
freebsd15-0c)
|
||||
FreeBSD="15.0-ALPHA3"
|
||||
FreeBSD="15.0-PRERELEASE"
|
||||
OSNAME="FreeBSD $FreeBSD"
|
||||
OSv="freebsd14.0"
|
||||
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI-ufs.raw.xz"
|
||||
|
11
.github/workflows/scripts/qemu-3-deps-vm.sh
vendored
11
.github/workflows/scripts/qemu-3-deps-vm.sh
vendored
@ -20,7 +20,7 @@ function archlinux() {
|
||||
sudo pacman -Sy --noconfirm base-devel bc cpio cryptsetup dhclient dkms \
|
||||
fakeroot fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils \
|
||||
parted pax perf python-packaging python-setuptools qemu-guest-agent ksh \
|
||||
samba strace sysstat rng-tools rsync wget xxhash
|
||||
samba sysstat rng-tools rsync wget xxhash
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
@ -43,8 +43,7 @@ function debian() {
|
||||
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
||||
python3-cffi python3-dev python3-distlib python3-packaging libtirpc-dev \
|
||||
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
||||
rsync samba strace sysstat uuid-dev watchdog wget xfslibs-dev xxhash \
|
||||
zlib1g-dev
|
||||
rsync samba sysstat uuid-dev watchdog wget xfslibs-dev xxhash zlib1g-dev
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
@ -88,8 +87,8 @@ function rhel() {
|
||||
libuuid-devel lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester \
|
||||
parted perf python3 python3-cffi python3-devel python3-packaging \
|
||||
kernel-devel python3-setuptools qemu-guest-agent rng-tools rpcgen \
|
||||
rpm-build rsync samba strace sysstat systemd watchdog wget xfsprogs-devel \
|
||||
xxhash zlib-devel
|
||||
rpm-build rsync samba sysstat systemd watchdog wget xfsprogs-devel xxhash \
|
||||
zlib-devel
|
||||
echo "##[endgroup]"
|
||||
}
|
||||
|
||||
@ -105,7 +104,7 @@ function install_fedora_experimental_kernel {
|
||||
our_version="$1"
|
||||
sudo dnf -y copr enable @kernel-vanilla/stable
|
||||
sudo dnf -y copr enable @kernel-vanilla/mainline
|
||||
all="$(sudo dnf list --showduplicates kernel-* python3-perf* perf* bpftool*)"
|
||||
all="$(sudo dnf list --showduplicates kernel-*)"
|
||||
echo "Available versions:"
|
||||
echo "$all"
|
||||
|
||||
|
31
.github/workflows/scripts/qemu-5-setup.sh
vendored
31
.github/workflows/scripts/qemu-5-setup.sh
vendored
@ -108,30 +108,19 @@ echo '*/5 * * * * /root/cronjob.sh' > crontab.txt
|
||||
sudo crontab crontab.txt
|
||||
rm crontab.txt
|
||||
|
||||
# Save the VM's serial output (ttyS0) to /var/tmp/console.txt
|
||||
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
|
||||
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
|
||||
for ((i=1; i<=VMs; i++)); do
|
||||
mkdir -p $RESPATH/vm$i
|
||||
read "pty" <<< $(sudo virsh ttyconsole vm$i)
|
||||
|
||||
# Create the file so we can tail it, even if there's no output.
|
||||
touch $RESPATH/vm$i/console.txt
|
||||
|
||||
sudo nohup bash -c "cat $pty > $RESPATH/vm$i/console.txt" &
|
||||
|
||||
# Write all VM boot lines to the console to aid in debugging failed boots.
|
||||
# The boot lines from all the VMs will be munged together, so prepend each
|
||||
# line with the vm hostname (like 'vm1:').
|
||||
(while IFS=$'\n' read -r line; do echo "vm$i: $line" ; done < <(sudo tail -f $RESPATH/vm$i/console.txt)) &
|
||||
|
||||
done
|
||||
echo "Console logging for ${VMs}x $OS started."
|
||||
|
||||
|
||||
# check if the machines are okay
|
||||
echo "Waiting for vm's to come up... (${VMs}x CPU=$CPU RAM=$RAM)"
|
||||
for ((i=1; i<=VMs; i++)); do
|
||||
.github/workflows/scripts/qemu-wait-for-vm.sh vm$i
|
||||
done
|
||||
echo "All $VMs VMs are up now."
|
||||
|
||||
# Save the VM's serial output (ttyS0) to /var/tmp/console.txt
|
||||
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
|
||||
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
|
||||
for ((i=1; i<=VMs; i++)); do
|
||||
mkdir -p $RESPATH/vm$i
|
||||
read "pty" <<< $(sudo virsh ttyconsole vm$i)
|
||||
sudo nohup bash -c "cat $pty > $RESPATH/vm$i/console.txt" &
|
||||
done
|
||||
echo "Console logging for ${VMs}x $OS started."
|
||||
|
2
.github/workflows/scripts/qemu-6-tests.sh
vendored
2
.github/workflows/scripts/qemu-6-tests.sh
vendored
@ -111,7 +111,7 @@ fi
|
||||
sudo dmesg -c > dmesg-prerun.txt
|
||||
mount > mount.txt
|
||||
df -h > df-prerun.txt
|
||||
$TDIR/zfs-tests.sh -vKO -s 3GB -T $TAGS
|
||||
$TDIR/zfs-tests.sh -vK -s 3GB -T $TAGS
|
||||
RV=$?
|
||||
df -h > df-postrun.txt
|
||||
echo $RV > tests-exitcode.txt
|
||||
|
15
.github/workflows/zfs-qemu.yml
vendored
15
.github/workflows/zfs-qemu.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
||||
os_selection="$FULL_OS"
|
||||
fi
|
||||
|
||||
if ${{ github.event.inputs.fedora_kernel_ver != '' }}; then
|
||||
if [ ${{ github.event.inputs.fedora_kernel_ver }} != "" ] ; then
|
||||
# They specified a custom kernel version for Fedora. Use only
|
||||
# Fedora runners.
|
||||
os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]')
|
||||
@ -53,8 +53,9 @@ jobs:
|
||||
os_json=$(echo ${os_selection} | jq -c)
|
||||
fi
|
||||
|
||||
echo "os=$os_json" | tee -a $GITHUB_OUTPUT
|
||||
echo "ci_type=$ci_type" | tee -a $GITHUB_OUTPUT
|
||||
echo $os_json
|
||||
echo "os=$os_json" >> $GITHUB_OUTPUT
|
||||
echo "ci_type=$ci_type" >> $GITHUB_OUTPUT
|
||||
|
||||
qemu-vm:
|
||||
name: qemu-x86
|
||||
@ -77,12 +78,8 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Setup QEMU
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
# Add a timestamp to each line to debug timeouts
|
||||
while IFS=$'\n' read -r line; do
|
||||
echo "$(date +'%H:%M:%S') $line"
|
||||
done < <(.github/workflows/scripts/qemu-1-setup.sh)
|
||||
timeout-minutes: 10
|
||||
run: .github/workflows/scripts/qemu-1-setup.sh
|
||||
|
||||
- name: Start build machine
|
||||
timeout-minutes: 10
|
||||
|
6
META
6
META
@ -1,10 +1,10 @@
|
||||
Meta: 1
|
||||
Name: zfs
|
||||
Branch: 1.0
|
||||
Version: 2.4.99
|
||||
Release: 1
|
||||
Version: 2.4.0
|
||||
Release: rc1
|
||||
Release-Tags: relext
|
||||
License: CDDL
|
||||
Author: OpenZFS
|
||||
Linux-Maximum: 6.17
|
||||
Linux-Maximum: 6.16
|
||||
Linux-Minimum: 4.18
|
||||
|
@ -1,7 +1,6 @@
|
||||
CLEANFILES =
|
||||
dist_noinst_DATA =
|
||||
INSTALL_DATA_HOOKS =
|
||||
INSTALL_EXEC_HOOKS =
|
||||
ALL_LOCAL =
|
||||
CLEAN_LOCAL =
|
||||
CHECKS = shellcheck checkbashisms
|
||||
@ -72,9 +71,6 @@ all: gitrev
|
||||
PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
|
||||
install-data-hook: $(INSTALL_DATA_HOOKS)
|
||||
|
||||
PHONY += install-exec-hook $(INSTALL_EXEC_HOOKS)
|
||||
install-exec-hook: $(INSTALL_EXEC_HOOKS)
|
||||
|
||||
PHONY += maintainer-clean-local
|
||||
maintainer-clean-local:
|
||||
-$(RM) $(GITREV)
|
||||
|
@ -98,16 +98,17 @@ endif
|
||||
|
||||
|
||||
if USING_PYTHON
|
||||
bin_SCRIPTS += zarcsummary zarcstat dbufstat zilstat
|
||||
CLEANFILES += zarcsummary zarcstat dbufstat zilstat
|
||||
dist_noinst_DATA += %D%/zarcsummary %D%/zarcstat.in %D%/dbufstat.in %D%/zilstat.in
|
||||
bin_SCRIPTS += arc_summary arcstat dbufstat zilstat
|
||||
CLEANFILES += arc_summary arcstat dbufstat zilstat
|
||||
dist_noinst_DATA += %D%/arc_summary %D%/arcstat.in %D%/dbufstat.in %D%/zilstat.in
|
||||
|
||||
$(call SUBST,zarcstat,%D%/)
|
||||
$(call SUBST,arcstat,%D%/)
|
||||
$(call SUBST,dbufstat,%D%/)
|
||||
$(call SUBST,zilstat,%D%/)
|
||||
zarcsummary: %D%/zarcsummary
|
||||
arc_summary: %D%/arc_summary
|
||||
$(AM_V_at)cp $< $@
|
||||
endif
|
||||
|
||||
|
||||
PHONY += cmd
|
||||
cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(mounthelper_PROGRAMS)
|
||||
|
@ -34,7 +34,7 @@ Provides basic information on the ARC, its efficiency, the L2ARC (if present),
|
||||
the Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See
|
||||
the in-source documentation and code at
|
||||
https://github.com/openzfs/zfs/blob/master/module/zfs/arc.c for details.
|
||||
The original introduction to zarcsummary can be found at
|
||||
The original introduction to arc_summary can be found at
|
||||
http://cuddletech.com/?p=454
|
||||
"""
|
||||
|
||||
@ -161,7 +161,7 @@ elif sys.platform.startswith('linux'):
|
||||
return get_params(TUNABLES_PATH)
|
||||
|
||||
def get_version_impl(request):
|
||||
# The original zarcsummary called /sbin/modinfo/{spl,zfs} to get
|
||||
# The original arc_summary called /sbin/modinfo/{spl,zfs} to get
|
||||
# the version information. We switch to /sys/module/{spl,zfs}/version
|
||||
# to make sure we get what is really loaded in the kernel
|
||||
try:
|
||||
@ -439,7 +439,7 @@ def print_header():
|
||||
"""
|
||||
|
||||
# datetime is now recommended over time but we keep the exact formatting
|
||||
# from the older version of zarcsummary in case there are scripts
|
||||
# from the older version of arc_summary in case there are scripts
|
||||
# that expect it in this way
|
||||
daydate = time.strftime(DATE_FORMAT)
|
||||
spc_date = LINE_LENGTH-len(daydate)
|
@ -2,7 +2,7 @@
|
||||
# SPDX-License-Identifier: CDDL-1.0
|
||||
#
|
||||
# Print out ZFS ARC Statistics exported via kstat(1)
|
||||
# For a definition of fields, or usage, use zarcstat -v
|
||||
# For a definition of fields, or usage, use arcstat -v
|
||||
#
|
||||
# This script was originally a fork of the original arcstat.pl (0.1)
|
||||
# by Neelakanth Nadgir, originally published on his Sun blog on
|
||||
@ -56,7 +56,6 @@ import time
|
||||
import getopt
|
||||
import re
|
||||
import copy
|
||||
import os
|
||||
|
||||
from signal import signal, SIGINT, SIGWINCH, SIG_DFL
|
||||
|
||||
@ -172,7 +171,7 @@ cols = {
|
||||
"zactive": [7, 1000, "zfetch prefetches active per second"],
|
||||
}
|
||||
|
||||
# ARC structural breakdown from zarcsummary
|
||||
# ARC structural breakdown from arc_summary
|
||||
structfields = {
|
||||
"cmp": ["compressed", "Compressed"],
|
||||
"ovh": ["overhead", "Overhead"],
|
||||
@ -188,7 +187,7 @@ structstats = { # size stats
|
||||
"sz": ["_size", "size"],
|
||||
}
|
||||
|
||||
# ARC types breakdown from zarcsummary
|
||||
# ARC types breakdown from arc_summary
|
||||
typefields = {
|
||||
"data": ["data", "ARC data"],
|
||||
"meta": ["metadata", "ARC metadata"],
|
||||
@ -199,7 +198,7 @@ typestats = { # size stats
|
||||
"sz": ["_size", "size"],
|
||||
}
|
||||
|
||||
# ARC states breakdown from zarcsummary
|
||||
# ARC states breakdown from arc_summary
|
||||
statefields = {
|
||||
"ano": ["anon", "Anonymous"],
|
||||
"mfu": ["mfu", "MFU"],
|
||||
@ -262,7 +261,7 @@ hdr_intr = 20 # Print header every 20 lines of output
|
||||
opfile = None
|
||||
sep = " " # Default separator is 2 spaces
|
||||
l2exist = False
|
||||
cmd = ("Usage: zarcstat [-havxp] [-f fields] [-o file] [-s string] [interval "
|
||||
cmd = ("Usage: arcstat [-havxp] [-f fields] [-o file] [-s string] [interval "
|
||||
"[count]]\n")
|
||||
cur = {}
|
||||
d = {}
|
||||
@ -349,10 +348,10 @@ def usage():
|
||||
"character or string\n")
|
||||
sys.stderr.write("\t -p : Disable auto-scaling of numerical fields\n")
|
||||
sys.stderr.write("\nExamples:\n")
|
||||
sys.stderr.write("\tzarcstat -o /tmp/a.log 2 10\n")
|
||||
sys.stderr.write("\tzarcstat -s \",\" -o /tmp/a.log 2 10\n")
|
||||
sys.stderr.write("\tzarcstat -v\n")
|
||||
sys.stderr.write("\tzarcstat -f time,hit%,dh%,ph%,mh% 1\n")
|
||||
sys.stderr.write("\tarcstat -o /tmp/a.log 2 10\n")
|
||||
sys.stderr.write("\tarcstat -s \",\" -o /tmp/a.log 2 10\n")
|
||||
sys.stderr.write("\tarcstat -v\n")
|
||||
sys.stderr.write("\tarcstat -f time,hit%,dh%,ph%,mh% 1\n")
|
||||
sys.stderr.write("\n")
|
||||
|
||||
sys.exit(1)
|
||||
@ -367,7 +366,7 @@ def snap_stats():
|
||||
|
||||
cur = kstat
|
||||
|
||||
# fill in additional values from zarcsummary
|
||||
# fill in additional values from arc_summary
|
||||
cur["caches_size"] = caches_size = cur["anon_data"]+cur["anon_metadata"]+\
|
||||
cur["mfu_data"]+cur["mfu_metadata"]+cur["mru_data"]+cur["mru_metadata"]+\
|
||||
cur["uncached_data"]+cur["uncached_metadata"]
|
||||
@ -767,7 +766,6 @@ def calculate():
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
global sint
|
||||
global count
|
||||
global hdr_intr
|
@ -107,9 +107,7 @@ extern uint_t zfs_reconstruct_indirect_combinations_max;
|
||||
extern uint_t zfs_btree_verify_intensity;
|
||||
|
||||
static const char cmdname[] = "zdb";
|
||||
uint8_t dump_opt[512];
|
||||
|
||||
#define ALLOCATED_OPT 256
|
||||
uint8_t dump_opt[256];
|
||||
|
||||
typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size);
|
||||
|
||||
@ -385,7 +383,7 @@ verify_livelist_allocs(metaslab_verify_t *mv, uint64_t txg,
|
||||
sublivelist_verify_block_t svb = {{{0}}};
|
||||
DVA_SET_VDEV(&svb.svb_dva, mv->mv_vdid);
|
||||
DVA_SET_OFFSET(&svb.svb_dva, offset);
|
||||
DVA_SET_ASIZE(&svb.svb_dva, 0);
|
||||
DVA_SET_ASIZE(&svb.svb_dva, size);
|
||||
zfs_btree_index_t where;
|
||||
uint64_t end_offset = offset + size;
|
||||
|
||||
@ -1668,16 +1666,6 @@ dump_metaslab_stats(metaslab_t *msp)
|
||||
dump_histogram(rt->rt_histogram, ZFS_RANGE_TREE_HISTOGRAM_SIZE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_allocated(void *arg, uint64_t start, uint64_t size)
|
||||
{
|
||||
uint64_t *off = arg;
|
||||
if (*off != start)
|
||||
(void) printf("ALLOC: %"PRIu64" %"PRIu64"\n", *off,
|
||||
start - *off);
|
||||
*off = start + size;
|
||||
}
|
||||
|
||||
static void
|
||||
dump_metaslab(metaslab_t *msp)
|
||||
{
|
||||
@ -1694,24 +1682,13 @@ dump_metaslab(metaslab_t *msp)
|
||||
(u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start,
|
||||
(u_longlong_t)space_map_object(sm), freebuf);
|
||||
|
||||
if (dump_opt[ALLOCATED_OPT] ||
|
||||
(dump_opt['m'] > 2 && !dump_opt['L'])) {
|
||||
if (dump_opt['m'] > 2 && !dump_opt['L']) {
|
||||
mutex_enter(&msp->ms_lock);
|
||||
VERIFY0(metaslab_load(msp));
|
||||
}
|
||||
|
||||
if (dump_opt['m'] > 2 && !dump_opt['L']) {
|
||||
zfs_range_tree_stat_verify(msp->ms_allocatable);
|
||||
dump_metaslab_stats(msp);
|
||||
}
|
||||
|
||||
if (dump_opt[ALLOCATED_OPT]) {
|
||||
uint64_t off = msp->ms_start;
|
||||
zfs_range_tree_walk(msp->ms_allocatable, dump_allocated,
|
||||
&off);
|
||||
if (off != msp->ms_start + msp->ms_size)
|
||||
(void) printf("ALLOC: %"PRIu64" %"PRIu64"\n", off,
|
||||
msp->ms_size - off);
|
||||
metaslab_unload(msp);
|
||||
mutex_exit(&msp->ms_lock);
|
||||
}
|
||||
|
||||
if (dump_opt['m'] > 1 && sm != NULL &&
|
||||
@ -1726,12 +1703,6 @@ dump_metaslab(metaslab_t *msp)
|
||||
SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift);
|
||||
}
|
||||
|
||||
if (dump_opt[ALLOCATED_OPT] ||
|
||||
(dump_opt['m'] > 2 && !dump_opt['L'])) {
|
||||
metaslab_unload(msp);
|
||||
mutex_exit(&msp->ms_lock);
|
||||
}
|
||||
|
||||
if (vd->vdev_ops == &vdev_draid_ops)
|
||||
ASSERT3U(msp->ms_size, <=, 1ULL << vd->vdev_ms_shift);
|
||||
else
|
||||
@ -1768,9 +1739,8 @@ print_vdev_metaslab_header(vdev_t *vd)
|
||||
}
|
||||
}
|
||||
|
||||
(void) printf("\tvdev %10llu\t%s metaslab shift %4llu",
|
||||
(u_longlong_t)vd->vdev_id, bias_str,
|
||||
(u_longlong_t)vd->vdev_ms_shift);
|
||||
(void) printf("\tvdev %10llu %s",
|
||||
(u_longlong_t)vd->vdev_id, bias_str);
|
||||
|
||||
if (ms_flush_data_obj != 0) {
|
||||
(void) printf(" ms_unflushed_phys object %llu",
|
||||
@ -2664,8 +2634,8 @@ print_indirect(spa_t *spa, blkptr_t *bp, const zbookmark_phys_t *zb,
|
||||
}
|
||||
if (BP_GET_LEVEL(bp) != zb->zb_level) {
|
||||
(void) printf(" (ERROR: Block pointer level "
|
||||
"(%llu) does not match bookmark level (%lld))",
|
||||
BP_GET_LEVEL(bp), (longlong_t)zb->zb_level);
|
||||
"(%llu) does not match bookmark level (%ld))",
|
||||
BP_GET_LEVEL(bp), zb->zb_level);
|
||||
corruption_found = B_TRUE;
|
||||
}
|
||||
}
|
||||
@ -2718,8 +2688,8 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
|
||||
if (fill != BP_GET_FILL(bp)) {
|
||||
(void) printf("%16llx: Block pointer "
|
||||
"fill (%llu) does not match calculated "
|
||||
"value (%llu)\n", offset, BP_GET_FILL(bp),
|
||||
(u_longlong_t)fill);
|
||||
"value (%lu)\n", offset, BP_GET_FILL(bp),
|
||||
fill);
|
||||
corruption_found = B_TRUE;
|
||||
}
|
||||
}
|
||||
@ -3301,7 +3271,6 @@ zdb_derive_key(dsl_dir_t *dd, uint8_t *key_out)
|
||||
uint64_t keyformat, salt, iters;
|
||||
int i;
|
||||
unsigned char c;
|
||||
FILE *f;
|
||||
|
||||
VERIFY0(zap_lookup(dd->dd_pool->dp_meta_objset, dd->dd_crypto_obj,
|
||||
zfs_prop_to_name(ZFS_PROP_KEYFORMAT), sizeof (uint64_t),
|
||||
@ -3334,25 +3303,6 @@ zdb_derive_key(dsl_dir_t *dd, uint8_t *key_out)
|
||||
|
||||
break;
|
||||
|
||||
case ZFS_KEYFORMAT_RAW:
|
||||
if ((f = fopen(key_material, "r")) == NULL)
|
||||
return (B_FALSE);
|
||||
|
||||
if (fread(key_out, 1, WRAPPING_KEY_LEN, f) !=
|
||||
WRAPPING_KEY_LEN) {
|
||||
(void) fclose(f);
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
/* Check the key length */
|
||||
if (fgetc(f) != EOF) {
|
||||
(void) fclose(f);
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
(void) fclose(f);
|
||||
break;
|
||||
|
||||
default:
|
||||
fatal("no support for key format %u\n",
|
||||
(unsigned int) keyformat);
|
||||
@ -9425,8 +9375,6 @@ main(int argc, char **argv)
|
||||
{"all-reconstruction", no_argument, NULL, 'Y'},
|
||||
{"livelist", no_argument, NULL, 'y'},
|
||||
{"zstd-headers", no_argument, NULL, 'Z'},
|
||||
{"allocated-map", no_argument, NULL,
|
||||
ALLOCATED_OPT},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -9457,7 +9405,6 @@ main(int argc, char **argv)
|
||||
case 'u':
|
||||
case 'y':
|
||||
case 'Z':
|
||||
case ALLOCATED_OPT:
|
||||
dump_opt[c]++;
|
||||
dump_all = 0;
|
||||
break;
|
||||
|
@ -29,6 +29,6 @@
|
||||
#define _ZDB_H
|
||||
|
||||
void dump_intent_log(zilog_t *);
|
||||
extern uint8_t dump_opt[512];
|
||||
extern uint8_t dump_opt[256];
|
||||
|
||||
#endif /* _ZDB_H */
|
||||
|
@ -48,6 +48,8 @@
|
||||
|
||||
#include "zdb.h"
|
||||
|
||||
extern uint8_t dump_opt[256];
|
||||
|
||||
static char tab_prefix[4] = "\t\t\t";
|
||||
|
||||
static void
|
||||
|
@ -9,18 +9,18 @@ dist_zedexec_SCRIPTS = \
|
||||
%D%/all-debug.sh \
|
||||
%D%/all-syslog.sh \
|
||||
%D%/data-notify.sh \
|
||||
%D%/deadman-sync-slot_off.sh \
|
||||
%D%/deadman-slot_off.sh \
|
||||
%D%/generic-notify.sh \
|
||||
%D%/pool_import-sync-led.sh \
|
||||
%D%/pool_import-led.sh \
|
||||
%D%/resilver_finish-notify.sh \
|
||||
%D%/resilver_finish-start-scrub.sh \
|
||||
%D%/scrub_finish-notify.sh \
|
||||
%D%/statechange-sync-led.sh \
|
||||
%D%/statechange-led.sh \
|
||||
%D%/statechange-notify.sh \
|
||||
%D%/statechange-sync-slot_off.sh \
|
||||
%D%/statechange-slot_off.sh \
|
||||
%D%/trim_finish-notify.sh \
|
||||
%D%/vdev_attach-sync-led.sh \
|
||||
%D%/vdev_clear-sync-led.sh
|
||||
%D%/vdev_attach-led.sh \
|
||||
%D%/vdev_clear-led.sh
|
||||
|
||||
nodist_zedexec_SCRIPTS = \
|
||||
%D%/history_event-zfs-list-cacher.sh
|
||||
@ -30,17 +30,17 @@ SUBSTFILES += $(nodist_zedexec_SCRIPTS)
|
||||
zedconfdefaults = \
|
||||
all-syslog.sh \
|
||||
data-notify.sh \
|
||||
deadman-sync-slot_off.sh \
|
||||
deadman-slot_off.sh \
|
||||
history_event-zfs-list-cacher.sh \
|
||||
pool_import-sync-led.sh \
|
||||
pool_import-led.sh \
|
||||
resilver_finish-notify.sh \
|
||||
resilver_finish-start-scrub.sh \
|
||||
scrub_finish-notify.sh \
|
||||
statechange-sync-led.sh \
|
||||
statechange-led.sh \
|
||||
statechange-notify.sh \
|
||||
statechange-sync-slot_off.sh \
|
||||
vdev_attach-sync-led.sh \
|
||||
vdev_clear-sync-led.sh
|
||||
statechange-slot_off.sh \
|
||||
vdev_attach-led.sh \
|
||||
vdev_clear-led.sh
|
||||
|
||||
dist_noinst_DATA += %D%/README
|
||||
|
||||
|
1
cmd/zed/zed.d/pool_import-led.sh
Symbolic link
1
cmd/zed/zed.d/pool_import-led.sh
Symbolic link
@ -0,0 +1 @@
|
||||
statechange-led.sh
|
@ -1 +0,0 @@
|
||||
statechange-sync-led.sh
|
1
cmd/zed/zed.d/vdev_attach-led.sh
Symbolic link
1
cmd/zed/zed.d/vdev_attach-led.sh
Symbolic link
@ -0,0 +1 @@
|
||||
statechange-led.sh
|
@ -1 +0,0 @@
|
||||
statechange-sync-led.sh
|
1
cmd/zed/zed.d/vdev_clear-led.sh
Symbolic link
1
cmd/zed/zed.d/vdev_clear-led.sh
Symbolic link
@ -0,0 +1 @@
|
||||
statechange-led.sh
|
@ -1 +0,0 @@
|
||||
statechange-sync-led.sh
|
@ -196,29 +196,37 @@ _nop(int sig)
|
||||
(void) sig;
|
||||
}
|
||||
|
||||
static void
|
||||
wait_for_children(boolean_t do_pause, boolean_t wait)
|
||||
static void *
|
||||
_reap_children(void *arg)
|
||||
{
|
||||
pid_t pid;
|
||||
struct rusage usage;
|
||||
int status;
|
||||
(void) arg;
|
||||
struct launched_process_node node, *pnode;
|
||||
pid_t pid;
|
||||
int status;
|
||||
struct rusage usage;
|
||||
struct sigaction sa = {};
|
||||
|
||||
(void) sigfillset(&sa.sa_mask);
|
||||
(void) sigdelset(&sa.sa_mask, SIGCHLD);
|
||||
(void) pthread_sigmask(SIG_SETMASK, &sa.sa_mask, NULL);
|
||||
|
||||
(void) sigemptyset(&sa.sa_mask);
|
||||
sa.sa_handler = _nop;
|
||||
sa.sa_flags = SA_NOCLDSTOP;
|
||||
(void) sigaction(SIGCHLD, &sa, NULL);
|
||||
|
||||
for (_reap_children_stop = B_FALSE; !_reap_children_stop; ) {
|
||||
(void) pthread_mutex_lock(&_launched_processes_lock);
|
||||
pid = wait4(0, &status, wait ? 0 : WNOHANG, &usage);
|
||||
pid = wait4(0, &status, WNOHANG, &usage);
|
||||
|
||||
if (pid == 0 || pid == (pid_t)-1) {
|
||||
(void) pthread_mutex_unlock(&_launched_processes_lock);
|
||||
if ((pid == 0) || (errno == ECHILD)) {
|
||||
if (do_pause)
|
||||
pause();
|
||||
} else if (errno != EINTR)
|
||||
if (pid == 0 || errno == ECHILD)
|
||||
pause();
|
||||
else if (errno != EINTR)
|
||||
zed_log_msg(LOG_WARNING,
|
||||
"Failed to wait for children: %s",
|
||||
strerror(errno));
|
||||
if (!do_pause)
|
||||
return;
|
||||
|
||||
} else {
|
||||
memset(&node, 0, sizeof (node));
|
||||
node.pid = pid;
|
||||
@ -270,25 +278,6 @@ wait_for_children(boolean_t do_pause, boolean_t wait)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void *
|
||||
_reap_children(void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
struct sigaction sa = {};
|
||||
|
||||
(void) sigfillset(&sa.sa_mask);
|
||||
(void) sigdelset(&sa.sa_mask, SIGCHLD);
|
||||
(void) pthread_sigmask(SIG_SETMASK, &sa.sa_mask, NULL);
|
||||
|
||||
(void) sigemptyset(&sa.sa_mask);
|
||||
sa.sa_handler = _nop;
|
||||
sa.sa_flags = SA_NOCLDSTOP;
|
||||
(void) sigaction(SIGCHLD, &sa, NULL);
|
||||
|
||||
wait_for_children(B_TRUE, B_FALSE);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -317,45 +306,6 @@ zed_exec_fini(void)
|
||||
_reap_children_tid = (pthread_t)-1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the zedlet name indicates if it is a synchronous zedlet
|
||||
*
|
||||
* Synchronous zedlets have a "-sync-" immediately following the event name in
|
||||
* their zedlet filename, like:
|
||||
*
|
||||
* EVENT_NAME-sync-ZEDLETNAME.sh
|
||||
*
|
||||
* For example, if you wanted a synchronous statechange script:
|
||||
*
|
||||
* statechange-sync-myzedlet.sh
|
||||
*
|
||||
* Synchronous zedlets are guaranteed to be the only zedlet running. No other
|
||||
* zedlets may run in parallel with a synchronous zedlet. A synchronous
|
||||
* zedlet will wait for all previously spawned zedlets to finish before running.
|
||||
* Users should be careful to only use synchronous zedlets when needed, since
|
||||
* they decrease parallelism.
|
||||
*/
|
||||
static boolean_t
|
||||
zedlet_is_sync(const char *zedlet, const char *event)
|
||||
{
|
||||
const char *sync_str = "-sync-";
|
||||
size_t sync_str_len;
|
||||
size_t zedlet_len;
|
||||
size_t event_len;
|
||||
|
||||
sync_str_len = strlen(sync_str);
|
||||
zedlet_len = strlen(zedlet);
|
||||
event_len = strlen(event);
|
||||
|
||||
if (event_len + sync_str_len >= zedlet_len)
|
||||
return (B_FALSE);
|
||||
|
||||
if (strncmp(&zedlet[event_len], sync_str, sync_str_len) == 0)
|
||||
return (B_TRUE);
|
||||
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Process the event [eid] by synchronously invoking all zedlets with a
|
||||
* matching class prefix.
|
||||
@ -418,28 +368,9 @@ zed_exec_process(uint64_t eid, const char *class, const char *subclass,
|
||||
z = zed_strings_next(zcp->zedlets)) {
|
||||
for (csp = class_strings; *csp; csp++) {
|
||||
n = strlen(*csp);
|
||||
if ((strncmp(z, *csp, n) == 0) && !isalpha(z[n])) {
|
||||
boolean_t is_sync = zedlet_is_sync(z, *csp);
|
||||
|
||||
if (is_sync) {
|
||||
/*
|
||||
* Wait for previous zedlets to
|
||||
* finish
|
||||
*/
|
||||
wait_for_children(B_FALSE, B_TRUE);
|
||||
}
|
||||
|
||||
if ((strncmp(z, *csp, n) == 0) && !isalpha(z[n]))
|
||||
_zed_exec_fork_child(eid, zcp->zedlet_dir,
|
||||
z, e, zcp->zevent_fd, zcp->do_foreground);
|
||||
|
||||
if (is_sync) {
|
||||
/*
|
||||
* Wait for sync zedlet we just launched
|
||||
* to finish.
|
||||
*/
|
||||
wait_for_children(B_FALSE, B_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
free(e);
|
||||
|
@ -930,15 +930,19 @@ usage:
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the minimum allocation size based on the top-level vdevs.
|
||||
* Return a default volblocksize for the pool which always uses more than
|
||||
* half of the data sectors. This primarily applies to dRAID which always
|
||||
* writes full stripe widths.
|
||||
*/
|
||||
static uint64_t
|
||||
calculate_volblocksize(nvlist_t *config)
|
||||
default_volblocksize(zpool_handle_t *zhp, nvlist_t *props)
|
||||
{
|
||||
uint64_t asize = SPA_MINBLOCKSIZE;
|
||||
uint64_t volblocksize, asize = SPA_MINBLOCKSIZE;
|
||||
nvlist_t *tree, **vdevs;
|
||||
uint_t nvdevs;
|
||||
|
||||
nvlist_t *config = zpool_get_config(zhp, NULL);
|
||||
|
||||
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &tree) != 0 ||
|
||||
nvlist_lookup_nvlist_array(tree, ZPOOL_CONFIG_CHILDREN,
|
||||
&vdevs, &nvdevs) != 0) {
|
||||
@ -969,24 +973,6 @@ calculate_volblocksize(nvlist_t *config)
|
||||
}
|
||||
}
|
||||
|
||||
return (asize);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a default volblocksize for the pool which always uses more than
|
||||
* half of the data sectors. This primarily applies to dRAID which always
|
||||
* writes full stripe widths.
|
||||
*/
|
||||
static uint64_t
|
||||
default_volblocksize(zpool_handle_t *zhp, nvlist_t *props)
|
||||
{
|
||||
uint64_t volblocksize, asize = SPA_MINBLOCKSIZE;
|
||||
|
||||
nvlist_t *config = zpool_get_config(zhp, NULL);
|
||||
|
||||
if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_MAX_ALLOC, &asize) != 0)
|
||||
asize = calculate_volblocksize(config);
|
||||
|
||||
/*
|
||||
* Calculate the target volblocksize such that more than half
|
||||
* of the asize is used. The following table is for 4k sectors.
|
||||
@ -5317,7 +5303,6 @@ zfs_do_receive(int argc, char **argv)
|
||||
#define ZFS_DELEG_PERM_MOUNT "mount"
|
||||
#define ZFS_DELEG_PERM_SHARE "share"
|
||||
#define ZFS_DELEG_PERM_SEND "send"
|
||||
#define ZFS_DELEG_PERM_SEND_RAW "send:raw"
|
||||
#define ZFS_DELEG_PERM_RECEIVE "receive"
|
||||
#define ZFS_DELEG_PERM_RECEIVE_APPEND "receive:append"
|
||||
#define ZFS_DELEG_PERM_ALLOW "allow"
|
||||
@ -5360,7 +5345,6 @@ static zfs_deleg_perm_tab_t zfs_deleg_perm_tbl[] = {
|
||||
{ ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
|
||||
{ ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
|
||||
{ ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
|
||||
{ ZFS_DELEG_PERM_SEND_RAW, ZFS_DELEG_NOTE_SEND_RAW },
|
||||
{ ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE },
|
||||
{ ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
|
||||
{ ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
|
||||
@ -5945,10 +5929,6 @@ deleg_perm_comment(zfs_deleg_note_t note)
|
||||
case ZFS_DELEG_NOTE_SEND:
|
||||
str = gettext("");
|
||||
break;
|
||||
case ZFS_DELEG_NOTE_SEND_RAW:
|
||||
str = gettext("Allow sending ONLY encrypted (raw) replication"
|
||||
"\n\t\t\t\tstreams");
|
||||
break;
|
||||
case ZFS_DELEG_NOTE_SHARE:
|
||||
str = gettext("Allows sharing file systems over NFS or SMB"
|
||||
"\n\t\t\t\tprotocols");
|
||||
@ -6878,17 +6858,17 @@ print_holds(boolean_t scripted, int nwidth, int tagwidth, nvlist_t *nvl,
|
||||
|
||||
if (scripted) {
|
||||
if (parsable) {
|
||||
(void) printf("%s\t%s\t%lld\n", zname,
|
||||
tagname, (long long)time);
|
||||
(void) printf("%s\t%s\t%ld\n", zname,
|
||||
tagname, time);
|
||||
} else {
|
||||
(void) printf("%s\t%s\t%s\n", zname,
|
||||
tagname, tsbuf);
|
||||
}
|
||||
} else {
|
||||
if (parsable) {
|
||||
(void) printf("%-*s %-*s %lld\n",
|
||||
(void) printf("%-*s %-*s %ld\n",
|
||||
nwidth, zname, tagwidth,
|
||||
tagname, (long long)time);
|
||||
tagname, time);
|
||||
} else {
|
||||
(void) printf("%-*s %-*s %s\n",
|
||||
nwidth, zname, tagwidth,
|
||||
|
335
cmd/zhack.c
335
cmd/zhack.c
@ -54,7 +54,6 @@
|
||||
#include <sys/dmu_tx.h>
|
||||
#include <zfeature_common.h>
|
||||
#include <libzutil.h>
|
||||
#include <sys/metaslab_impl.h>
|
||||
|
||||
static importargs_t g_importargs;
|
||||
static char *g_pool;
|
||||
@ -70,8 +69,7 @@ static __attribute__((noreturn)) void
|
||||
usage(void)
|
||||
{
|
||||
(void) fprintf(stderr,
|
||||
"Usage: zhack [-o tunable] [-c cachefile] [-d dir] <subcommand> "
|
||||
"<args> ...\n"
|
||||
"Usage: zhack [-c cachefile] [-d dir] <subcommand> <args> ...\n"
|
||||
"where <subcommand> <args> is one of the following:\n"
|
||||
"\n");
|
||||
|
||||
@ -95,10 +93,7 @@ usage(void)
|
||||
" -c repair corrupted label checksums\n"
|
||||
" -u restore the label on a detached device\n"
|
||||
"\n"
|
||||
" <device> : path to vdev\n"
|
||||
"\n"
|
||||
" metaslab leak <pool>\n"
|
||||
" apply allocation map from zdb to specified pool\n");
|
||||
" <device> : path to vdev\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -368,12 +363,10 @@ feature_incr_sync(void *arg, dmu_tx_t *tx)
|
||||
zfeature_info_t *feature = arg;
|
||||
uint64_t refcount;
|
||||
|
||||
mutex_enter(&spa->spa_feat_stats_lock);
|
||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||
feature_sync(spa, feature, refcount + 1, tx);
|
||||
spa_history_log_internal(spa, "zhack feature incr", tx,
|
||||
"name=%s", feature->fi_guid);
|
||||
mutex_exit(&spa->spa_feat_stats_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -383,12 +376,10 @@ feature_decr_sync(void *arg, dmu_tx_t *tx)
|
||||
zfeature_info_t *feature = arg;
|
||||
uint64_t refcount;
|
||||
|
||||
mutex_enter(&spa->spa_feat_stats_lock);
|
||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||
feature_sync(spa, feature, refcount - 1, tx);
|
||||
spa_history_log_internal(spa, "zhack feature decr", tx,
|
||||
"name=%s", feature->fi_guid);
|
||||
mutex_exit(&spa->spa_feat_stats_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -505,186 +496,6 @@ zhack_do_feature(int argc, char **argv)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
strstarts(const char *a, const char *b)
|
||||
{
|
||||
return (strncmp(a, b, strlen(b)) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
metaslab_force_alloc(metaslab_t *msp, uint64_t start, uint64_t size,
|
||||
dmu_tx_t *tx)
|
||||
{
|
||||
ASSERT(msp->ms_disabled);
|
||||
ASSERT(MUTEX_HELD(&msp->ms_lock));
|
||||
uint64_t txg = dmu_tx_get_txg(tx);
|
||||
|
||||
uint64_t off = start;
|
||||
while (off < start + size) {
|
||||
uint64_t ostart, osize;
|
||||
boolean_t found = zfs_range_tree_find_in(msp->ms_allocatable,
|
||||
off, start + size - off, &ostart, &osize);
|
||||
if (!found)
|
||||
break;
|
||||
zfs_range_tree_remove(msp->ms_allocatable, ostart, osize);
|
||||
|
||||
if (zfs_range_tree_is_empty(msp->ms_allocating[txg & TXG_MASK]))
|
||||
vdev_dirty(msp->ms_group->mg_vd, VDD_METASLAB, msp,
|
||||
txg);
|
||||
|
||||
zfs_range_tree_add(msp->ms_allocating[txg & TXG_MASK], ostart,
|
||||
osize);
|
||||
msp->ms_allocating_total += osize;
|
||||
off = ostart + osize;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_do_metaslab_leak(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
char *target;
|
||||
spa_t *spa;
|
||||
|
||||
optind = 1;
|
||||
boolean_t force = B_FALSE;
|
||||
while ((c = getopt(argc, argv, "f")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
force = B_TRUE;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc < 1) {
|
||||
(void) fprintf(stderr, "error: missing pool name\n");
|
||||
usage();
|
||||
}
|
||||
target = argv[0];
|
||||
|
||||
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
||||
spa_config_enter(spa, SCL_VDEV | SCL_ALLOC, FTAG, RW_READER);
|
||||
|
||||
char *line = NULL;
|
||||
size_t cap = 0;
|
||||
|
||||
vdev_t *vd = NULL;
|
||||
metaslab_t *prev = NULL;
|
||||
dmu_tx_t *tx = NULL;
|
||||
while (getline(&line, &cap, stdin) > 0) {
|
||||
if (strstarts(line, "\tvdev ")) {
|
||||
uint64_t vdev_id, ms_shift;
|
||||
if (sscanf(line,
|
||||
"\tvdev %10"PRIu64"\t%*s metaslab shift %4"PRIu64,
|
||||
&vdev_id, &ms_shift) == 1) {
|
||||
VERIFY3U(sscanf(line, "\tvdev %"PRIu64
|
||||
"\t metaslab shift %4"PRIu64,
|
||||
&vdev_id, &ms_shift), ==, 2);
|
||||
}
|
||||
vd = vdev_lookup_top(spa, vdev_id);
|
||||
if (vd == NULL) {
|
||||
fprintf(stderr, "error: no such vdev with "
|
||||
"id %"PRIu64"\n", vdev_id);
|
||||
break;
|
||||
}
|
||||
if (tx) {
|
||||
dmu_tx_commit(tx);
|
||||
mutex_exit(&prev->ms_lock);
|
||||
metaslab_enable(prev, B_FALSE, B_FALSE);
|
||||
tx = NULL;
|
||||
prev = NULL;
|
||||
}
|
||||
if (vd->vdev_ms_shift != ms_shift) {
|
||||
fprintf(stderr, "error: ms_shift mismatch: %"
|
||||
PRIu64" != %"PRIu64"\n", vd->vdev_ms_shift,
|
||||
ms_shift);
|
||||
break;
|
||||
}
|
||||
} else if (strstarts(line, "\tmetaslabs ")) {
|
||||
uint64_t ms_count;
|
||||
VERIFY3U(sscanf(line, "\tmetaslabs %"PRIu64, &ms_count),
|
||||
==, 1);
|
||||
ASSERT(vd);
|
||||
if (!force && vd->vdev_ms_count != ms_count) {
|
||||
fprintf(stderr, "error: ms_count mismatch: %"
|
||||
PRIu64" != %"PRIu64"\n", vd->vdev_ms_count,
|
||||
ms_count);
|
||||
break;
|
||||
}
|
||||
} else if (strstarts(line, "ALLOC:")) {
|
||||
uint64_t start, size;
|
||||
VERIFY3U(sscanf(line, "ALLOC: %"PRIu64" %"PRIu64"\n",
|
||||
&start, &size), ==, 2);
|
||||
|
||||
ASSERT(vd);
|
||||
metaslab_t *cur =
|
||||
vd->vdev_ms[start >> vd->vdev_ms_shift];
|
||||
if (prev != cur) {
|
||||
if (prev) {
|
||||
dmu_tx_commit(tx);
|
||||
mutex_exit(&prev->ms_lock);
|
||||
metaslab_enable(prev, B_FALSE, B_FALSE);
|
||||
}
|
||||
ASSERT(cur);
|
||||
metaslab_disable(cur);
|
||||
mutex_enter(&cur->ms_lock);
|
||||
metaslab_load(cur);
|
||||
prev = cur;
|
||||
tx = dmu_tx_create_dd(
|
||||
spa_get_dsl(vd->vdev_spa)->dp_root_dir);
|
||||
dmu_tx_assign(tx, DMU_TX_WAIT);
|
||||
}
|
||||
|
||||
metaslab_force_alloc(cur, start, size, tx);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (tx) {
|
||||
dmu_tx_commit(tx);
|
||||
mutex_exit(&prev->ms_lock);
|
||||
metaslab_enable(prev, B_FALSE, B_FALSE);
|
||||
tx = NULL;
|
||||
prev = NULL;
|
||||
}
|
||||
if (line)
|
||||
free(line);
|
||||
|
||||
spa_config_exit(spa, SCL_VDEV | SCL_ALLOC, FTAG);
|
||||
spa_close(spa, FTAG);
|
||||
}
|
||||
|
||||
static int
|
||||
zhack_do_metaslab(int argc, char **argv)
|
||||
{
|
||||
char *subcommand;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
if (argc == 0) {
|
||||
(void) fprintf(stderr,
|
||||
"error: no metaslab operation specified\n");
|
||||
usage();
|
||||
}
|
||||
|
||||
subcommand = argv[0];
|
||||
if (strcmp(subcommand, "leak") == 0) {
|
||||
zhack_do_metaslab_leak(argc, argv);
|
||||
} else {
|
||||
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||
subcommand);
|
||||
usage();
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define ASHIFT_UBERBLOCK_SHIFT(ashift) \
|
||||
MIN(MAX(ashift, UBERBLOCK_SHIFT), \
|
||||
MAX_UBERBLOCK_SHIFT)
|
||||
@ -714,23 +525,6 @@ zhack_repair_read_label(const int fd, vdev_label_t *vl,
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
zhack_repair_get_byteswap(const zio_eck_t *vdev_eck, const int l, int *byteswap)
|
||||
{
|
||||
if (vdev_eck->zec_magic == ZEC_MAGIC) {
|
||||
*byteswap = B_FALSE;
|
||||
} else if (vdev_eck->zec_magic == BSWAP_64((uint64_t)ZEC_MAGIC)) {
|
||||
*byteswap = B_TRUE;
|
||||
} else {
|
||||
(void) fprintf(stderr, "error: label %d: "
|
||||
"Expected the nvlist checksum magic number but instead got "
|
||||
"0x%" PRIx64 "\n",
|
||||
l, vdev_eck->zec_magic);
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_repair_calc_cksum(const int byteswap, void *data, const uint64_t offset,
|
||||
const uint64_t abdsize, zio_eck_t *eck, zio_cksum_t *cksum)
|
||||
@ -757,10 +551,33 @@ zhack_repair_calc_cksum(const int byteswap, void *data, const uint64_t offset,
|
||||
}
|
||||
|
||||
static int
|
||||
zhack_repair_get_ashift(nvlist_t *cfg, const int l, uint64_t *ashift)
|
||||
zhack_repair_check_label(uberblock_t *ub, const int l, const char **cfg_keys,
|
||||
const size_t cfg_keys_len, nvlist_t *cfg, nvlist_t *vdev_tree_cfg,
|
||||
uint64_t *ashift)
|
||||
{
|
||||
int err;
|
||||
nvlist_t *vdev_tree_cfg;
|
||||
|
||||
if (ub->ub_txg != 0) {
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d: UB TXG of 0 expected, but got %"
|
||||
PRIu64 "\n",
|
||||
l, ub->ub_txg);
|
||||
(void) fprintf(stderr, "It would appear the device was not "
|
||||
"properly removed.\n");
|
||||
return (1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < cfg_keys_len; i++) {
|
||||
uint64_t val;
|
||||
err = nvlist_lookup_uint64(cfg, cfg_keys[i], &val);
|
||||
if (err) {
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d, %d: "
|
||||
"cannot find nvlist key %s\n",
|
||||
l, i, cfg_keys[i]);
|
||||
return (err);
|
||||
}
|
||||
}
|
||||
|
||||
err = nvlist_lookup_nvlist(cfg,
|
||||
ZPOOL_CONFIG_VDEV_TREE, &vdev_tree_cfg);
|
||||
@ -784,7 +601,7 @@ zhack_repair_get_ashift(nvlist_t *cfg, const int l, uint64_t *ashift)
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d: nvlist key %s is zero\n",
|
||||
l, ZPOOL_CONFIG_ASHIFT);
|
||||
return (1);
|
||||
return (err);
|
||||
}
|
||||
|
||||
return (0);
|
||||
@ -799,35 +616,30 @@ zhack_repair_undetach(uberblock_t *ub, nvlist_t *cfg, const int l)
|
||||
*/
|
||||
if (BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp) != 0) {
|
||||
const uint64_t txg = BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp);
|
||||
int err;
|
||||
|
||||
ub->ub_txg = txg;
|
||||
|
||||
err = nvlist_remove_all(cfg, ZPOOL_CONFIG_CREATE_TXG);
|
||||
if (err) {
|
||||
if (nvlist_remove_all(cfg, ZPOOL_CONFIG_CREATE_TXG) != 0) {
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d: "
|
||||
"Failed to remove pool creation TXG\n",
|
||||
l);
|
||||
return (err);
|
||||
return (1);
|
||||
}
|
||||
|
||||
err = nvlist_remove_all(cfg, ZPOOL_CONFIG_POOL_TXG);
|
||||
if (err) {
|
||||
if (nvlist_remove_all(cfg, ZPOOL_CONFIG_POOL_TXG) != 0) {
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d: Failed to remove pool TXG to "
|
||||
"be replaced.\n",
|
||||
l);
|
||||
return (err);
|
||||
return (1);
|
||||
}
|
||||
|
||||
err = nvlist_add_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, txg);
|
||||
if (err) {
|
||||
if (nvlist_add_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, txg) != 0) {
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d: "
|
||||
"Failed to add pool TXG of %" PRIu64 "\n",
|
||||
l, txg);
|
||||
return (err);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -921,7 +733,6 @@ zhack_repair_test_cksum(const int byteswap, void *vdev_data,
|
||||
BSWAP_64(ZEC_MAGIC) : ZEC_MAGIC;
|
||||
const uint64_t actual_magic = vdev_eck->zec_magic;
|
||||
int err = 0;
|
||||
|
||||
if (actual_magic != expected_magic) {
|
||||
(void) fprintf(stderr, "error: label %d: "
|
||||
"Expected "
|
||||
@ -943,36 +754,6 @@ zhack_repair_test_cksum(const int byteswap, void *vdev_data,
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
zhack_repair_unpack_cfg(vdev_label_t *vl, const int l, nvlist_t **cfg)
|
||||
{
|
||||
const char *cfg_keys[] = { ZPOOL_CONFIG_VERSION,
|
||||
ZPOOL_CONFIG_POOL_STATE, ZPOOL_CONFIG_GUID };
|
||||
int err;
|
||||
|
||||
err = nvlist_unpack(vl->vl_vdev_phys.vp_nvlist,
|
||||
VDEV_PHYS_SIZE - sizeof (zio_eck_t), cfg, 0);
|
||||
if (err) {
|
||||
(void) fprintf(stderr,
|
||||
"error: cannot unpack nvlist label %d\n", l);
|
||||
return (err);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(cfg_keys); i++) {
|
||||
uint64_t val;
|
||||
err = nvlist_lookup_uint64(*cfg, cfg_keys[i], &val);
|
||||
if (err) {
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d, %d: "
|
||||
"cannot find nvlist key %s\n",
|
||||
l, i, cfg_keys[i]);
|
||||
return (err);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
||||
vdev_label_t *vl, const uint64_t label_offset, const int l,
|
||||
@ -986,7 +767,10 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
||||
(zio_eck_t *)((char *)(vdev_data) + VDEV_PHYS_SIZE) - 1;
|
||||
const uint64_t vdev_phys_offset =
|
||||
label_offset + offsetof(vdev_label_t, vl_vdev_phys);
|
||||
const char *cfg_keys[] = { ZPOOL_CONFIG_VERSION,
|
||||
ZPOOL_CONFIG_POOL_STATE, ZPOOL_CONFIG_GUID };
|
||||
nvlist_t *cfg;
|
||||
nvlist_t *vdev_tree_cfg = NULL;
|
||||
uint64_t ashift;
|
||||
int byteswap;
|
||||
|
||||
@ -994,9 +778,18 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
||||
if (err)
|
||||
return;
|
||||
|
||||
err = zhack_repair_get_byteswap(vdev_eck, l, &byteswap);
|
||||
if (err)
|
||||
if (vdev_eck->zec_magic == 0) {
|
||||
(void) fprintf(stderr, "error: label %d: "
|
||||
"Expected the nvlist checksum magic number to not be zero"
|
||||
"\n",
|
||||
l);
|
||||
(void) fprintf(stderr, "There should already be a checksum "
|
||||
"for the label.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
byteswap =
|
||||
(vdev_eck->zec_magic == BSWAP_64((uint64_t)ZEC_MAGIC));
|
||||
|
||||
if (byteswap) {
|
||||
byteswap_uint64_array(&vdev_eck->zec_cksum,
|
||||
@ -1012,7 +805,16 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
||||
return;
|
||||
}
|
||||
|
||||
err = zhack_repair_unpack_cfg(vl, l, &cfg);
|
||||
err = nvlist_unpack(vl->vl_vdev_phys.vp_nvlist,
|
||||
VDEV_PHYS_SIZE - sizeof (zio_eck_t), &cfg, 0);
|
||||
if (err) {
|
||||
(void) fprintf(stderr,
|
||||
"error: cannot unpack nvlist label %d\n", l);
|
||||
return;
|
||||
}
|
||||
|
||||
err = zhack_repair_check_label(ub,
|
||||
l, cfg_keys, ARRAY_SIZE(cfg_keys), cfg, vdev_tree_cfg, &ashift);
|
||||
if (err)
|
||||
return;
|
||||
|
||||
@ -1020,19 +822,6 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
||||
char *buf;
|
||||
size_t buflen;
|
||||
|
||||
if (ub->ub_txg != 0) {
|
||||
(void) fprintf(stderr,
|
||||
"error: label %d: UB TXG of 0 expected, but got %"
|
||||
PRIu64 "\n", l, ub->ub_txg);
|
||||
(void) fprintf(stderr, "It would appear the device was "
|
||||
"not properly detached.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
err = zhack_repair_get_ashift(cfg, l, &ashift);
|
||||
if (err)
|
||||
return;
|
||||
|
||||
err = zhack_repair_undetach(ub, cfg, l);
|
||||
if (err)
|
||||
return;
|
||||
@ -1192,7 +981,7 @@ main(int argc, char **argv)
|
||||
dprintf_setup(&argc, argv);
|
||||
zfs_prop_init();
|
||||
|
||||
while ((c = getopt(argc, argv, "+c:d:o:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "+c:d:")) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
g_importargs.cachefile = optarg;
|
||||
@ -1201,10 +990,6 @@ main(int argc, char **argv)
|
||||
assert(g_importargs.paths < MAX_NUM_PATHS);
|
||||
g_importargs.path[g_importargs.paths++] = optarg;
|
||||
break;
|
||||
case 'o':
|
||||
if (handle_tunable_option(optarg, B_FALSE) != 0)
|
||||
exit(1);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
@ -1226,8 +1011,6 @@ main(int argc, char **argv)
|
||||
rv = zhack_do_feature(argc, argv);
|
||||
} else if (strcmp(subcommand, "label") == 0) {
|
||||
return (zhack_do_label(argc, argv));
|
||||
} else if (strcmp(subcommand, "metaslab") == 0) {
|
||||
rv = zhack_do_metaslab(argc, argv);
|
||||
} else {
|
||||
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||
subcommand);
|
||||
|
@ -107,8 +107,6 @@
|
||||
* zinject
|
||||
* zinject <-a | -u pool>
|
||||
* zinject -c <id|all>
|
||||
* zinject -E <delay> [-a] [-m] [-f freq] [-l level] [-r range]
|
||||
* [-T iotype] [-t type object | -b bookmark pool]
|
||||
* zinject [-q] <-t type> [-f freq] [-u] [-a] [-m] [-e errno] [-l level]
|
||||
* [-r range] <object>
|
||||
* zinject [-f freq] [-a] [-m] [-u] -b objset:object:level:start:end pool
|
||||
@ -134,18 +132,14 @@
|
||||
* The '-f' flag controls the frequency of errors injected, expressed as a
|
||||
* real number percentage between 0.0001 and 100. The default is 100.
|
||||
*
|
||||
* The <object> form is responsible for actually injecting the handler into the
|
||||
* The this form is responsible for actually injecting the handler into the
|
||||
* framework. It takes the arguments described above, translates them to the
|
||||
* internal tuple using libzpool, and then issues an ioctl() to register the
|
||||
* handler.
|
||||
*
|
||||
* The '-b' option can target a specific bookmark, regardless of whether a
|
||||
* The final form can target a specific bookmark, regardless of whether a
|
||||
* human-readable interface has been designed. It allows developers to specify
|
||||
* a particular block by number.
|
||||
*
|
||||
* The '-E' option injects pipeline ready stage delays for the given object or
|
||||
* bookmark. The delay is specified in milliseconds, and it supports I/O type
|
||||
* and range filters.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
@ -352,13 +346,6 @@ usage(void)
|
||||
"\t\tsuch that the operation takes a minimum of supplied seconds\n"
|
||||
"\t\tto complete.\n"
|
||||
"\n"
|
||||
"\tzinject -E <delay> [-a] [-m] [-f freq] [-l level] [-r range]\n"
|
||||
"\t\t[-T iotype] [-t type object | -b bookmark pool]\n"
|
||||
"\n"
|
||||
"\t\tInject pipeline ready stage delays for the given object path\n"
|
||||
"\t\t(data or dnode) or raw bookmark. The delay is specified in\n"
|
||||
"\t\tmilliseconds.\n"
|
||||
"\n"
|
||||
"\tzinject -I [-s <seconds> | -g <txgs>] pool\n"
|
||||
"\t\tCause the pool to stop writing blocks yet not\n"
|
||||
"\t\treport errors for a duration. Simulates buggy hardware\n"
|
||||
@ -737,15 +724,12 @@ register_handler(const char *pool, int flags, zinject_record_t *record,
|
||||
if (quiet) {
|
||||
(void) printf("%llu\n", (u_longlong_t)zc.zc_guid);
|
||||
} else {
|
||||
boolean_t show_object = B_FALSE;
|
||||
boolean_t show_iotype = B_FALSE;
|
||||
(void) printf("Added handler %llu with the following "
|
||||
"properties:\n", (u_longlong_t)zc.zc_guid);
|
||||
(void) printf(" pool: %s\n", pool);
|
||||
if (record->zi_guid) {
|
||||
(void) printf(" vdev: %llx\n",
|
||||
(u_longlong_t)record->zi_guid);
|
||||
show_iotype = B_TRUE;
|
||||
} else if (record->zi_func[0] != '\0') {
|
||||
(void) printf(" panic function: %s\n",
|
||||
record->zi_func);
|
||||
@ -758,18 +742,7 @@ register_handler(const char *pool, int flags, zinject_record_t *record,
|
||||
} else if (record->zi_timer > 0) {
|
||||
(void) printf(" timer: %lld ms\n",
|
||||
(u_longlong_t)NSEC2MSEC(record->zi_timer));
|
||||
if (record->zi_cmd == ZINJECT_DELAY_READY) {
|
||||
show_object = B_TRUE;
|
||||
show_iotype = B_TRUE;
|
||||
}
|
||||
} else {
|
||||
show_object = B_TRUE;
|
||||
}
|
||||
if (show_iotype) {
|
||||
(void) printf("iotype: %s\n",
|
||||
iotype_to_str(record->zi_iotype));
|
||||
}
|
||||
if (show_object) {
|
||||
(void) printf("objset: %llu\n",
|
||||
(u_longlong_t)record->zi_objset);
|
||||
(void) printf("object: %llu\n",
|
||||
@ -937,7 +910,6 @@ main(int argc, char **argv)
|
||||
int ret;
|
||||
int flags = 0;
|
||||
uint32_t dvas = 0;
|
||||
hrtime_t ready_delay = -1;
|
||||
|
||||
if ((g_zfs = libzfs_init()) == NULL) {
|
||||
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
|
||||
@ -968,7 +940,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while ((c = getopt(argc, argv,
|
||||
":aA:b:C:d:D:E:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:P:")) != -1) {
|
||||
":aA:b:C:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:P:")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
flags |= ZINJECT_FLUSH_ARC;
|
||||
@ -1141,18 +1113,6 @@ main(int argc, char **argv)
|
||||
case 'u':
|
||||
flags |= ZINJECT_UNLOAD_SPA;
|
||||
break;
|
||||
case 'E':
|
||||
ready_delay = MSEC2NSEC(strtol(optarg, &end, 10));
|
||||
if (ready_delay <= 0 || *end != '\0') {
|
||||
(void) fprintf(stderr, "invalid delay '%s': "
|
||||
"must be a positive duration\n", optarg);
|
||||
usage();
|
||||
libzfs_fini(g_zfs);
|
||||
return (1);
|
||||
}
|
||||
record.zi_cmd = ZINJECT_DELAY_READY;
|
||||
record.zi_timer = ready_delay;
|
||||
break;
|
||||
case 'L':
|
||||
if ((label = name_to_type(optarg)) == TYPE_INVAL &&
|
||||
!LABEL_TYPE(type)) {
|
||||
@ -1190,7 +1150,7 @@ main(int argc, char **argv)
|
||||
*/
|
||||
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
||||
level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED ||
|
||||
record.zi_freq > 0 || dvas != 0 || ready_delay >= 0) {
|
||||
record.zi_freq > 0 || dvas != 0) {
|
||||
(void) fprintf(stderr, "cancel (-c) incompatible with "
|
||||
"any other options\n");
|
||||
usage();
|
||||
@ -1226,7 +1186,7 @@ main(int argc, char **argv)
|
||||
*/
|
||||
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
||||
level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED ||
|
||||
dvas != 0 || ready_delay >= 0) {
|
||||
dvas != 0) {
|
||||
(void) fprintf(stderr, "device (-d) incompatible with "
|
||||
"data error injection\n");
|
||||
usage();
|
||||
@ -1316,23 +1276,13 @@ main(int argc, char **argv)
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (record.zi_cmd == ZINJECT_UNINITIALIZED) {
|
||||
record.zi_cmd = ZINJECT_DATA_FAULT;
|
||||
if (!error)
|
||||
error = EIO;
|
||||
} else if (error != 0) {
|
||||
(void) fprintf(stderr, "error type -e incompatible "
|
||||
"with delay injection\n");
|
||||
libzfs_fini(g_zfs);
|
||||
return (1);
|
||||
} else {
|
||||
record.zi_iotype = io_type;
|
||||
}
|
||||
|
||||
record.zi_cmd = ZINJECT_DATA_FAULT;
|
||||
if (translate_raw(raw, &record) != 0) {
|
||||
libzfs_fini(g_zfs);
|
||||
return (1);
|
||||
}
|
||||
if (!error)
|
||||
error = EIO;
|
||||
} else if (record.zi_cmd == ZINJECT_PANIC) {
|
||||
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
||||
level != 0 || device != NULL || record.zi_freq > 0 ||
|
||||
@ -1460,13 +1410,6 @@ main(int argc, char **argv)
|
||||
record.zi_dvas = dvas;
|
||||
}
|
||||
|
||||
if (record.zi_cmd != ZINJECT_UNINITIALIZED && error != 0) {
|
||||
(void) fprintf(stderr, "error type -e incompatible "
|
||||
"with delay injection\n");
|
||||
libzfs_fini(g_zfs);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (error == EACCES) {
|
||||
if (type != TYPE_DATA) {
|
||||
(void) fprintf(stderr, "decryption errors "
|
||||
@ -1482,12 +1425,8 @@ main(int argc, char **argv)
|
||||
* not found.
|
||||
*/
|
||||
error = ECKSUM;
|
||||
} else if (record.zi_cmd == ZINJECT_UNINITIALIZED) {
|
||||
record.zi_cmd = ZINJECT_DATA_FAULT;
|
||||
if (!error)
|
||||
error = EIO;
|
||||
} else {
|
||||
record.zi_iotype = io_type;
|
||||
record.zi_cmd = ZINJECT_DATA_FAULT;
|
||||
}
|
||||
|
||||
if (translate_record(type, argv[0], range, level, &record, pool,
|
||||
@ -1495,6 +1434,8 @@ main(int argc, char **argv)
|
||||
libzfs_fini(g_zfs);
|
||||
return (1);
|
||||
}
|
||||
if (!error)
|
||||
error = EIO;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -148,7 +148,6 @@ dist_zpoolcompat_DATA = \
|
||||
%D%/compatibility.d/openzfs-2.1-linux \
|
||||
%D%/compatibility.d/openzfs-2.2 \
|
||||
%D%/compatibility.d/openzfs-2.3 \
|
||||
%D%/compatibility.d/openzfs-2.4 \
|
||||
%D%/compatibility.d/openzfsonosx-1.7.0 \
|
||||
%D%/compatibility.d/openzfsonosx-1.8.1 \
|
||||
%D%/compatibility.d/openzfsonosx-1.9.3 \
|
||||
@ -188,9 +187,7 @@ zpoolcompatlinks = \
|
||||
"openzfs-2.2 openzfs-2.2-linux" \
|
||||
"openzfs-2.2 openzfs-2.2-freebsd" \
|
||||
"openzfs-2.3 openzfs-2.3-linux" \
|
||||
"openzfs-2.3 openzfs-2.3-freebsd" \
|
||||
"openzfs-2.4 openzfs-2.4-linux" \
|
||||
"openzfs-2.4 openzfs-2.4-freebsd"
|
||||
"openzfs-2.3 openzfs-2.3-freebsd"
|
||||
|
||||
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
||||
INSTALL_DATA_HOOKS += zpool-install-data-hook
|
||||
|
@ -1,48 +0,0 @@
|
||||
# Features supported by OpenZFS 2.4 on Linux and FreeBSD
|
||||
allocation_classes
|
||||
async_destroy
|
||||
blake3
|
||||
block_cloning
|
||||
block_cloning_endian
|
||||
bookmark_v2
|
||||
bookmark_written
|
||||
bookmarks
|
||||
device_rebuild
|
||||
device_removal
|
||||
draid
|
||||
dynamic_gang_header
|
||||
edonr
|
||||
embedded_data
|
||||
empty_bpobj
|
||||
enabled_txg
|
||||
encryption
|
||||
extensible_dataset
|
||||
fast_dedup
|
||||
filesystem_limits
|
||||
head_errlog
|
||||
hole_birth
|
||||
large_blocks
|
||||
large_dnode
|
||||
large_microzap
|
||||
livelist
|
||||
log_spacemap
|
||||
longname
|
||||
lz4_compress
|
||||
multi_vdev_crash_dump
|
||||
obsolete_counts
|
||||
physical_rewrite
|
||||
project_quota
|
||||
raidz_expansion
|
||||
redacted_datasets
|
||||
redaction_bookmarks
|
||||
redaction_list_spill
|
||||
resilver_defer
|
||||
sha512
|
||||
skein
|
||||
spacemap_histogram
|
||||
spacemap_v2
|
||||
userobj_accounting
|
||||
vdev_zaps_v2
|
||||
zilsaxattr
|
||||
zpool_checkpoint
|
||||
zstd_compress
|
@ -26,7 +26,6 @@
|
||||
|
||||
/*
|
||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
||||
* Copyright (c) 2025, Klara, Inc.
|
||||
*/
|
||||
|
||||
#include <libintl.h>
|
||||
@ -53,7 +52,7 @@
|
||||
typedef struct zpool_node {
|
||||
zpool_handle_t *zn_handle;
|
||||
uu_avl_node_t zn_avlnode;
|
||||
hrtime_t zn_last_refresh;
|
||||
int zn_mark;
|
||||
} zpool_node_t;
|
||||
|
||||
struct zpool_list {
|
||||
@ -63,7 +62,6 @@ struct zpool_list {
|
||||
uu_avl_pool_t *zl_pool;
|
||||
zprop_list_t **zl_proplist;
|
||||
zfs_type_t zl_type;
|
||||
hrtime_t zl_last_refresh;
|
||||
};
|
||||
|
||||
static int
|
||||
@ -83,47 +81,32 @@ zpool_compare(const void *larg, const void *rarg, void *unused)
|
||||
* of known pools.
|
||||
*/
|
||||
static int
|
||||
add_pool(zpool_handle_t *zhp, zpool_list_t *zlp)
|
||||
add_pool(zpool_handle_t *zhp, void *data)
|
||||
{
|
||||
zpool_node_t *node, *new = safe_malloc(sizeof (zpool_node_t));
|
||||
zpool_list_t *zlp = data;
|
||||
zpool_node_t *node = safe_malloc(sizeof (zpool_node_t));
|
||||
uu_avl_index_t idx;
|
||||
|
||||
new->zn_handle = zhp;
|
||||
uu_avl_node_init(new, &new->zn_avlnode, zlp->zl_pool);
|
||||
|
||||
node = uu_avl_find(zlp->zl_avl, new, NULL, &idx);
|
||||
if (node == NULL) {
|
||||
node->zn_handle = zhp;
|
||||
uu_avl_node_init(node, &node->zn_avlnode, zlp->zl_pool);
|
||||
if (uu_avl_find(zlp->zl_avl, node, NULL, &idx) == NULL) {
|
||||
if (zlp->zl_proplist &&
|
||||
zpool_expand_proplist(zhp, zlp->zl_proplist,
|
||||
zlp->zl_type, zlp->zl_literal) != 0) {
|
||||
zpool_close(zhp);
|
||||
free(new);
|
||||
free(node);
|
||||
return (-1);
|
||||
}
|
||||
new->zn_last_refresh = zlp->zl_last_refresh;
|
||||
uu_avl_insert(zlp->zl_avl, new, idx);
|
||||
uu_avl_insert(zlp->zl_avl, node, idx);
|
||||
} else {
|
||||
node->zn_last_refresh = zlp->zl_last_refresh;
|
||||
zpool_close(zhp);
|
||||
free(new);
|
||||
free(node);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* add_pool(), but always returns 0. This allows zpool_iter() to continue
|
||||
* even if a pool exists in the tree, or we fail to get the properties for
|
||||
* a new one.
|
||||
*/
|
||||
static int
|
||||
add_pool_cb(zpool_handle_t *zhp, void *data)
|
||||
{
|
||||
(void) add_pool(zhp, data);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a list of pools based on the given arguments. If we're given no
|
||||
* arguments, then iterate over all pools in the system and add them to the AVL
|
||||
@ -152,10 +135,9 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, zfs_type_t type,
|
||||
zlp->zl_type = type;
|
||||
|
||||
zlp->zl_literal = literal;
|
||||
zlp->zl_last_refresh = gethrtime();
|
||||
|
||||
if (argc == 0) {
|
||||
(void) zpool_iter(g_zfs, add_pool_cb, zlp);
|
||||
(void) zpool_iter(g_zfs, add_pool, zlp);
|
||||
zlp->zl_findall = B_TRUE;
|
||||
} else {
|
||||
int i;
|
||||
@ -177,69 +159,15 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, zfs_type_t type,
|
||||
}
|
||||
|
||||
/*
|
||||
* Refresh the state of all pools on the list. Additionally, if no options were
|
||||
* given on the command line, add any new pools and remove any that are no
|
||||
* longer available.
|
||||
* Search for any new pools, adding them to the list. We only add pools when no
|
||||
* options were given on the command line. Otherwise, we keep the list fixed as
|
||||
* those that were explicitly specified.
|
||||
*/
|
||||
int
|
||||
pool_list_refresh(zpool_list_t *zlp)
|
||||
void
|
||||
pool_list_update(zpool_list_t *zlp)
|
||||
{
|
||||
zlp->zl_last_refresh = gethrtime();
|
||||
|
||||
if (!zlp->zl_findall) {
|
||||
/*
|
||||
* This list is a fixed list of pools, so we must not add
|
||||
* or remove any. Just walk over them and refresh their
|
||||
* state.
|
||||
*/
|
||||
int navail = 0;
|
||||
for (zpool_node_t *node = uu_avl_first(zlp->zl_avl);
|
||||
node != NULL; node = uu_avl_next(zlp->zl_avl, node)) {
|
||||
boolean_t missing;
|
||||
zpool_refresh_stats(node->zn_handle, &missing);
|
||||
navail += !missing;
|
||||
node->zn_last_refresh = zlp->zl_last_refresh;
|
||||
}
|
||||
return (navail);
|
||||
}
|
||||
|
||||
/*
|
||||
* Search for any new pools and add them to the list. zpool_iter()
|
||||
* will call zpool_refresh_stats() as part of its work, so this has
|
||||
* the side effect of updating all active handles.
|
||||
*/
|
||||
(void) zpool_iter(g_zfs, add_pool_cb, zlp);
|
||||
|
||||
/*
|
||||
* Walk the list for any that weren't refreshed, and update and remove
|
||||
* them. It's not enough to just skip available ones, as zpool_iter()
|
||||
* won't update them, so they'll still appear active in our list.
|
||||
*/
|
||||
zpool_node_t *node, *next;
|
||||
for (node = uu_avl_first(zlp->zl_avl); node != NULL; node = next) {
|
||||
next = uu_avl_next(zlp->zl_avl, node);
|
||||
|
||||
/*
|
||||
* Skip any that were refreshed and are online; they're already
|
||||
* handled.
|
||||
*/
|
||||
if (node->zn_last_refresh == zlp->zl_last_refresh &&
|
||||
zpool_get_state(node->zn_handle) != POOL_STATE_UNAVAIL)
|
||||
continue;
|
||||
|
||||
/* Do the refresh ourselves, just in case. */
|
||||
boolean_t missing;
|
||||
zpool_refresh_stats(node->zn_handle, &missing);
|
||||
if (missing) {
|
||||
uu_avl_remove(zlp->zl_avl, node);
|
||||
zpool_close(node->zn_handle);
|
||||
free(node);
|
||||
} else {
|
||||
node->zn_last_refresh = zlp->zl_last_refresh;
|
||||
}
|
||||
}
|
||||
|
||||
return (uu_avl_numnodes(zlp->zl_avl));
|
||||
if (zlp->zl_findall)
|
||||
(void) zpool_iter(g_zfs, add_pool, zlp);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -262,6 +190,23 @@ pool_list_iter(zpool_list_t *zlp, int unavail, zpool_iter_f func,
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the given pool from the list. When running iostat, we want to remove
|
||||
* those pools that no longer exist.
|
||||
*/
|
||||
void
|
||||
pool_list_remove(zpool_list_t *zlp, zpool_handle_t *zhp)
|
||||
{
|
||||
zpool_node_t search, *node;
|
||||
|
||||
search.zn_handle = zhp;
|
||||
if ((node = uu_avl_find(zlp->zl_avl, &search, NULL, NULL)) != NULL) {
|
||||
uu_avl_remove(zlp->zl_avl, node);
|
||||
zpool_close(node->zn_handle);
|
||||
free(node);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Free all the handles associated with this list.
|
||||
*/
|
||||
|
@ -33,7 +33,7 @@
|
||||
* Copyright (c) 2017, Intel Corporation.
|
||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||
* Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
||||
* Copyright (c) 2021, 2023, 2025, Klara, Inc.
|
||||
* Copyright (c) 2021, 2023, Klara Inc.
|
||||
* Copyright (c) 2021, 2025 Hewlett Packard Enterprise Development LP.
|
||||
*/
|
||||
|
||||
@ -456,7 +456,7 @@ get_usage(zpool_help_t idx)
|
||||
"<pool> <vdev> ...\n"));
|
||||
case HELP_ATTACH:
|
||||
return (gettext("\tattach [-fsw] [-o property=value] "
|
||||
"<pool> <vdev> <new-device>\n"));
|
||||
"<pool> <device> <new-device>\n"));
|
||||
case HELP_CLEAR:
|
||||
return (gettext("\tclear [[--power]|[-nF]] <pool> [device]\n"));
|
||||
case HELP_CREATE:
|
||||
@ -5761,6 +5761,24 @@ children:
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static int
|
||||
refresh_iostat(zpool_handle_t *zhp, void *data)
|
||||
{
|
||||
iostat_cbdata_t *cb = data;
|
||||
boolean_t missing;
|
||||
|
||||
/*
|
||||
* If the pool has disappeared, remove it from the list and continue.
|
||||
*/
|
||||
if (zpool_refresh_stats(zhp, &missing) != 0)
|
||||
return (-1);
|
||||
|
||||
if (missing)
|
||||
pool_list_remove(cb->cb_list, zhp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback to print out the iostats for the given pool.
|
||||
*/
|
||||
@ -6341,14 +6359,15 @@ get_namewidth_iostat(zpool_handle_t *zhp, void *data)
|
||||
* This command can be tricky because we want to be able to deal with pool
|
||||
* creation/destruction as well as vdev configuration changes. The bulk of this
|
||||
* processing is handled by the pool_list_* routines in zpool_iter.c. We rely
|
||||
* on pool_list_refresh() to detect the addition and removal of pools.
|
||||
* Configuration changes are all handled within libzfs.
|
||||
* on pool_list_update() to detect the addition of new pools. Configuration
|
||||
* changes are all handled within libzfs.
|
||||
*/
|
||||
int
|
||||
zpool_do_iostat(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int ret;
|
||||
int npools;
|
||||
float interval = 0;
|
||||
unsigned long count = 0;
|
||||
zpool_list_t *list;
|
||||
@ -6599,24 +6618,10 @@ zpool_do_iostat(int argc, char **argv)
|
||||
return (1);
|
||||
}
|
||||
|
||||
int last_npools = 0;
|
||||
for (;;) {
|
||||
/*
|
||||
* Refresh all pools in list, adding or removing pools as
|
||||
* necessary.
|
||||
*/
|
||||
int npools = pool_list_refresh(list);
|
||||
if (npools == 0) {
|
||||
if ((npools = pool_list_count(list)) == 0)
|
||||
(void) fprintf(stderr, gettext("no pools available\n"));
|
||||
} else {
|
||||
/*
|
||||
* If the list of pools has changed since last time
|
||||
* around, reset the iteration count to force the
|
||||
* header to be redisplayed.
|
||||
*/
|
||||
if (last_npools != npools)
|
||||
cb.cb_iteration = 0;
|
||||
|
||||
else {
|
||||
/*
|
||||
* If this is the first iteration and -y was supplied
|
||||
* we skip any printing.
|
||||
@ -6624,6 +6629,15 @@ zpool_do_iostat(int argc, char **argv)
|
||||
boolean_t skip = (omit_since_boot &&
|
||||
cb.cb_iteration == 0);
|
||||
|
||||
/*
|
||||
* Refresh all statistics. This is done as an
|
||||
* explicit step before calculating the maximum name
|
||||
* width, so that any * configuration changes are
|
||||
* properly accounted for.
|
||||
*/
|
||||
(void) pool_list_iter(list, B_FALSE, refresh_iostat,
|
||||
&cb);
|
||||
|
||||
/*
|
||||
* Iterate over all pools to determine the maximum width
|
||||
* for the pool / device name column across all pools.
|
||||
@ -6714,8 +6728,6 @@ zpool_do_iostat(int argc, char **argv)
|
||||
|
||||
(void) fflush(stdout);
|
||||
(void) fsleep(interval);
|
||||
|
||||
last_npools = npools;
|
||||
}
|
||||
|
||||
pool_list_free(list);
|
||||
@ -7632,7 +7644,7 @@ zpool_do_replace(int argc, char **argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* zpool attach [-fsw] [-o property=value] <pool> <vdev> <new_device>
|
||||
* zpool attach [-fsw] [-o property=value] <pool> <device>|<vdev> <new_device>
|
||||
*
|
||||
* -f Force attach, even if <new_device> appears to be in use.
|
||||
* -s Use sequential instead of healing reconstruction for resilver.
|
||||
@ -7640,9 +7652,9 @@ zpool_do_replace(int argc, char **argv)
|
||||
* -w Wait for resilvering (mirror) or expansion (raidz) to complete
|
||||
* before returning.
|
||||
*
|
||||
* Attach <new_device> to a <vdev>, where the vdev can be of type
|
||||
* device, mirror or raidz. If <vdev> is not part of a mirror, then <vdev> will
|
||||
* be transformed into a mirror of <vdev> and <new_device>. When a mirror
|
||||
* Attach <new_device> to a <device> or <vdev>, where the vdev can be of type
|
||||
* mirror or raidz. If <device> is not part of a mirror, then <device> will
|
||||
* be transformed into a mirror of <device> and <new_device>. When a mirror
|
||||
* is involved, <new_device> will begin life with a DTL of [0, now], and will
|
||||
* immediately begin to resilver itself. For the raidz case, a expansion will
|
||||
* commence and reflow the raidz data across all the disks including the
|
||||
|
@ -76,10 +76,11 @@ typedef struct zpool_list zpool_list_t;
|
||||
|
||||
zpool_list_t *pool_list_get(int, char **, zprop_list_t **, zfs_type_t,
|
||||
boolean_t, int *);
|
||||
int pool_list_refresh(zpool_list_t *);
|
||||
void pool_list_update(zpool_list_t *);
|
||||
int pool_list_iter(zpool_list_t *, int unavail, zpool_iter_f, void *);
|
||||
void pool_list_free(zpool_list_t *);
|
||||
int pool_list_count(zpool_list_t *);
|
||||
void pool_list_remove(zpool_list_t *, zpool_handle_t *);
|
||||
|
||||
extern libzfs_handle_t *g_zfs;
|
||||
|
||||
|
@ -608,29 +608,23 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
||||
verify(nvlist_lookup_string(cnv,
|
||||
ZPOOL_CONFIG_PATH, &path) == 0);
|
||||
|
||||
/*
|
||||
* Skip active spares they should never cause
|
||||
* the pool to be evaluated as inconsistent.
|
||||
*/
|
||||
if (is_spare(NULL, path))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* If we have a raidz/mirror that combines disks
|
||||
* with files, only report it as an error when
|
||||
* fatal is set to ensure all the replication
|
||||
* checks aren't skipped in check_replication().
|
||||
* with files, report it as an error.
|
||||
*/
|
||||
if (fatal && !dontreport && type != NULL &&
|
||||
if (!dontreport && type != NULL &&
|
||||
strcmp(type, childtype) != 0) {
|
||||
if (ret != NULL)
|
||||
free(ret);
|
||||
ret = NULL;
|
||||
vdev_error(gettext(
|
||||
"mismatched replication "
|
||||
"level: %s contains both "
|
||||
"files and devices\n"),
|
||||
rep.zprl_type);
|
||||
if (fatal)
|
||||
vdev_error(gettext(
|
||||
"mismatched replication "
|
||||
"level: %s contains both "
|
||||
"files and devices\n"),
|
||||
rep.zprl_type);
|
||||
else
|
||||
return (NULL);
|
||||
dontreport = B_TRUE;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ zstream_LDADD = \
|
||||
libzpool.la \
|
||||
libnvpair.la
|
||||
|
||||
cmd-zstream-install-exec-hook:
|
||||
PHONY += install-exec-hook
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(sbindir) && $(LN_S) -f zstream zstreamdump
|
||||
|
||||
INSTALL_EXEC_HOOKS += cmd-zstream-install-exec-hook
|
||||
|
@ -16,14 +16,10 @@ SHELLCHECK_OPTS = $(call JUST_SHELLCHECK_OPTS,$(1)) $(call JUST_CHECKBAS
|
||||
|
||||
PHONY += shellcheck
|
||||
|
||||
shellcheck_verbose = $(shellcheck_verbose_@AM_V@)
|
||||
shellcheck_verbose_ = $(shellcheck_verbose_@AM_DEFAULT_V@)
|
||||
shellcheck_verbose_0 = @echo SHELLCHECK $(_STGT);
|
||||
|
||||
_STGT = $(subst ^,/,$(subst shellcheck-here-,,$@))
|
||||
shellcheck-here-%:
|
||||
if HAVE_SHELLCHECK
|
||||
$(shellcheck_verbose)shellcheck --format=gcc --enable=all --exclude=SC1090,SC1091,SC2039,SC2250,SC2312,SC2317,SC3043 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") "$$([ -e "$(_STGT)" ] || echo "$(srcdir)/")$(_STGT)"
|
||||
shellcheck --format=gcc --enable=all --exclude=SC1090,SC1091,SC2039,SC2250,SC2312,SC2317,SC3043 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") "$$([ -e "$(_STGT)" ] || echo "$(srcdir)/")$(_STGT)"
|
||||
else
|
||||
@echo "skipping shellcheck of" $(_STGT) "because shellcheck is not installed"
|
||||
endif
|
||||
@ -33,15 +29,11 @@ shellcheck: $(SHELLCHECKSCRIPTS) $(call JUST_SHELLCHECK_OPTS,$(SHELLCHECKSCRIPTS
|
||||
|
||||
PHONY += checkbashisms
|
||||
|
||||
checkbashisms_verbose = $(checkbashisms_verbose_@AM_V@)
|
||||
checkbashisms_verbose_ = $(checkbashisms_verbose_@AM_DEFAULT_V@)
|
||||
checkbashisms_verbose_0 = @echo CHECKBASHISMS $(_BTGT);
|
||||
|
||||
# command -v *is* specified by POSIX and every shell in existence supports it
|
||||
_BTGT = $(subst ^,/,$(subst checkbashisms-here-,,$@))
|
||||
checkbashisms-here-%:
|
||||
if HAVE_CHECKBASHISMS
|
||||
$(checkbashisms_verbose)! { [ -n "$(SHELLCHECK_SHELL)" ] && echo '#!/bin/$(SHELLCHECK_SHELL)'; cat "$$([ -e "$(_BTGT)" ] || echo "$(srcdir)/")$(_BTGT)"; } | \
|
||||
! { [ -n "$(SHELLCHECK_SHELL)" ] && echo '#!/bin/$(SHELLCHECK_SHELL)'; cat "$$([ -e "$(_BTGT)" ] || echo "$(srcdir)/")$(_BTGT)"; } | \
|
||||
checkbashisms -npx 2>&1 | grep -vFe "'command' with option other than -p" -e 'command -v' -e 'any possible bashisms' $(CHECKBASHISMS_IGNORE) >&2
|
||||
else
|
||||
@echo "skipping checkbashisms of" $(_BTGT) "because checkbashisms is not installed"
|
||||
|
@ -34,26 +34,8 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_ARCH], [
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([TARGET_CPU_AARCH64], test $TARGET_CPU = aarch64)
|
||||
AM_CONDITIONAL([TARGET_CPU_I386], test $TARGET_CPU = i386)
|
||||
AM_CONDITIONAL([TARGET_CPU_X86_64], test $TARGET_CPU = x86_64)
|
||||
AM_CONDITIONAL([TARGET_CPU_POWERPC], test $TARGET_CPU = powerpc)
|
||||
AM_CONDITIONAL([TARGET_CPU_SPARC64], test $TARGET_CPU = sparc64)
|
||||
AM_CONDITIONAL([TARGET_CPU_ARM], test $TARGET_CPU = arm)
|
||||
])
|
||||
dnl #
|
||||
dnl # Check for conflicting environment variables
|
||||
dnl #
|
||||
dnl # If ARCH env variable is set up, then kernel Makefile in the /usr/src/kernel
|
||||
dnl # can misbehave during the zfs ./configure test of the module compilation.
|
||||
AC_DEFUN([ZFS_AC_CONFIG_CHECK_ARCH_VAR], [
|
||||
AC_MSG_CHECKING([for conflicting environment variables])
|
||||
if test -n "$ARCH"; then
|
||||
AC_MSG_RESULT([warning])
|
||||
AC_MSG_WARN(m4_normalize([ARCH environment variable is set to "$ARCH".
|
||||
This can cause build kernel modules support check failure.
|
||||
Please unset it.]))
|
||||
else
|
||||
AC_MSG_RESULT([done])
|
||||
fi
|
||||
])
|
||||
|
||||
|
@ -155,34 +155,6 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH], [
|
||||
AC_SUBST([NO_FORMAT_ZERO_LENGTH])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check if kernel cc supports -Wno-format-zero-length option.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_FORMAT_ZERO_LENGTH], [
|
||||
saved_cc="$CC"
|
||||
AS_IF(
|
||||
[ test -n "$KERNEL_CC" ], [ CC="$KERNEL_CC" ],
|
||||
[ test -n "$KERNEL_LLVM" ], [ CC="clang" ],
|
||||
[ CC="gcc" ]
|
||||
)
|
||||
AC_MSG_CHECKING([whether $CC supports -Wno-format-zero-length])
|
||||
|
||||
saved_flags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-format-zero-length"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||
KERNEL_NO_FORMAT_ZERO_LENGTH=-Wno-format-zero-length
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
KERNEL_NO_FORMAT_ZERO_LENGTH=
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
CC="$saved_cc"
|
||||
CFLAGS="$saved_flags"
|
||||
AC_SUBST([KERNEL_NO_FORMAT_ZERO_LENGTH])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check if cc supports -Wno-clobbered option.
|
||||
dnl #
|
||||
@ -209,27 +181,6 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED], [
|
||||
AC_SUBST([NO_CLOBBERED])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check if cc supports -Wno-atomic-alignment option.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_ATOMIC_ALIGNMENT], [
|
||||
AC_MSG_CHECKING([whether $CC supports -Wno-atomic-alignment])
|
||||
|
||||
saved_flags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-atomic-alignment"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||
NO_ATOMIC_ALIGNMENT=-Wno-atomic-alignment
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
NO_ATOMIC_ALIGNMENT=
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
CFLAGS="$saved_flags"
|
||||
AC_SUBST([NO_ATOMIC_ALIGNMENT])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check if cc supports -Wimplicit-fallthrough option.
|
||||
dnl #
|
||||
@ -280,17 +231,20 @@ dnl #
|
||||
dnl # Check if kernel cc supports -Winfinite-recursion option.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_INFINITE_RECURSION], [
|
||||
saved_cc="$CC"
|
||||
AS_IF(
|
||||
[ test -n "$KERNEL_CC" ], [ CC="$KERNEL_CC" ],
|
||||
[ test -n "$KERNEL_LLVM" ], [ CC="clang" ],
|
||||
[ CC="gcc" ]
|
||||
)
|
||||
AC_MSG_CHECKING([whether $CC supports -Winfinite-recursion])
|
||||
AC_MSG_CHECKING([whether $KERNEL_CC supports -Winfinite-recursion])
|
||||
|
||||
saved_cc="$CC"
|
||||
saved_flags="$CFLAGS"
|
||||
CC="gcc"
|
||||
CFLAGS="$CFLAGS -Werror -Winfinite-recursion"
|
||||
|
||||
AS_IF([ test -n "$KERNEL_CC" ], [
|
||||
CC="$KERNEL_CC"
|
||||
])
|
||||
AS_IF([ test -n "$KERNEL_LLVM" ], [
|
||||
CC="clang"
|
||||
])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||
KERNEL_INFINITE_RECURSION=-Winfinite-recursion
|
||||
AC_DEFINE([HAVE_KERNEL_INFINITE_RECURSION], 1,
|
||||
@ -375,17 +329,20 @@ dnl #
|
||||
dnl # Check if kernel cc supports -fno-ipa-sra option.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA], [
|
||||
saved_cc="$CC"
|
||||
AS_IF(
|
||||
[ test -n "$KERNEL_CC" ], [ CC="$KERNEL_CC" ],
|
||||
[ test -n "$KERNEL_LLVM" ], [ CC="clang" ],
|
||||
[ CC="gcc" ]
|
||||
)
|
||||
AC_MSG_CHECKING([whether $CC supports -fno-ipa-sra])
|
||||
AC_MSG_CHECKING([whether $KERNEL_CC supports -fno-ipa-sra])
|
||||
|
||||
saved_cc="$CC"
|
||||
saved_flags="$CFLAGS"
|
||||
CC="gcc"
|
||||
CFLAGS="$CFLAGS -Werror -fno-ipa-sra"
|
||||
|
||||
AS_IF([ test -n "$KERNEL_CC" ], [
|
||||
CC="$KERNEL_CC"
|
||||
])
|
||||
AS_IF([ test -n "$KERNEL_LLVM" ], [
|
||||
CC="clang"
|
||||
])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||
KERNEL_NO_IPA_SRA=-fno-ipa-sra
|
||||
AC_MSG_RESULT([yes])
|
||||
|
@ -29,8 +29,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH_4ARG], [
|
||||
const char *path = "path";
|
||||
fmode_t mode = 0;
|
||||
void *holder = NULL;
|
||||
struct blk_holder_ops h;
|
||||
|
||||
bdev = blkdev_get_by_path(path, mode, holder, NULL);
|
||||
bdev = blkdev_get_by_path(path, mode, holder, &h);
|
||||
])
|
||||
])
|
||||
|
||||
@ -47,8 +48,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_OPEN_BY_PATH], [
|
||||
const char *path = "path";
|
||||
fmode_t mode = 0;
|
||||
void *holder = NULL;
|
||||
struct blk_holder_ops h;
|
||||
|
||||
bdh = bdev_open_by_path(path, mode, holder, NULL);
|
||||
bdh = bdev_open_by_path(path, mode, holder, &h);
|
||||
])
|
||||
])
|
||||
|
||||
@ -66,8 +68,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_FILE_OPEN_BY_PATH], [
|
||||
const char *path = "path";
|
||||
fmode_t mode = 0;
|
||||
void *holder = NULL;
|
||||
struct blk_holder_ops h;
|
||||
|
||||
file = bdev_file_open_by_path(path, mode, holder, NULL);
|
||||
file = bdev_file_open_by_path(path, mode, holder, &h);
|
||||
])
|
||||
])
|
||||
|
||||
|
@ -24,9 +24,6 @@ dnl #
|
||||
dnl # 2.6.38 API change
|
||||
dnl # Added d_set_d_op() helper function.
|
||||
dnl #
|
||||
dnl # 6.17 API change
|
||||
dnl # d_set_d_op() removed. No direct replacement.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_SET_D_OP], [
|
||||
ZFS_LINUX_TEST_SRC([d_set_d_op], [
|
||||
#include <linux/dcache.h>
|
||||
@ -37,46 +34,22 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_D_SET_D_OP], [
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
|
||||
AC_MSG_CHECKING([whether d_set_d_op() is available])
|
||||
ZFS_LINUX_TEST_RESULT([d_set_d_op], [
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([d_set_d_op],
|
||||
[d_set_d_op], [fs/dcache.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_D_SET_D_OP, 1,
|
||||
[Define if d_set_d_op() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 6.17 API change
|
||||
dnl # sb->s_d_op removed; set_default_d_op(sb, dop) added
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_DEFAULT_D_OP], [
|
||||
ZFS_LINUX_TEST_SRC([set_default_d_op], [
|
||||
#include <linux/dcache.h>
|
||||
], [
|
||||
set_default_d_op(NULL, NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SET_DEFAULT_D_OP], [
|
||||
AC_MSG_CHECKING([whether set_default_d_op() is available])
|
||||
ZFS_LINUX_TEST_RESULT([set_default_d_op], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_DEFAULT_D_OP, 1,
|
||||
[Define if set_default_d_op() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
ZFS_LINUX_TEST_ERROR([d_set_d_op])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
|
||||
ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_SRC_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_SRC_SET_DEFAULT_D_OP
|
||||
ZFS_AC_KERNEL_SRC_S_D_OP
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
|
||||
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_SET_DEFAULT_D_OP
|
||||
ZFS_AC_KERNEL_S_D_OP
|
||||
])
|
||||
|
@ -70,7 +70,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
||||
ZFS_AC_KERNEL_SRC_COMMIT_METADATA
|
||||
ZFS_AC_KERNEL_SRC_SETATTR_PREPARE
|
||||
ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED
|
||||
ZFS_AC_KERNEL_SRC_DENTRY
|
||||
ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
|
||||
ZFS_AC_KERNEL_SRC_SECURITY_INODE
|
||||
ZFS_AC_KERNEL_SRC_FST_MOUNT
|
||||
@ -189,7 +188,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_COMMIT_METADATA
|
||||
ZFS_AC_KERNEL_SETATTR_PREPARE
|
||||
ZFS_AC_KERNEL_INSERT_INODE_LOCKED
|
||||
ZFS_AC_KERNEL_DENTRY
|
||||
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
|
||||
ZFS_AC_KERNEL_SECURITY_INODE
|
||||
ZFS_AC_KERNEL_FST_MOUNT
|
||||
|
@ -2,7 +2,7 @@ dnl #
|
||||
dnl # Check for statx() function and STATX_MNT_ID availability
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
||||
AC_CHECK_HEADERS([sys/stat.h],
|
||||
AC_CHECK_HEADERS([linux/stat.h],
|
||||
[have_stat_headers=yes],
|
||||
[have_stat_headers=no])
|
||||
|
||||
@ -14,7 +14,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
||||
AC_MSG_CHECKING([for STATX_MNT_ID])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <sys/stat.h>
|
||||
#include <linux/stat.h>
|
||||
]], [[
|
||||
struct statx stx;
|
||||
int mask = STATX_MNT_ID;
|
||||
@ -29,6 +29,6 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
||||
])
|
||||
])
|
||||
], [
|
||||
AC_MSG_WARN([sys/stat.h not found; skipping statx support])
|
||||
AC_MSG_WARN([linux/stat.h not found; skipping statx support])
|
||||
])
|
||||
]) dnl end AC_DEFUN
|
||||
|
@ -252,12 +252,10 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION
|
||||
ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_INFINITE_RECURSION
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_ATOMIC_ALIGNMENT
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_IMPLICIT_FALLTHROUGH
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH
|
||||
ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_FORMAT_ZERO_LENGTH
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_FORMAT_OVERFLOW
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA
|
||||
@ -267,7 +265,6 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
||||
ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD
|
||||
ZFS_AC_CONFIG_ALWAYS_SYSTEM
|
||||
ZFS_AC_CONFIG_ALWAYS_ARCH
|
||||
ZFS_AC_CONFIG_CHECK_ARCH_VAR
|
||||
ZFS_AC_CONFIG_ALWAYS_PYTHON
|
||||
ZFS_AC_CONFIG_ALWAYS_PYZFS
|
||||
ZFS_AC_CONFIG_ALWAYS_SED
|
||||
|
@ -4,7 +4,7 @@ The detailed contributor information can be found in [2][3].
|
||||
|
||||
Files: contrib/debian/*
|
||||
Copyright:
|
||||
2013-2025, Aron Xu <aron@debian.org>
|
||||
2013-2016, Aron Xu <aron@debian.org>
|
||||
2016, Petter Reinholdtsen <pere@hungry.com>
|
||||
2013, Carlos Alberto Lopez Perez <clopez@igalia.com>
|
||||
2013, Turbo Fredriksson <turbo@bayour.com>
|
||||
@ -12,8 +12,6 @@ Copyright:
|
||||
2011-2013, Darik Horn <dajhorn@vanadac.com>
|
||||
2018-2019, Mo Zhou <cdluminate@gmail.com>
|
||||
2018-2020, Mo Zhou <lumin@debian.org>
|
||||
2023-2024, Shengqi Chen <harry-chen@outlook.com>
|
||||
2024-2025, Shengqi Chen <harry@debian.org>
|
||||
License: GPL-2+
|
||||
|
||||
[1] https://tracker.debian.org/pkg/zfs-linux
|
||||
|
@ -1,4 +1,4 @@
|
||||
usr/bin/zarcsummary.py
|
||||
usr/bin/arc_summary.py
|
||||
usr/share/zfs/zfs-helpers.sh
|
||||
etc/default/zfs
|
||||
etc/init.d
|
||||
@ -9,4 +9,4 @@ etc/zfs/vdev_id.conf.sas_direct.example
|
||||
etc/zfs/vdev_id.conf.sas_switch.example
|
||||
etc/zfs/vdev_id.conf.scsi.example
|
||||
etc/zfs/zfs-functions
|
||||
usr/lib/systemd/system/zfs-import.service
|
||||
lib/systemd/system/zfs-import.service
|
||||
|
@ -1 +1 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*
|
||||
lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*
|
||||
|
@ -1,2 +1,2 @@
|
||||
usr/lib/*/security/pam_zfs_key.so
|
||||
lib/*/security/pam_zfs_key.so
|
||||
usr/share/pam-configs/zfs_key
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if ! $(ldd "/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security/pam_zfs_key.so" | grep -q "libasan") ; then
|
||||
if ! $(ldd "/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security/pam_zfs_key.so" | grep -q "libasan") ; then
|
||||
pam-auth-update --package
|
||||
fi
|
||||
|
||||
|
@ -1 +1 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libuutil.so.*
|
||||
lib/@DEB_HOST_MULTIARCH@/libuutil.so.*
|
||||
|
@ -1,5 +1,3 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/*.a
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/*.so
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig
|
||||
lib/@DEB_HOST_MULTIARCH@/*.a usr/lib/@DEB_HOST_MULTIARCH@
|
||||
usr/include
|
||||
|
||||
usr/lib/@DEB_HOST_MULTIARCH@
|
||||
|
@ -1,2 +1,2 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libzfs.so.*
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libzfs_core.so.*
|
||||
lib/@DEB_HOST_MULTIARCH@/libzfs.so.*
|
||||
lib/@DEB_HOST_MULTIARCH@/libzfs_core.so.*
|
||||
|
@ -1 +1 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*
|
||||
lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*
|
||||
|
@ -1 +1 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
|
||||
lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
|
||||
|
@ -1,4 +1,4 @@
|
||||
usr/sbin/ztest
|
||||
sbin/ztest
|
||||
usr/bin/raidz_test
|
||||
usr/share/man/man1/raidz_test.1
|
||||
usr/share/man/man1/test-runner.1
|
||||
|
@ -1,5 +1,5 @@
|
||||
etc/zfs/zed.d/*
|
||||
usr/lib/systemd/system/zfs-zed.service
|
||||
lib/systemd/system/zfs-zed.service
|
||||
usr/lib/zfs-linux/zed.d/*
|
||||
usr/sbin/zed
|
||||
usr/share/man/man8/zed.8
|
||||
|
@ -1,48 +1,48 @@
|
||||
etc/default/zfs
|
||||
etc/zfs/zfs-functions
|
||||
etc/zfs/zpool.d/
|
||||
usr/lib/systemd/system-generators/
|
||||
usr/lib/systemd/system-preset/
|
||||
usr/lib/systemd/system/zfs-import-cache.service
|
||||
usr/lib/systemd/system/zfs-import-scan.service
|
||||
usr/lib/systemd/system/zfs-import.target
|
||||
usr/lib/systemd/system/zfs-load-key.service
|
||||
usr/lib/systemd/system/zfs-mount.service
|
||||
usr/lib/systemd/system/zfs-mount@.service
|
||||
usr/lib/systemd/system/zfs-scrub-monthly@.timer
|
||||
usr/lib/systemd/system/zfs-scrub-weekly@.timer
|
||||
usr/lib/systemd/system/zfs-scrub@.service
|
||||
usr/lib/systemd/system/zfs-trim-monthly@.timer
|
||||
usr/lib/systemd/system/zfs-trim-weekly@.timer
|
||||
usr/lib/systemd/system/zfs-trim@.service
|
||||
usr/lib/systemd/system/zfs-share.service
|
||||
usr/lib/systemd/system/zfs-volume-wait.service
|
||||
usr/lib/systemd/system/zfs-volumes.target
|
||||
usr/lib/systemd/system/zfs.target
|
||||
usr/lib/udev/
|
||||
usr/sbin/fsck.zfs
|
||||
usr/sbin/mount.zfs
|
||||
usr/sbin/zdb
|
||||
usr/sbin/zfs
|
||||
usr/sbin/zfs_ids_to_path
|
||||
usr/sbin/zgenhostid
|
||||
usr/sbin/zhack
|
||||
usr/sbin/zinject
|
||||
usr/sbin/zpool
|
||||
usr/sbin/zstream
|
||||
usr/sbin/zstreamdump
|
||||
lib/systemd/system-generators/
|
||||
lib/systemd/system-preset/
|
||||
lib/systemd/system/zfs-import-cache.service
|
||||
lib/systemd/system/zfs-import-scan.service
|
||||
lib/systemd/system/zfs-import.target
|
||||
lib/systemd/system/zfs-load-key.service
|
||||
lib/systemd/system/zfs-mount.service
|
||||
lib/systemd/system/zfs-mount@.service
|
||||
lib/systemd/system/zfs-scrub-monthly@.timer
|
||||
lib/systemd/system/zfs-scrub-weekly@.timer
|
||||
lib/systemd/system/zfs-scrub@.service
|
||||
lib/systemd/system/zfs-trim-monthly@.timer
|
||||
lib/systemd/system/zfs-trim-weekly@.timer
|
||||
lib/systemd/system/zfs-trim@.service
|
||||
lib/systemd/system/zfs-share.service
|
||||
lib/systemd/system/zfs-volume-wait.service
|
||||
lib/systemd/system/zfs-volumes.target
|
||||
lib/systemd/system/zfs.target
|
||||
lib/udev/
|
||||
sbin/fsck.zfs
|
||||
sbin/mount.zfs
|
||||
sbin/zdb
|
||||
sbin/zfs
|
||||
sbin/zfs_ids_to_path
|
||||
sbin/zgenhostid
|
||||
sbin/zhack
|
||||
sbin/zinject
|
||||
sbin/zpool
|
||||
sbin/zstream
|
||||
sbin/zstreamdump
|
||||
usr/bin/zvol_wait
|
||||
usr/lib/modules-load.d/
|
||||
usr/lib/modules-load.d/ lib/
|
||||
usr/lib/zfs-linux/zpool.d/
|
||||
usr/lib/zfs-linux/zpool_influxdb
|
||||
usr/lib/zfs-linux/zfs_prepare_disk
|
||||
usr/bin/zarcsummary
|
||||
usr/bin/zarcstat
|
||||
usr/bin/dbufstat usr/sbin
|
||||
usr/bin/zilstat
|
||||
usr/sbin/arc_summary
|
||||
usr/sbin/arcstat
|
||||
usr/sbin/dbufstat
|
||||
usr/sbin/zilstat
|
||||
usr/share/zfs/compatibility.d/
|
||||
usr/share/bash-completion/completions
|
||||
usr/share/man/man1/zarcstat.1
|
||||
usr/share/man/man1/arcstat.1
|
||||
usr/share/man/man1/zhack.1
|
||||
usr/share/man/man1/zvol_wait.1
|
||||
usr/share/man/man5/
|
||||
|
@ -1,3 +0,0 @@
|
||||
usr/sbin/zfs usr/bin/zfs
|
||||
usr/sbin/zpool usr/bin/zpool
|
||||
usr/lib/zfs-linux/zpool_influxdb usr/bin/zpool_influxdb
|
@ -37,19 +37,18 @@ override_dh_auto_configure:
|
||||
@# Build the userland, but don't build the kernel modules.
|
||||
dh_auto_configure -- @CFGOPTS@ \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--with-mounthelperdir=/usr/sbin \
|
||||
--libdir=/usr/lib/"$(DEB_HOST_MULTIARCH)" \
|
||||
--with-udevdir=/usr/lib/udev \
|
||||
--sbindir=/sbin \
|
||||
--libdir=/lib/"$(DEB_HOST_MULTIARCH)" \
|
||||
--with-udevdir=/lib/udev \
|
||||
--with-zfsexecdir=/usr/lib/zfs-linux \
|
||||
--enable-systemd \
|
||||
--enable-pyzfs \
|
||||
--with-python=python3 \
|
||||
--with-pammoduledir='/usr/lib/$(DEB_HOST_MULTIARCH)/security' \
|
||||
--with-pammoduledir='/lib/$(DEB_HOST_MULTIARCH)/security' \
|
||||
--with-pkgconfigdir='/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig' \
|
||||
--with-systemdunitdir=/usr/lib/systemd/system \
|
||||
--with-systemdpresetdir=/usr/lib/systemd/system-preset \
|
||||
--with-systemdgeneratordir=/usr/lib/systemd/system-generators \
|
||||
--with-systemdunitdir=/lib/systemd/system \
|
||||
--with-systemdpresetdir=/lib/systemd/system-preset \
|
||||
--with-systemdgeneratordir=/lib/systemd/system-generators \
|
||||
--with-config=user
|
||||
|
||||
for i in $(wildcard $(CURDIR)/debian/*.install.in) ; do \
|
||||
@ -78,6 +77,19 @@ override_dh_auto_install:
|
||||
@# Install the utilities.
|
||||
$(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
|
||||
|
||||
# Move from bin_dir to /usr/sbin
|
||||
# Remove suffix (.py) as per policy 10.4 - Scripts
|
||||
# https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
|
||||
mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/'
|
||||
mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary'
|
||||
mv '$(CURDIR)/debian/tmp/usr/bin/arcstat' '$(CURDIR)/debian/tmp/usr/sbin/arcstat'
|
||||
mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
|
||||
mv '$(CURDIR)/debian/tmp/usr/bin/zilstat' '$(CURDIR)/debian/tmp/usr/sbin/zilstat'
|
||||
|
||||
@# Zed has dependencies outside of the system root.
|
||||
mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
|
||||
sed -i 's|ExecStart=/sbin/|ExecStart=/usr/sbin/|g' '$(CURDIR)/debian/tmp/lib/systemd/system/zfs-zed.service'
|
||||
|
||||
@# Install the DKMS source.
|
||||
@# We only want the files needed to build the modules
|
||||
install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
|
||||
@ -119,6 +131,11 @@ override_dh_auto_install:
|
||||
cd '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)'; ./autogen.sh
|
||||
rm -fr '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/autom4te.cache'
|
||||
|
||||
for i in `ls $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/*.so`; do \
|
||||
ln -s '/lib/$(DEB_HOST_MULTIARCH)/'`readlink $${i}` '$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/'`basename $${i}`; \
|
||||
rm $${i}; \
|
||||
done
|
||||
|
||||
chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions'
|
||||
chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
|
||||
|
||||
@ -142,7 +159,7 @@ override_dh_auto_clean:
|
||||
@if test -e META.orig; then mv META.orig META; fi
|
||||
|
||||
override_dh_install:
|
||||
find debian/tmp/usr/lib -name '*.la' -delete
|
||||
find debian/tmp/lib -name '*.la' -delete
|
||||
dh_install
|
||||
|
||||
override_dh_missing:
|
||||
@ -156,8 +173,8 @@ override_dh_installinit:
|
||||
dh_installinit -R --name zfs-zed
|
||||
|
||||
override_dh_installsystemd:
|
||||
mkdir -p debian/openzfs-zfsutils/usr/lib/systemd/system
|
||||
ln -sr /dev/null debian/openzfs-zfsutils/usr/lib/systemd/system/zfs-import.service
|
||||
mkdir -p debian/openzfs-zfsutils/lib/systemd/system
|
||||
ln -sr /dev/null debian/openzfs-zfsutils/lib/systemd/system/zfs-import.service
|
||||
dh_installsystemd --no-stop-on-upgrade -X zfs-zed.service
|
||||
dh_installsystemd --name zfs-zed
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
PREREQ="udev"
|
||||
PREREQ_UDEV_RULES="60-zvol.rules 69-vdev.rules"
|
||||
COPY_EXEC_LIST="/usr/lib/udev/zvol_id /usr/lib/udev/vdev_id"
|
||||
COPY_EXEC_LIST="/lib/udev/zvol_id /lib/udev/vdev_id"
|
||||
|
||||
# Generic result code.
|
||||
RC=0
|
||||
|
@ -16,8 +16,7 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
hostonly='' instmods -c zfs
|
||||
instmods mpt3sas virtio_blk
|
||||
instmods -c zfs
|
||||
}
|
||||
|
||||
install() {
|
||||
|
@ -8,12 +8,3 @@ fi
|
||||
. /usr/share/initramfs-tools/hook-functions
|
||||
|
||||
copy_exec /usr/share/initramfs-tools/zfsunlock /usr/bin/zfsunlock
|
||||
|
||||
if [ -f /etc/initramfs-tools/etc/motd ]; then
|
||||
copy_file text /etc/initramfs-tools/etc/motd /etc/motd
|
||||
else
|
||||
tmpf=$(mktemp)
|
||||
echo "If you use zfs encrypted root filesystems, you can use \`zfsunlock\` to manually unlock it" > "$tmpf"
|
||||
copy_file text "$tmpf" /etc/motd
|
||||
rm -f "$tmpf"
|
||||
fi
|
||||
|
@ -8,7 +8,7 @@ This contrib contains community compatibility patches to get Intel QAT working o
|
||||
These patches are based on the following Intel QAT version:
|
||||
[1.7.l.4.10.0-00014](https://01.org/sites/default/files/downloads/qat1.7.l.4.10.0-00014.tar.gz)
|
||||
|
||||
When using QAT with the above kernel versions, the following patches need to be applied using:
|
||||
When using QAT with above kernels versions, the following patches needs to be applied using:
|
||||
patch -p1 < _$PATCH_
|
||||
_Where $PATCH refers to the path of the patch in question_
|
||||
|
||||
|
@ -391,11 +391,7 @@ static int
|
||||
zfs_key_config_load(pam_handle_t *pamh, zfs_key_config_t *config,
|
||||
int argc, const char **argv)
|
||||
{
|
||||
#if defined(__FreeBSD__)
|
||||
config->homes_prefix = strdup("zroot/home");
|
||||
#else
|
||||
config->homes_prefix = strdup("rpool/home");
|
||||
#endif
|
||||
if (config->homes_prefix == NULL) {
|
||||
pam_syslog(pamh, LOG_ERR, "strdup failure");
|
||||
return (PAM_SERVICE_ERR);
|
||||
|
@ -604,4 +604,5 @@ class RaidzExpansionRunning(ZFSError):
|
||||
errno = ZFS_ERR_RAIDZ_EXPAND_IN_PROGRESS
|
||||
message = "A raidz device is currently expanding"
|
||||
|
||||
|
||||
# vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4
|
||||
|
@ -4223,7 +4223,7 @@ class _TempPool(object):
|
||||
self.getRoot().reset()
|
||||
return
|
||||
|
||||
# On the CI builders this may fail with "pool is busy"
|
||||
# On the Buildbot builders this may fail with "pool is busy"
|
||||
# Retry 5 times before raising an error
|
||||
retry = 0
|
||||
while True:
|
||||
|
@ -1,5 +1,5 @@
|
||||
DESCRIPTION
|
||||
These scripts were written with the primary intention of being portable and
|
||||
These script were written with the primary intention of being portable and
|
||||
usable on as many systems as possible.
|
||||
|
||||
This is, in practice, usually not possible. But the intention is there.
|
||||
|
@ -62,17 +62,6 @@ typedef longlong_t hrtime_t;
|
||||
#define SEC_TO_TICK(sec) ((sec) * hz)
|
||||
#define NSEC_TO_TICK(nsec) ((nsec) / (NANOSEC / hz))
|
||||
|
||||
static __inline hrtime_t
|
||||
getlrtime(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
hrtime_t nsec;
|
||||
|
||||
getnanouptime(&ts);
|
||||
nsec = ((hrtime_t)ts.tv_sec * NANOSEC) + ts.tv_nsec;
|
||||
return (nsec);
|
||||
}
|
||||
|
||||
static __inline hrtime_t
|
||||
gethrtime(void)
|
||||
{
|
||||
|
@ -542,6 +542,24 @@ blk_generic_alloc_queue(make_request_fn make_request, int node_id)
|
||||
}
|
||||
#endif /* !HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */
|
||||
|
||||
/*
|
||||
* All the io_*() helper functions below can operate on a bio, or a rq, but
|
||||
* not both. The older submit_bio() codepath will pass a bio, and the
|
||||
* newer blk-mq codepath will pass a rq.
|
||||
*/
|
||||
static inline int
|
||||
io_data_dir(struct bio *bio, struct request *rq)
|
||||
{
|
||||
if (rq != NULL) {
|
||||
if (op_is_write(req_op(rq))) {
|
||||
return (WRITE);
|
||||
} else {
|
||||
return (READ);
|
||||
}
|
||||
}
|
||||
return (bio_data_dir(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_flush(struct bio *bio, struct request *rq)
|
||||
{
|
||||
|
@ -60,6 +60,32 @@
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 2.6.30 API change,
|
||||
* The const keyword was added to the 'struct dentry_operations' in
|
||||
* the dentry structure. To handle this we define an appropriate
|
||||
* dentry_operations_t typedef which can be used.
|
||||
*/
|
||||
typedef const struct dentry_operations dentry_operations_t;
|
||||
|
||||
/*
|
||||
* 2.6.38 API addition,
|
||||
* Added d_clear_d_op() helper function which clears some flags and the
|
||||
* registered dentry->d_op table. This is required because d_set_d_op()
|
||||
* issues a warning when the dentry operations table is already set.
|
||||
* For the .zfs control directory to work properly we must be able to
|
||||
* override the default operations table and register custom .d_automount
|
||||
* and .d_revalidate callbacks.
|
||||
*/
|
||||
static inline void
|
||||
d_clear_d_op(struct dentry *dentry)
|
||||
{
|
||||
dentry->d_op = NULL;
|
||||
dentry->d_flags &= ~(
|
||||
DCACHE_OP_HASH | DCACHE_OP_COMPARE |
|
||||
DCACHE_OP_REVALIDATE | DCACHE_OP_DELETE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk and invalidate all dentry aliases of an inode
|
||||
* unless it's a mountpoint
|
||||
|
@ -130,7 +130,7 @@ RW_READ_HELD(krwlock_t *rwp)
|
||||
/*
|
||||
* The Linux rwsem implementation does not require a matching destroy.
|
||||
*/
|
||||
#define rw_destroy(rwp) ASSERT(!(RW_LOCK_HELD(rwp)))
|
||||
#define rw_destroy(rwp) ((void) 0)
|
||||
|
||||
/*
|
||||
* Upgrading a rwsem from a reader to a writer is not supported by the
|
||||
|
@ -25,6 +25,6 @@
|
||||
#ifndef _SPL_STAT_H
|
||||
#define _SPL_STAT_H
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <linux/stat.h>
|
||||
|
||||
#endif /* SPL_STAT_H */
|
||||
|
@ -79,14 +79,6 @@ gethrestime_sec(void)
|
||||
return (ts.tv_sec);
|
||||
}
|
||||
|
||||
static inline hrtime_t
|
||||
getlrtime(void)
|
||||
{
|
||||
inode_timespec_t ts;
|
||||
ktime_get_coarse_ts64(&ts);
|
||||
return (((hrtime_t)ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
|
||||
}
|
||||
|
||||
static inline hrtime_t
|
||||
gethrtime(void)
|
||||
{
|
||||
|
@ -55,7 +55,6 @@ extern const struct file_operations zpl_dir_file_operations;
|
||||
extern void zpl_prune_sb(uint64_t nr_to_scan, void *arg);
|
||||
|
||||
extern const struct super_operations zpl_super_operations;
|
||||
extern const struct dentry_operations zpl_dentry_operations;
|
||||
extern const struct export_operations zpl_export_operations;
|
||||
extern struct file_system_type zpl_fs_type;
|
||||
|
||||
|
@ -414,9 +414,9 @@ typedef struct dmu_buf {
|
||||
#define DMU_POOL_ZPOOL_CHECKPOINT "com.delphix:zpool_checkpoint"
|
||||
#define DMU_POOL_LOG_SPACEMAP_ZAP "com.delphix:log_spacemap_zap"
|
||||
#define DMU_POOL_DELETED_CLONES "com.delphix:deleted_clones"
|
||||
#define DMU_POOL_TXG_LOG_TIME_MINUTES "com.klarasystems:txg_log_time:minutes"
|
||||
#define DMU_POOL_TXG_LOG_TIME_DAYS "com.klarasystems:txg_log_time:days"
|
||||
#define DMU_POOL_TXG_LOG_TIME_MONTHS "com.klarasystems:txg_log_time:months"
|
||||
#define DMU_POOL_TXG_LOG_TIME_MINUTES "com.klaraystems:txg_log_time:minutes"
|
||||
#define DMU_POOL_TXG_LOG_TIME_DAYS "com.klaraystems:txg_log_time:days"
|
||||
#define DMU_POOL_TXG_LOG_TIME_MONTHS "com.klaraystems:txg_log_time:months"
|
||||
|
||||
/*
|
||||
* Allocate an object from this objset. The range of object numbers
|
||||
|
@ -46,7 +46,6 @@ extern "C" {
|
||||
#define ZFS_DELEG_PERM_MOUNT "mount"
|
||||
#define ZFS_DELEG_PERM_SHARE "share"
|
||||
#define ZFS_DELEG_PERM_SEND "send"
|
||||
#define ZFS_DELEG_PERM_SEND_RAW "send:raw"
|
||||
#define ZFS_DELEG_PERM_RECEIVE "receive"
|
||||
#define ZFS_DELEG_PERM_RECEIVE_APPEND "receive:append"
|
||||
#define ZFS_DELEG_PERM_ALLOW "allow"
|
||||
|
@ -58,7 +58,6 @@ extern "C" {
|
||||
#define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure"
|
||||
#define FM_EREPORT_ZFS_LOG_REPLAY "log_replay"
|
||||
#define FM_EREPORT_ZFS_CONFIG_CACHE_WRITE "config_cache_write"
|
||||
#define FM_EREPORT_ZFS_SITOUT "sitout"
|
||||
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_POOL "pool"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE "pool_failmode"
|
||||
|
@ -385,8 +385,6 @@ typedef enum {
|
||||
VDEV_PROP_TRIM_SUPPORT,
|
||||
VDEV_PROP_TRIM_ERRORS,
|
||||
VDEV_PROP_SLOW_IOS,
|
||||
VDEV_PROP_SIT_OUT,
|
||||
VDEV_PROP_AUTOSIT,
|
||||
VDEV_NUM_PROPS
|
||||
} vdev_prop_t;
|
||||
|
||||
@ -748,8 +746,6 @@ typedef struct zpool_load_policy {
|
||||
#define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift"
|
||||
#define ZPOOL_CONFIG_ASHIFT "ashift"
|
||||
#define ZPOOL_CONFIG_ASIZE "asize"
|
||||
#define ZPOOL_CONFIG_MIN_ALLOC "min_alloc"
|
||||
#define ZPOOL_CONFIG_MAX_ALLOC "max_alloc"
|
||||
#define ZPOOL_CONFIG_DTL "DTL"
|
||||
#define ZPOOL_CONFIG_SCAN_STATS "scan_stats" /* not stored on disk */
|
||||
#define ZPOOL_CONFIG_REMOVAL_STATS "removal_stats" /* not stored on disk */
|
||||
@ -1677,7 +1673,6 @@ typedef enum {
|
||||
ZFS_ERR_RAIDZ_EXPAND_IN_PROGRESS,
|
||||
ZFS_ERR_ASHIFT_MISMATCH,
|
||||
ZFS_ERR_STREAM_LARGE_MICROZAP,
|
||||
ZFS_ERR_TOO_MANY_SITOUTS,
|
||||
} zfs_errno_t;
|
||||
|
||||
/*
|
||||
|
@ -238,7 +238,8 @@ zfs_rs_set_end_raw(zfs_range_seg_t *rs, zfs_range_tree_t *rt, uint64_t end)
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfs_rs_set_fill_raw(zfs_range_seg_t *rs, zfs_range_tree_t *rt, uint64_t fill)
|
||||
zfs_zfs_rs_set_fill_raw(zfs_range_seg_t *rs, zfs_range_tree_t *rt,
|
||||
uint64_t fill)
|
||||
{
|
||||
ASSERT3U(rt->rt_type, <=, ZFS_RANGE_SEG_NUM_TYPES);
|
||||
switch (rt->rt_type) {
|
||||
@ -276,7 +277,7 @@ static inline void
|
||||
zfs_rs_set_fill(zfs_range_seg_t *rs, zfs_range_tree_t *rt, uint64_t fill)
|
||||
{
|
||||
ASSERT(IS_P2ALIGNED(fill, 1ULL << rt->rt_shift));
|
||||
zfs_rs_set_fill_raw(rs, rt, fill >> rt->rt_shift);
|
||||
zfs_zfs_rs_set_fill_raw(rs, rt, fill >> rt->rt_shift);
|
||||
}
|
||||
|
||||
typedef void zfs_range_tree_func_t(void *arg, uint64_t start, uint64_t size);
|
||||
|
@ -1084,7 +1084,6 @@ extern pool_state_t spa_state(spa_t *spa);
|
||||
extern spa_load_state_t spa_load_state(spa_t *spa);
|
||||
extern uint64_t spa_freeze_txg(spa_t *spa);
|
||||
extern uint64_t spa_get_worst_case_asize(spa_t *spa, uint64_t lsize);
|
||||
extern void spa_get_min_alloc_range(spa_t *spa, uint64_t *min, uint64_t *max);
|
||||
extern uint64_t spa_get_dspace(spa_t *spa);
|
||||
extern uint64_t spa_get_checkpoint_space(spa_t *spa);
|
||||
extern uint64_t spa_get_slop_space(spa_t *spa);
|
||||
|
@ -265,7 +265,6 @@ struct spa {
|
||||
uint64_t spa_min_ashift; /* of vdevs in normal class */
|
||||
uint64_t spa_max_ashift; /* of vdevs in normal class */
|
||||
uint64_t spa_min_alloc; /* of vdevs in normal class */
|
||||
uint64_t spa_max_alloc; /* of vdevs in normal class */
|
||||
uint64_t spa_gcd_alloc; /* of vdevs in normal class */
|
||||
uint64_t spa_config_guid; /* config pool guid */
|
||||
uint64_t spa_load_guid; /* spa_load initialized guid */
|
||||
|
@ -279,12 +279,10 @@ struct vdev {
|
||||
uint64_t vdev_noalloc; /* device is passivated? */
|
||||
uint64_t vdev_removing; /* device is being removed? */
|
||||
uint64_t vdev_failfast; /* device failfast setting */
|
||||
boolean_t vdev_autosit; /* automatic sitout management */
|
||||
boolean_t vdev_rz_expanding; /* raidz is being expanded? */
|
||||
boolean_t vdev_ishole; /* is a hole in the namespace */
|
||||
uint64_t vdev_top_zap;
|
||||
vdev_alloc_bias_t vdev_alloc_bias; /* metaslab allocation bias */
|
||||
uint64_t vdev_last_latency_check;
|
||||
|
||||
/* pool checkpoint related */
|
||||
space_map_t *vdev_checkpoint_sm; /* contains reserved blocks */
|
||||
@ -433,10 +431,6 @@ struct vdev {
|
||||
hrtime_t vdev_mmp_pending; /* 0 if write finished */
|
||||
uint64_t vdev_mmp_kstat_id; /* to find kstat entry */
|
||||
uint64_t vdev_expansion_time; /* vdev's last expansion time */
|
||||
/* used to calculate average read latency */
|
||||
uint64_t *vdev_prev_histo;
|
||||
int64_t vdev_outlier_count; /* read outlier amongst peers */
|
||||
hrtime_t vdev_read_sit_out_expire; /* end of sit out period */
|
||||
list_node_t vdev_leaf_node; /* leaf vdev list */
|
||||
|
||||
/*
|
||||
|
@ -61,9 +61,6 @@ void vdev_raidz_checksum_error(zio_t *, struct raidz_col *, abd_t *);
|
||||
struct raidz_row *vdev_raidz_row_alloc(int, zio_t *);
|
||||
void vdev_raidz_reflow_copy_scratch(spa_t *);
|
||||
void raidz_dtl_reassessed(vdev_t *);
|
||||
boolean_t vdev_sit_out_reads(vdev_t *, zio_flag_t);
|
||||
void vdev_raidz_sit_child(vdev_t *, uint64_t);
|
||||
void vdev_raidz_unsit_child(vdev_t *);
|
||||
|
||||
extern const zio_vsd_ops_t vdev_raidz_vsd_ops;
|
||||
|
||||
|
@ -119,7 +119,6 @@ typedef struct raidz_col {
|
||||
uint8_t rc_need_orig_restore:1; /* need to restore from orig_data? */
|
||||
uint8_t rc_force_repair:1; /* Write good data to this column */
|
||||
uint8_t rc_allow_repair:1; /* Allow repair I/O to this column */
|
||||
uint8_t rc_latency_outlier:1; /* Latency outlier for this device */
|
||||
int rc_shadow_devidx; /* for double write during expansion */
|
||||
int rc_shadow_error; /* for double write during expansion */
|
||||
uint64_t rc_shadow_offset; /* for double write during expansion */
|
||||
@ -134,7 +133,6 @@ typedef struct raidz_row {
|
||||
int rr_firstdatacol; /* First data column/parity count */
|
||||
abd_t *rr_abd_empty; /* dRAID empty sector buffer */
|
||||
int rr_nempty; /* empty sectors included in parity */
|
||||
int rr_outlier_cnt; /* Count of latency outlier devices */
|
||||
#ifdef ZFS_DEBUG
|
||||
uint64_t rr_offset; /* Logical offset for *_io_verify() */
|
||||
uint64_t rr_size; /* Physical size for *_io_verify() */
|
||||
|
@ -46,7 +46,7 @@ void zfs_file_close(zfs_file_t *fp);
|
||||
|
||||
int zfs_file_write(zfs_file_t *fp, const void *buf, size_t len, ssize_t *resid);
|
||||
int zfs_file_pwrite(zfs_file_t *fp, const void *buf, size_t len, loff_t off,
|
||||
uint8_t ashift, ssize_t *resid);
|
||||
ssize_t *resid);
|
||||
int zfs_file_read(zfs_file_t *fp, void *buf, size_t len, ssize_t *resid);
|
||||
int zfs_file_pread(zfs_file_t *fp, void *buf, size_t len, loff_t off,
|
||||
ssize_t *resid);
|
||||
|
@ -455,7 +455,6 @@ typedef enum zinject_type {
|
||||
ZINJECT_DECRYPT_FAULT,
|
||||
ZINJECT_DELAY_IMPORT,
|
||||
ZINJECT_DELAY_EXPORT,
|
||||
ZINJECT_DELAY_READY,
|
||||
} zinject_type_t;
|
||||
|
||||
typedef enum zinject_iotype {
|
||||
|
@ -82,8 +82,7 @@ gbh_nblkptrs(uint64_t size) {
|
||||
static inline zio_eck_t *
|
||||
gbh_eck(zio_gbh_phys_t *gbh, uint64_t size) {
|
||||
ASSERT(IS_P2ALIGNED(size, sizeof (blkptr_t)));
|
||||
return ((zio_eck_t *)((uintptr_t)gbh + (size_t)size -
|
||||
sizeof (zio_eck_t)));
|
||||
return ((zio_eck_t *)((uintptr_t)gbh + size - sizeof (zio_eck_t)));
|
||||
}
|
||||
|
||||
static inline blkptr_t *
|
||||
@ -718,7 +717,6 @@ extern void zio_handle_ignored_writes(zio_t *zio);
|
||||
extern hrtime_t zio_handle_io_delay(zio_t *zio);
|
||||
extern void zio_handle_import_delay(spa_t *spa, hrtime_t elapsed);
|
||||
extern void zio_handle_export_delay(spa_t *spa, hrtime_t elapsed);
|
||||
extern hrtime_t zio_handle_ready_delay(zio_t *zio);
|
||||
|
||||
/*
|
||||
* Checksum ereport functions
|
||||
|
@ -53,7 +53,7 @@ extern int zvol_set_volsize(const char *, uint64_t);
|
||||
extern int zvol_set_volthreading(const char *, boolean_t);
|
||||
extern int zvol_set_common(const char *, zfs_prop_t, zprop_source_t, uint64_t);
|
||||
extern int zvol_set_ro(const char *, boolean_t);
|
||||
extern int zvol_suspend(const char *, zvol_state_handle_t **);
|
||||
extern zvol_state_handle_t *zvol_suspend(const char *);
|
||||
extern int zvol_resume(zvol_state_handle_t *);
|
||||
extern void *zvol_tag(zvol_state_handle_t *);
|
||||
|
||||
|
@ -55,7 +55,6 @@ typedef enum {
|
||||
ZFS_DELEG_NOTE_PROMOTE,
|
||||
ZFS_DELEG_NOTE_RENAME,
|
||||
ZFS_DELEG_NOTE_SEND,
|
||||
ZFS_DELEG_NOTE_SEND_RAW,
|
||||
ZFS_DELEG_NOTE_RECEIVE,
|
||||
ZFS_DELEG_NOTE_ALLOW,
|
||||
ZFS_DELEG_NOTE_USERPROP,
|
||||
|
@ -2,9 +2,6 @@ include $(srcdir)/%D%/include/Makefile.am
|
||||
|
||||
libspl_assert_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS) $(LIBUNWIND_CFLAGS)
|
||||
libspl_la_CFLAGS = $(libspl_assert_la_CFLAGS)
|
||||
if TARGET_CPU_I386
|
||||
libspl_la_CFLAGS += $(NO_ATOMIC_ALIGNMENT)
|
||||
endif
|
||||
|
||||
noinst_LTLIBRARIES += libspl_assert.la libspl.la
|
||||
CPPCHECKTARGETS += libspl_assert.la libspl.la
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#ifdef HAVE_STATX
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <linux/stat.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -97,15 +97,6 @@ gethrestime_sec(void)
|
||||
return (tv.tv_sec);
|
||||
}
|
||||
|
||||
static inline hrtime_t
|
||||
getlrtime(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
(void) gettimeofday(&tv, NULL);
|
||||
return ((((uint64_t)tv.tv_sec) * NANOSEC) +
|
||||
((uint64_t)tv.tv_usec * NSEC_PER_USEC));
|
||||
}
|
||||
|
||||
static inline hrtime_t
|
||||
gethrtime(void)
|
||||
{
|
||||
|
@ -6117,9 +6117,7 @@
|
||||
<enumerator name='VDEV_PROP_TRIM_SUPPORT' value='49'/>
|
||||
<enumerator name='VDEV_PROP_TRIM_ERRORS' value='50'/>
|
||||
<enumerator name='VDEV_PROP_SLOW_IOS' value='51'/>
|
||||
<enumerator name='VDEV_PROP_SIT_OUT' value='52'/>
|
||||
<enumerator name='VDEV_PROP_AUTOSIT' value='53'/>
|
||||
<enumerator name='VDEV_NUM_PROPS' value='54'/>
|
||||
<enumerator name='VDEV_NUM_PROPS' value='52'/>
|
||||
</enum-decl>
|
||||
<typedef-decl name='vdev_prop_t' type-id='1573bec8' id='5aa5c90c'/>
|
||||
<class-decl name='zpool_load_policy' size-in-bits='256' is-struct='yes' visibility='default' id='2f65b36f'>
|
||||
|
@ -5549,8 +5549,6 @@ zpool_get_vdev_prop_value(nvlist_t *nvprop, vdev_prop_t prop, char *prop_name,
|
||||
/* Only use if provided by the RAIDZ VDEV above */
|
||||
if (prop == VDEV_PROP_RAIDZ_EXPANDING)
|
||||
return (ENOENT);
|
||||
if (prop == VDEV_PROP_SIT_OUT)
|
||||
return (ENOENT);
|
||||
}
|
||||
if (vdev_prop_index_to_string(prop, intval,
|
||||
(const char **)&strval) != 0)
|
||||
@ -5720,16 +5718,8 @@ zpool_set_vdev_prop(zpool_handle_t *zhp, const char *vdevname,
|
||||
nvlist_free(nvl);
|
||||
nvlist_free(outnvl);
|
||||
|
||||
if (ret) {
|
||||
if (errno == ENOTSUP) {
|
||||
zfs_error_aux(zhp->zpool_hdl, dgettext(TEXT_DOMAIN,
|
||||
"property not supported for this vdev"));
|
||||
(void) zfs_error(zhp->zpool_hdl, EZFS_PROPTYPE, errbuf);
|
||||
} else {
|
||||
(void) zpool_standard_error(zhp->zpool_hdl, errno,
|
||||
errbuf);
|
||||
}
|
||||
}
|
||||
if (ret)
|
||||
(void) zpool_standard_error(zhp->zpool_hdl, errno, errbuf);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
@ -776,11 +776,6 @@ zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
||||
case ZFS_ERR_ASHIFT_MISMATCH:
|
||||
zfs_verror(hdl, EZFS_ASHIFT_MISMATCH, fmt, ap);
|
||||
break;
|
||||
case ZFS_ERR_TOO_MANY_SITOUTS:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "too many disks "
|
||||
"already sitting out"));
|
||||
zfs_verror(hdl, EZFS_BUSY, fmt, ap);
|
||||
break;
|
||||
default:
|
||||
zfs_error_aux(hdl, "%s", zfs_strerror(error));
|
||||
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
|
||||
|
@ -1238,7 +1238,7 @@ zfs_file_write(zfs_file_t *fp, const void *buf, size_t count, ssize_t *resid)
|
||||
*/
|
||||
int
|
||||
zfs_file_pwrite(zfs_file_t *fp, const void *buf,
|
||||
size_t count, loff_t pos, uint8_t ashift, ssize_t *resid)
|
||||
size_t count, loff_t pos, ssize_t *resid)
|
||||
{
|
||||
ssize_t rc, split, done;
|
||||
int sectors;
|
||||
@ -1248,8 +1248,8 @@ zfs_file_pwrite(zfs_file_t *fp, const void *buf,
|
||||
* system calls so that the process can be killed in between.
|
||||
* This is used by ztest to simulate realistic failure modes.
|
||||
*/
|
||||
sectors = count >> ashift;
|
||||
split = (sectors > 0 ? rand() % sectors : 0) << ashift;
|
||||
sectors = count >> SPA_MINBLOCKSHIFT;
|
||||
split = (sectors > 0 ? rand() % sectors : 0) << SPA_MINBLOCKSHIFT;
|
||||
rc = pwrite64(fp->f_fd, buf, split, pos);
|
||||
if (rc != -1) {
|
||||
done = rc;
|
||||
|
@ -2,7 +2,7 @@ dist_noinst_man_MANS = \
|
||||
%D%/man1/cstyle.1
|
||||
|
||||
dist_man_MANS = \
|
||||
%D%/man1/zarcstat.1 \
|
||||
%D%/man1/arcstat.1 \
|
||||
%D%/man1/raidz_test.1 \
|
||||
%D%/man1/test-runner.1 \
|
||||
%D%/man1/zhack.1 \
|
||||
@ -124,21 +124,10 @@ dist_noinst_DATA += $(dist_noinst_man_MANS) $(dist_man_MANS)
|
||||
|
||||
SUBSTFILES += $(nodist_man_MANS)
|
||||
|
||||
MANFILES = $(dist_noinst_man_MANS) $(dist_man_MANS) $(nodist_man_MANS)
|
||||
|
||||
PHONY += mancheck
|
||||
|
||||
mancheck_verbose = $(mancheck_verbose_@AM_V@)
|
||||
mancheck_verbose_ = $(mancheck_verbose_@AM_DEFAULT_V@)
|
||||
mancheck_verbose_0 = @echo MANCHECK $(_MTGT);
|
||||
|
||||
_MTGT = $(subst ^,/,$(subst mancheck-,,$@))
|
||||
mancheck-%:
|
||||
$(mancheck_verbose)scripts/mancheck.sh $(_MTGT)
|
||||
|
||||
mancheck: $(foreach manfile, $(MANFILES), $(addprefix mancheck-,$(subst /,^,$(manfile))))
|
||||
|
||||
CHECKS += mancheck
|
||||
mancheck:
|
||||
$(top_srcdir)/scripts/mancheck.sh $(srcdir)/%D%
|
||||
|
||||
|
||||
if BUILD_LINUX
|
||||
# The manual pager in most Linux distros defaults to "BSD" when .Os is blank,
|
||||
|
@ -13,12 +13,12 @@
|
||||
.\" Copyright (c) 2015 by Delphix. All rights reserved.
|
||||
.\" Copyright (c) 2020 by AJ Jordan. All rights reserved.
|
||||
.\"
|
||||
.Dd September 19, 2024
|
||||
.Dt ZARCSTAT 1
|
||||
.Dd December 23, 2022
|
||||
.Dt ARCSTAT 1
|
||||
.Os
|
||||
.
|
||||
.Sh NAME
|
||||
.Nm zarcstat
|
||||
.Nm arcstat
|
||||
.Nd report ZFS ARC and L2ARC statistics
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user