mirror of
https://github.com/openzfs/zfs.git
synced 2025-10-01 19:56:28 +00:00
Compare commits
90 Commits
zfs-2.4.0-
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8869caae5f | ||
![]() |
fa4d4b1f80 | ||
![]() |
32ce74ff32 | ||
![]() |
102ff2a640 | ||
![]() |
e4a407f29f | ||
![]() |
f0a95e8971 | ||
![]() |
75be5f2973 | ||
![]() |
8d4c3ee9e6 | ||
![]() |
4ff25e9013 | ||
![]() |
a44985315e | ||
![]() |
79be201806 | ||
![]() |
aecd6deeb3 | ||
![]() |
5c38029f4b | ||
![]() |
26b0f561be | ||
![]() |
c722bf8812 | ||
![]() |
0e1a53a8c0 | ||
![]() |
3e9347c9f7 | ||
![]() |
b2196fbedf | ||
![]() |
ea37c30fcb | ||
![]() |
876f705cc4 | ||
![]() |
11787965e0 | ||
![]() |
6ba51da93b | ||
![]() |
545d66204d | ||
![]() |
3387d34093 | ||
![]() |
ab8cc63c77 | ||
![]() |
ab93b4b70e | ||
![]() |
ffe93aee0a | ||
![]() |
1d2d812986 | ||
![]() |
d36684201f | ||
![]() |
45ac6045cc | ||
![]() |
faf2db3435 | ||
![]() |
d147ed7d26 | ||
![]() |
58b84289e8 | ||
![]() |
5c46baa1ce | ||
![]() |
f330b463de | ||
![]() |
4b764fb01a | ||
![]() |
f319ff3570 | ||
![]() |
3f4312a0a4 | ||
![]() |
9b772f328b | ||
![]() |
455c36156c | ||
![]() |
bc8bcfc71a | ||
![]() |
cb5f9aa582 | ||
![]() |
35f47cb4f4 | ||
![]() |
37cd30f714 | ||
![]() |
955fbc5ade | ||
![]() |
7b1cc9eb61 | ||
![]() |
654f2dcb42 | ||
![]() |
bc0b5318aa | ||
![]() |
d64711c202 | ||
![]() |
0620c979a5 | ||
![]() |
7f7c58389e | ||
![]() |
cd6db758f3 | ||
![]() |
bc4aac0395 | ||
![]() |
8f15d2e4d5 | ||
![]() |
92ca3ae56a | ||
![]() |
9ae20cf03d | ||
![]() |
a5571a0dd1 | ||
![]() |
d3429a75b0 | ||
![]() |
c6fe41cac5 | ||
![]() |
fe2f7cf6d7 | ||
![]() |
7939bad5e7 | ||
![]() |
9e5e95c24d | ||
![]() |
4b83891db0 | ||
![]() |
e29bfa5bd0 | ||
![]() |
a2424312c4 | ||
![]() |
59f8f5dfe1 | ||
![]() |
8266fa5858 | ||
![]() |
e3c3e86c04 | ||
![]() |
ced72fdd69 | ||
![]() |
b9c6b0e09b | ||
![]() |
c69b7ea6ca | ||
![]() |
ffba31c236 | ||
![]() |
dfc2c32590 | ||
![]() |
11b5c50238 | ||
![]() |
0e88a0e1ea | ||
![]() |
69b65dda8a | ||
![]() |
64d3143e82 | ||
![]() |
9acedbacee | ||
![]() |
5a8ba4520b | ||
![]() |
ccf5a8a6fc | ||
![]() |
1da2c30bed | ||
![]() |
976f765341 | ||
![]() |
ee7c362645 | ||
![]() |
14bad10f96 | ||
![]() |
e903177b56 | ||
![]() |
d247538e15 | ||
![]() |
0d54ae2880 | ||
![]() |
b6bd3228bb | ||
![]() |
e7485d04f1 | ||
![]() |
f1f74577cb |
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.
|
Filling out the following template will help other contributors better understand your proposed feature.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Describe the feature would like to see added to OpenZFS
|
### Describe the feature you would like to see added to OpenZFS
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Provide a clear and concise description of the feature.
|
Provide a clear and concise description of the feature.
|
||||||
|
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
<!--- Provide a general summary of your changes in the Title above -->
|
<!--- 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
|
### Motivation and Context
|
||||||
<!--- Why is this change required? What problem does it solve? -->
|
<!--- Why is this change required? What problem does it solve? -->
|
||||||
<!--- If it fixes an open issue, please link to the issue here. -->
|
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||||
|
@ -65,7 +65,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# check last (HEAD) commit message
|
# check last (HEAD) commit message
|
||||||
last_commit_message_raw = subprocess.run([
|
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)
|
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
for line in last_commit_message_raw.stdout.decode().splitlines():
|
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,6 +6,13 @@
|
|||||||
|
|
||||||
set -eu
|
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
|
# install needed packages
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
@ -65,3 +72,6 @@ sudo zpool create -f -o ashift=12 zpool $SSD1 $SSD2 -O relatime=off \
|
|||||||
for i in /sys/block/s*/queue/scheduler; do
|
for i in /sys/block/s*/queue/scheduler; do
|
||||||
echo "none" | sudo tee $i
|
echo "none" | sudo tee $i
|
||||||
done
|
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"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
;;
|
;;
|
||||||
freebsd15-0c)
|
freebsd15-0c)
|
||||||
FreeBSD="15.0-PRERELEASE"
|
FreeBSD="15.0-ALPHA3"
|
||||||
OSNAME="FreeBSD $FreeBSD"
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI-ufs.raw.xz"
|
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 \
|
sudo pacman -Sy --noconfirm base-devel bc cpio cryptsetup dhclient dkms \
|
||||||
fakeroot fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils \
|
fakeroot fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils \
|
||||||
parted pax perf python-packaging python-setuptools qemu-guest-agent ksh \
|
parted pax perf python-packaging python-setuptools qemu-guest-agent ksh \
|
||||||
samba sysstat rng-tools rsync wget xxhash
|
samba strace sysstat rng-tools rsync wget xxhash
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,8 @@ function debian() {
|
|||||||
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
||||||
python3-cffi python3-dev python3-distlib python3-packaging libtirpc-dev \
|
python3-cffi python3-dev python3-distlib python3-packaging libtirpc-dev \
|
||||||
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
||||||
rsync samba sysstat uuid-dev watchdog wget xfslibs-dev xxhash zlib1g-dev
|
rsync samba strace sysstat uuid-dev watchdog wget xfslibs-dev xxhash \
|
||||||
|
zlib1g-dev
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,8 +88,8 @@ function rhel() {
|
|||||||
libuuid-devel lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester \
|
libuuid-devel lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester \
|
||||||
parted perf python3 python3-cffi python3-devel python3-packaging \
|
parted perf python3 python3-cffi python3-devel python3-packaging \
|
||||||
kernel-devel python3-setuptools qemu-guest-agent rng-tools rpcgen \
|
kernel-devel python3-setuptools qemu-guest-agent rng-tools rpcgen \
|
||||||
rpm-build rsync samba sysstat systemd watchdog wget xfsprogs-devel xxhash \
|
rpm-build rsync samba strace sysstat systemd watchdog wget xfsprogs-devel \
|
||||||
zlib-devel
|
xxhash zlib-devel
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +105,7 @@ function install_fedora_experimental_kernel {
|
|||||||
our_version="$1"
|
our_version="$1"
|
||||||
sudo dnf -y copr enable @kernel-vanilla/stable
|
sudo dnf -y copr enable @kernel-vanilla/stable
|
||||||
sudo dnf -y copr enable @kernel-vanilla/mainline
|
sudo dnf -y copr enable @kernel-vanilla/mainline
|
||||||
all="$(sudo dnf list --showduplicates kernel-*)"
|
all="$(sudo dnf list --showduplicates kernel-* python3-perf* perf* bpftool*)"
|
||||||
echo "Available versions:"
|
echo "Available versions:"
|
||||||
echo "$all"
|
echo "$all"
|
||||||
|
|
||||||
|
25
.github/workflows/scripts/qemu-5-setup.sh
vendored
25
.github/workflows/scripts/qemu-5-setup.sh
vendored
@ -108,19 +108,30 @@ echo '*/5 * * * * /root/cronjob.sh' > crontab.txt
|
|||||||
sudo crontab crontab.txt
|
sudo crontab crontab.txt
|
||||||
rm crontab.txt
|
rm crontab.txt
|
||||||
|
|
||||||
# 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
|
# Save the VM's serial output (ttyS0) to /var/tmp/console.txt
|
||||||
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
|
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
|
||||||
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
|
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
|
||||||
for ((i=1; i<=VMs; i++)); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
mkdir -p $RESPATH/vm$i
|
mkdir -p $RESPATH/vm$i
|
||||||
read "pty" <<< $(sudo virsh ttyconsole 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" &
|
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
|
done
|
||||||
echo "Console logging for ${VMs}x $OS started."
|
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."
|
||||||
|
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
|
sudo dmesg -c > dmesg-prerun.txt
|
||||||
mount > mount.txt
|
mount > mount.txt
|
||||||
df -h > df-prerun.txt
|
df -h > df-prerun.txt
|
||||||
$TDIR/zfs-tests.sh -vK -s 3GB -T $TAGS
|
$TDIR/zfs-tests.sh -vKO -s 3GB -T $TAGS
|
||||||
RV=$?
|
RV=$?
|
||||||
df -h > df-postrun.txt
|
df -h > df-postrun.txt
|
||||||
echo $RV > tests-exitcode.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"
|
os_selection="$FULL_OS"
|
||||||
fi
|
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
|
# They specified a custom kernel version for Fedora. Use only
|
||||||
# Fedora runners.
|
# Fedora runners.
|
||||||
os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]')
|
os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]')
|
||||||
@ -53,9 +53,8 @@ jobs:
|
|||||||
os_json=$(echo ${os_selection} | jq -c)
|
os_json=$(echo ${os_selection} | jq -c)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $os_json
|
echo "os=$os_json" | tee -a $GITHUB_OUTPUT
|
||||||
echo "os=$os_json" >> $GITHUB_OUTPUT
|
echo "ci_type=$ci_type" | tee -a $GITHUB_OUTPUT
|
||||||
echo "ci_type=$ci_type" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
qemu-vm:
|
qemu-vm:
|
||||||
name: qemu-x86
|
name: qemu-x86
|
||||||
@ -78,8 +77,12 @@ jobs:
|
|||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
timeout-minutes: 10
|
timeout-minutes: 20
|
||||||
run: .github/workflows/scripts/qemu-1-setup.sh
|
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)
|
||||||
|
|
||||||
- name: Start build machine
|
- name: Start build machine
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
6
META
6
META
@ -1,10 +1,10 @@
|
|||||||
Meta: 1
|
Meta: 1
|
||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.4.0
|
Version: 2.4.99
|
||||||
Release: rc1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 6.16
|
Linux-Maximum: 6.17
|
||||||
Linux-Minimum: 4.18
|
Linux-Minimum: 4.18
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
CLEANFILES =
|
CLEANFILES =
|
||||||
dist_noinst_DATA =
|
dist_noinst_DATA =
|
||||||
INSTALL_DATA_HOOKS =
|
INSTALL_DATA_HOOKS =
|
||||||
|
INSTALL_EXEC_HOOKS =
|
||||||
ALL_LOCAL =
|
ALL_LOCAL =
|
||||||
CLEAN_LOCAL =
|
CLEAN_LOCAL =
|
||||||
CHECKS = shellcheck checkbashisms
|
CHECKS = shellcheck checkbashisms
|
||||||
@ -71,6 +72,9 @@ all: gitrev
|
|||||||
PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
|
PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
|
||||||
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
|
PHONY += maintainer-clean-local
|
||||||
maintainer-clean-local:
|
maintainer-clean-local:
|
||||||
-$(RM) $(GITREV)
|
-$(RM) $(GITREV)
|
||||||
|
@ -98,17 +98,16 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
if USING_PYTHON
|
if USING_PYTHON
|
||||||
bin_SCRIPTS += arc_summary arcstat dbufstat zilstat
|
bin_SCRIPTS += zarcsummary zarcstat dbufstat zilstat
|
||||||
CLEANFILES += arc_summary arcstat dbufstat zilstat
|
CLEANFILES += zarcsummary zarcstat dbufstat zilstat
|
||||||
dist_noinst_DATA += %D%/arc_summary %D%/arcstat.in %D%/dbufstat.in %D%/zilstat.in
|
dist_noinst_DATA += %D%/zarcsummary %D%/zarcstat.in %D%/dbufstat.in %D%/zilstat.in
|
||||||
|
|
||||||
$(call SUBST,arcstat,%D%/)
|
$(call SUBST,zarcstat,%D%/)
|
||||||
$(call SUBST,dbufstat,%D%/)
|
$(call SUBST,dbufstat,%D%/)
|
||||||
$(call SUBST,zilstat,%D%/)
|
$(call SUBST,zilstat,%D%/)
|
||||||
arc_summary: %D%/arc_summary
|
zarcsummary: %D%/zarcsummary
|
||||||
$(AM_V_at)cp $< $@
|
$(AM_V_at)cp $< $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
PHONY += cmd
|
PHONY += cmd
|
||||||
cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(mounthelper_PROGRAMS)
|
cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(mounthelper_PROGRAMS)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# SPDX-License-Identifier: CDDL-1.0
|
# SPDX-License-Identifier: CDDL-1.0
|
||||||
#
|
#
|
||||||
# Print out ZFS ARC Statistics exported via kstat(1)
|
# Print out ZFS ARC Statistics exported via kstat(1)
|
||||||
# For a definition of fields, or usage, use arcstat -v
|
# For a definition of fields, or usage, use zarcstat -v
|
||||||
#
|
#
|
||||||
# This script was originally a fork of the original arcstat.pl (0.1)
|
# This script was originally a fork of the original arcstat.pl (0.1)
|
||||||
# by Neelakanth Nadgir, originally published on his Sun blog on
|
# by Neelakanth Nadgir, originally published on his Sun blog on
|
||||||
@ -56,6 +56,7 @@ import time
|
|||||||
import getopt
|
import getopt
|
||||||
import re
|
import re
|
||||||
import copy
|
import copy
|
||||||
|
import os
|
||||||
|
|
||||||
from signal import signal, SIGINT, SIGWINCH, SIG_DFL
|
from signal import signal, SIGINT, SIGWINCH, SIG_DFL
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ cols = {
|
|||||||
"zactive": [7, 1000, "zfetch prefetches active per second"],
|
"zactive": [7, 1000, "zfetch prefetches active per second"],
|
||||||
}
|
}
|
||||||
|
|
||||||
# ARC structural breakdown from arc_summary
|
# ARC structural breakdown from zarcsummary
|
||||||
structfields = {
|
structfields = {
|
||||||
"cmp": ["compressed", "Compressed"],
|
"cmp": ["compressed", "Compressed"],
|
||||||
"ovh": ["overhead", "Overhead"],
|
"ovh": ["overhead", "Overhead"],
|
||||||
@ -187,7 +188,7 @@ structstats = { # size stats
|
|||||||
"sz": ["_size", "size"],
|
"sz": ["_size", "size"],
|
||||||
}
|
}
|
||||||
|
|
||||||
# ARC types breakdown from arc_summary
|
# ARC types breakdown from zarcsummary
|
||||||
typefields = {
|
typefields = {
|
||||||
"data": ["data", "ARC data"],
|
"data": ["data", "ARC data"],
|
||||||
"meta": ["metadata", "ARC metadata"],
|
"meta": ["metadata", "ARC metadata"],
|
||||||
@ -198,7 +199,7 @@ typestats = { # size stats
|
|||||||
"sz": ["_size", "size"],
|
"sz": ["_size", "size"],
|
||||||
}
|
}
|
||||||
|
|
||||||
# ARC states breakdown from arc_summary
|
# ARC states breakdown from zarcsummary
|
||||||
statefields = {
|
statefields = {
|
||||||
"ano": ["anon", "Anonymous"],
|
"ano": ["anon", "Anonymous"],
|
||||||
"mfu": ["mfu", "MFU"],
|
"mfu": ["mfu", "MFU"],
|
||||||
@ -261,7 +262,7 @@ hdr_intr = 20 # Print header every 20 lines of output
|
|||||||
opfile = None
|
opfile = None
|
||||||
sep = " " # Default separator is 2 spaces
|
sep = " " # Default separator is 2 spaces
|
||||||
l2exist = False
|
l2exist = False
|
||||||
cmd = ("Usage: arcstat [-havxp] [-f fields] [-o file] [-s string] [interval "
|
cmd = ("Usage: zarcstat [-havxp] [-f fields] [-o file] [-s string] [interval "
|
||||||
"[count]]\n")
|
"[count]]\n")
|
||||||
cur = {}
|
cur = {}
|
||||||
d = {}
|
d = {}
|
||||||
@ -348,10 +349,10 @@ def usage():
|
|||||||
"character or string\n")
|
"character or string\n")
|
||||||
sys.stderr.write("\t -p : Disable auto-scaling of numerical fields\n")
|
sys.stderr.write("\t -p : Disable auto-scaling of numerical fields\n")
|
||||||
sys.stderr.write("\nExamples:\n")
|
sys.stderr.write("\nExamples:\n")
|
||||||
sys.stderr.write("\tarcstat -o /tmp/a.log 2 10\n")
|
sys.stderr.write("\tzarcstat -o /tmp/a.log 2 10\n")
|
||||||
sys.stderr.write("\tarcstat -s \",\" -o /tmp/a.log 2 10\n")
|
sys.stderr.write("\tzarcstat -s \",\" -o /tmp/a.log 2 10\n")
|
||||||
sys.stderr.write("\tarcstat -v\n")
|
sys.stderr.write("\tzarcstat -v\n")
|
||||||
sys.stderr.write("\tarcstat -f time,hit%,dh%,ph%,mh% 1\n")
|
sys.stderr.write("\tzarcstat -f time,hit%,dh%,ph%,mh% 1\n")
|
||||||
sys.stderr.write("\n")
|
sys.stderr.write("\n")
|
||||||
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -366,7 +367,7 @@ def snap_stats():
|
|||||||
|
|
||||||
cur = kstat
|
cur = kstat
|
||||||
|
|
||||||
# fill in additional values from arc_summary
|
# fill in additional values from zarcsummary
|
||||||
cur["caches_size"] = caches_size = cur["anon_data"]+cur["anon_metadata"]+\
|
cur["caches_size"] = caches_size = cur["anon_data"]+cur["anon_metadata"]+\
|
||||||
cur["mfu_data"]+cur["mfu_metadata"]+cur["mru_data"]+cur["mru_metadata"]+\
|
cur["mfu_data"]+cur["mfu_metadata"]+cur["mru_data"]+cur["mru_metadata"]+\
|
||||||
cur["uncached_data"]+cur["uncached_metadata"]
|
cur["uncached_data"]+cur["uncached_metadata"]
|
||||||
@ -766,6 +767,7 @@ def calculate():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
global sint
|
global sint
|
||||||
global count
|
global count
|
||||||
global hdr_intr
|
global hdr_intr
|
@ -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 Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See
|
||||||
the in-source documentation and code at
|
the in-source documentation and code at
|
||||||
https://github.com/openzfs/zfs/blob/master/module/zfs/arc.c for details.
|
https://github.com/openzfs/zfs/blob/master/module/zfs/arc.c for details.
|
||||||
The original introduction to arc_summary can be found at
|
The original introduction to zarcsummary can be found at
|
||||||
http://cuddletech.com/?p=454
|
http://cuddletech.com/?p=454
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ elif sys.platform.startswith('linux'):
|
|||||||
return get_params(TUNABLES_PATH)
|
return get_params(TUNABLES_PATH)
|
||||||
|
|
||||||
def get_version_impl(request):
|
def get_version_impl(request):
|
||||||
# The original arc_summary called /sbin/modinfo/{spl,zfs} to get
|
# The original zarcsummary called /sbin/modinfo/{spl,zfs} to get
|
||||||
# the version information. We switch to /sys/module/{spl,zfs}/version
|
# the version information. We switch to /sys/module/{spl,zfs}/version
|
||||||
# to make sure we get what is really loaded in the kernel
|
# to make sure we get what is really loaded in the kernel
|
||||||
try:
|
try:
|
||||||
@ -439,7 +439,7 @@ def print_header():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# datetime is now recommended over time but we keep the exact formatting
|
# datetime is now recommended over time but we keep the exact formatting
|
||||||
# from the older version of arc_summary in case there are scripts
|
# from the older version of zarcsummary in case there are scripts
|
||||||
# that expect it in this way
|
# that expect it in this way
|
||||||
daydate = time.strftime(DATE_FORMAT)
|
daydate = time.strftime(DATE_FORMAT)
|
||||||
spc_date = LINE_LENGTH-len(daydate)
|
spc_date = LINE_LENGTH-len(daydate)
|
@ -107,7 +107,9 @@ extern uint_t zfs_reconstruct_indirect_combinations_max;
|
|||||||
extern uint_t zfs_btree_verify_intensity;
|
extern uint_t zfs_btree_verify_intensity;
|
||||||
|
|
||||||
static const char cmdname[] = "zdb";
|
static const char cmdname[] = "zdb";
|
||||||
uint8_t dump_opt[256];
|
uint8_t dump_opt[512];
|
||||||
|
|
||||||
|
#define ALLOCATED_OPT 256
|
||||||
|
|
||||||
typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size);
|
typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size);
|
||||||
|
|
||||||
@ -383,7 +385,7 @@ verify_livelist_allocs(metaslab_verify_t *mv, uint64_t txg,
|
|||||||
sublivelist_verify_block_t svb = {{{0}}};
|
sublivelist_verify_block_t svb = {{{0}}};
|
||||||
DVA_SET_VDEV(&svb.svb_dva, mv->mv_vdid);
|
DVA_SET_VDEV(&svb.svb_dva, mv->mv_vdid);
|
||||||
DVA_SET_OFFSET(&svb.svb_dva, offset);
|
DVA_SET_OFFSET(&svb.svb_dva, offset);
|
||||||
DVA_SET_ASIZE(&svb.svb_dva, size);
|
DVA_SET_ASIZE(&svb.svb_dva, 0);
|
||||||
zfs_btree_index_t where;
|
zfs_btree_index_t where;
|
||||||
uint64_t end_offset = offset + size;
|
uint64_t end_offset = offset + size;
|
||||||
|
|
||||||
@ -1666,6 +1668,16 @@ dump_metaslab_stats(metaslab_t *msp)
|
|||||||
dump_histogram(rt->rt_histogram, ZFS_RANGE_TREE_HISTOGRAM_SIZE, 0);
|
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
|
static void
|
||||||
dump_metaslab(metaslab_t *msp)
|
dump_metaslab(metaslab_t *msp)
|
||||||
{
|
{
|
||||||
@ -1682,13 +1694,24 @@ dump_metaslab(metaslab_t *msp)
|
|||||||
(u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start,
|
(u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start,
|
||||||
(u_longlong_t)space_map_object(sm), freebuf);
|
(u_longlong_t)space_map_object(sm), freebuf);
|
||||||
|
|
||||||
if (dump_opt['m'] > 2 && !dump_opt['L']) {
|
if (dump_opt[ALLOCATED_OPT] ||
|
||||||
|
(dump_opt['m'] > 2 && !dump_opt['L'])) {
|
||||||
mutex_enter(&msp->ms_lock);
|
mutex_enter(&msp->ms_lock);
|
||||||
VERIFY0(metaslab_load(msp));
|
VERIFY0(metaslab_load(msp));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dump_opt['m'] > 2 && !dump_opt['L']) {
|
||||||
zfs_range_tree_stat_verify(msp->ms_allocatable);
|
zfs_range_tree_stat_verify(msp->ms_allocatable);
|
||||||
dump_metaslab_stats(msp);
|
dump_metaslab_stats(msp);
|
||||||
metaslab_unload(msp);
|
}
|
||||||
mutex_exit(&msp->ms_lock);
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dump_opt['m'] > 1 && sm != NULL &&
|
if (dump_opt['m'] > 1 && sm != NULL &&
|
||||||
@ -1703,6 +1726,12 @@ dump_metaslab(metaslab_t *msp)
|
|||||||
SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift);
|
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)
|
if (vd->vdev_ops == &vdev_draid_ops)
|
||||||
ASSERT3U(msp->ms_size, <=, 1ULL << vd->vdev_ms_shift);
|
ASSERT3U(msp->ms_size, <=, 1ULL << vd->vdev_ms_shift);
|
||||||
else
|
else
|
||||||
@ -1739,8 +1768,9 @@ print_vdev_metaslab_header(vdev_t *vd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) printf("\tvdev %10llu %s",
|
(void) printf("\tvdev %10llu\t%s metaslab shift %4llu",
|
||||||
(u_longlong_t)vd->vdev_id, bias_str);
|
(u_longlong_t)vd->vdev_id, bias_str,
|
||||||
|
(u_longlong_t)vd->vdev_ms_shift);
|
||||||
|
|
||||||
if (ms_flush_data_obj != 0) {
|
if (ms_flush_data_obj != 0) {
|
||||||
(void) printf(" ms_unflushed_phys object %llu",
|
(void) printf(" ms_unflushed_phys object %llu",
|
||||||
@ -2634,8 +2664,8 @@ print_indirect(spa_t *spa, blkptr_t *bp, const zbookmark_phys_t *zb,
|
|||||||
}
|
}
|
||||||
if (BP_GET_LEVEL(bp) != zb->zb_level) {
|
if (BP_GET_LEVEL(bp) != zb->zb_level) {
|
||||||
(void) printf(" (ERROR: Block pointer level "
|
(void) printf(" (ERROR: Block pointer level "
|
||||||
"(%llu) does not match bookmark level (%ld))",
|
"(%llu) does not match bookmark level (%lld))",
|
||||||
BP_GET_LEVEL(bp), zb->zb_level);
|
BP_GET_LEVEL(bp), (longlong_t)zb->zb_level);
|
||||||
corruption_found = B_TRUE;
|
corruption_found = B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2688,8 +2718,8 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
|
|||||||
if (fill != BP_GET_FILL(bp)) {
|
if (fill != BP_GET_FILL(bp)) {
|
||||||
(void) printf("%16llx: Block pointer "
|
(void) printf("%16llx: Block pointer "
|
||||||
"fill (%llu) does not match calculated "
|
"fill (%llu) does not match calculated "
|
||||||
"value (%lu)\n", offset, BP_GET_FILL(bp),
|
"value (%llu)\n", offset, BP_GET_FILL(bp),
|
||||||
fill);
|
(u_longlong_t)fill);
|
||||||
corruption_found = B_TRUE;
|
corruption_found = B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3271,6 +3301,7 @@ zdb_derive_key(dsl_dir_t *dd, uint8_t *key_out)
|
|||||||
uint64_t keyformat, salt, iters;
|
uint64_t keyformat, salt, iters;
|
||||||
int i;
|
int i;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
VERIFY0(zap_lookup(dd->dd_pool->dp_meta_objset, dd->dd_crypto_obj,
|
VERIFY0(zap_lookup(dd->dd_pool->dp_meta_objset, dd->dd_crypto_obj,
|
||||||
zfs_prop_to_name(ZFS_PROP_KEYFORMAT), sizeof (uint64_t),
|
zfs_prop_to_name(ZFS_PROP_KEYFORMAT), sizeof (uint64_t),
|
||||||
@ -3303,6 +3334,25 @@ zdb_derive_key(dsl_dir_t *dd, uint8_t *key_out)
|
|||||||
|
|
||||||
break;
|
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:
|
default:
|
||||||
fatal("no support for key format %u\n",
|
fatal("no support for key format %u\n",
|
||||||
(unsigned int) keyformat);
|
(unsigned int) keyformat);
|
||||||
@ -9375,6 +9425,8 @@ main(int argc, char **argv)
|
|||||||
{"all-reconstruction", no_argument, NULL, 'Y'},
|
{"all-reconstruction", no_argument, NULL, 'Y'},
|
||||||
{"livelist", no_argument, NULL, 'y'},
|
{"livelist", no_argument, NULL, 'y'},
|
||||||
{"zstd-headers", no_argument, NULL, 'Z'},
|
{"zstd-headers", no_argument, NULL, 'Z'},
|
||||||
|
{"allocated-map", no_argument, NULL,
|
||||||
|
ALLOCATED_OPT},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -9405,6 +9457,7 @@ main(int argc, char **argv)
|
|||||||
case 'u':
|
case 'u':
|
||||||
case 'y':
|
case 'y':
|
||||||
case 'Z':
|
case 'Z':
|
||||||
|
case ALLOCATED_OPT:
|
||||||
dump_opt[c]++;
|
dump_opt[c]++;
|
||||||
dump_all = 0;
|
dump_all = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -29,6 +29,6 @@
|
|||||||
#define _ZDB_H
|
#define _ZDB_H
|
||||||
|
|
||||||
void dump_intent_log(zilog_t *);
|
void dump_intent_log(zilog_t *);
|
||||||
extern uint8_t dump_opt[256];
|
extern uint8_t dump_opt[512];
|
||||||
|
|
||||||
#endif /* _ZDB_H */
|
#endif /* _ZDB_H */
|
||||||
|
@ -48,8 +48,6 @@
|
|||||||
|
|
||||||
#include "zdb.h"
|
#include "zdb.h"
|
||||||
|
|
||||||
extern uint8_t dump_opt[256];
|
|
||||||
|
|
||||||
static char tab_prefix[4] = "\t\t\t";
|
static char tab_prefix[4] = "\t\t\t";
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -9,18 +9,18 @@ dist_zedexec_SCRIPTS = \
|
|||||||
%D%/all-debug.sh \
|
%D%/all-debug.sh \
|
||||||
%D%/all-syslog.sh \
|
%D%/all-syslog.sh \
|
||||||
%D%/data-notify.sh \
|
%D%/data-notify.sh \
|
||||||
%D%/deadman-slot_off.sh \
|
%D%/deadman-sync-slot_off.sh \
|
||||||
%D%/generic-notify.sh \
|
%D%/generic-notify.sh \
|
||||||
%D%/pool_import-led.sh \
|
%D%/pool_import-sync-led.sh \
|
||||||
%D%/resilver_finish-notify.sh \
|
%D%/resilver_finish-notify.sh \
|
||||||
%D%/resilver_finish-start-scrub.sh \
|
%D%/resilver_finish-start-scrub.sh \
|
||||||
%D%/scrub_finish-notify.sh \
|
%D%/scrub_finish-notify.sh \
|
||||||
%D%/statechange-led.sh \
|
%D%/statechange-sync-led.sh \
|
||||||
%D%/statechange-notify.sh \
|
%D%/statechange-notify.sh \
|
||||||
%D%/statechange-slot_off.sh \
|
%D%/statechange-sync-slot_off.sh \
|
||||||
%D%/trim_finish-notify.sh \
|
%D%/trim_finish-notify.sh \
|
||||||
%D%/vdev_attach-led.sh \
|
%D%/vdev_attach-sync-led.sh \
|
||||||
%D%/vdev_clear-led.sh
|
%D%/vdev_clear-sync-led.sh
|
||||||
|
|
||||||
nodist_zedexec_SCRIPTS = \
|
nodist_zedexec_SCRIPTS = \
|
||||||
%D%/history_event-zfs-list-cacher.sh
|
%D%/history_event-zfs-list-cacher.sh
|
||||||
@ -30,17 +30,17 @@ SUBSTFILES += $(nodist_zedexec_SCRIPTS)
|
|||||||
zedconfdefaults = \
|
zedconfdefaults = \
|
||||||
all-syslog.sh \
|
all-syslog.sh \
|
||||||
data-notify.sh \
|
data-notify.sh \
|
||||||
deadman-slot_off.sh \
|
deadman-sync-slot_off.sh \
|
||||||
history_event-zfs-list-cacher.sh \
|
history_event-zfs-list-cacher.sh \
|
||||||
pool_import-led.sh \
|
pool_import-sync-led.sh \
|
||||||
resilver_finish-notify.sh \
|
resilver_finish-notify.sh \
|
||||||
resilver_finish-start-scrub.sh \
|
resilver_finish-start-scrub.sh \
|
||||||
scrub_finish-notify.sh \
|
scrub_finish-notify.sh \
|
||||||
statechange-led.sh \
|
statechange-sync-led.sh \
|
||||||
statechange-notify.sh \
|
statechange-notify.sh \
|
||||||
statechange-slot_off.sh \
|
statechange-sync-slot_off.sh \
|
||||||
vdev_attach-led.sh \
|
vdev_attach-sync-led.sh \
|
||||||
vdev_clear-led.sh
|
vdev_clear-sync-led.sh
|
||||||
|
|
||||||
dist_noinst_DATA += %D%/README
|
dist_noinst_DATA += %D%/README
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
statechange-led.sh
|
|
1
cmd/zed/zed.d/pool_import-sync-led.sh
Symbolic link
1
cmd/zed/zed.d/pool_import-sync-led.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
statechange-sync-led.sh
|
@ -1 +0,0 @@
|
|||||||
statechange-led.sh
|
|
1
cmd/zed/zed.d/vdev_attach-sync-led.sh
Symbolic link
1
cmd/zed/zed.d/vdev_attach-sync-led.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
statechange-sync-led.sh
|
@ -1 +0,0 @@
|
|||||||
statechange-led.sh
|
|
1
cmd/zed/zed.d/vdev_clear-sync-led.sh
Symbolic link
1
cmd/zed/zed.d/vdev_clear-sync-led.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
statechange-sync-led.sh
|
@ -196,37 +196,29 @@ _nop(int sig)
|
|||||||
(void) sig;
|
(void) sig;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void
|
||||||
_reap_children(void *arg)
|
wait_for_children(boolean_t do_pause, boolean_t wait)
|
||||||
{
|
{
|
||||||
(void) arg;
|
|
||||||
struct launched_process_node node, *pnode;
|
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int status;
|
|
||||||
struct rusage usage;
|
struct rusage usage;
|
||||||
struct sigaction sa = {};
|
int status;
|
||||||
|
struct launched_process_node node, *pnode;
|
||||||
(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; ) {
|
for (_reap_children_stop = B_FALSE; !_reap_children_stop; ) {
|
||||||
(void) pthread_mutex_lock(&_launched_processes_lock);
|
(void) pthread_mutex_lock(&_launched_processes_lock);
|
||||||
pid = wait4(0, &status, WNOHANG, &usage);
|
pid = wait4(0, &status, wait ? 0 : WNOHANG, &usage);
|
||||||
|
|
||||||
if (pid == 0 || pid == (pid_t)-1) {
|
if (pid == 0 || pid == (pid_t)-1) {
|
||||||
(void) pthread_mutex_unlock(&_launched_processes_lock);
|
(void) pthread_mutex_unlock(&_launched_processes_lock);
|
||||||
if (pid == 0 || errno == ECHILD)
|
if ((pid == 0) || (errno == ECHILD)) {
|
||||||
pause();
|
if (do_pause)
|
||||||
else if (errno != EINTR)
|
pause();
|
||||||
|
} else if (errno != EINTR)
|
||||||
zed_log_msg(LOG_WARNING,
|
zed_log_msg(LOG_WARNING,
|
||||||
"Failed to wait for children: %s",
|
"Failed to wait for children: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
if (!do_pause)
|
||||||
|
return;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
memset(&node, 0, sizeof (node));
|
memset(&node, 0, sizeof (node));
|
||||||
node.pid = pid;
|
node.pid = pid;
|
||||||
@ -278,6 +270,25 @@ _reap_children(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,6 +317,45 @@ zed_exec_fini(void)
|
|||||||
_reap_children_tid = (pthread_t)-1;
|
_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
|
* Process the event [eid] by synchronously invoking all zedlets with a
|
||||||
* matching class prefix.
|
* matching class prefix.
|
||||||
@ -368,9 +418,28 @@ zed_exec_process(uint64_t eid, const char *class, const char *subclass,
|
|||||||
z = zed_strings_next(zcp->zedlets)) {
|
z = zed_strings_next(zcp->zedlets)) {
|
||||||
for (csp = class_strings; *csp; csp++) {
|
for (csp = class_strings; *csp; csp++) {
|
||||||
n = strlen(*csp);
|
n = strlen(*csp);
|
||||||
if ((strncmp(z, *csp, n) == 0) && !isalpha(z[n]))
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
_zed_exec_fork_child(eid, zcp->zedlet_dir,
|
_zed_exec_fork_child(eid, zcp->zedlet_dir,
|
||||||
z, e, zcp->zevent_fd, zcp->do_foreground);
|
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);
|
free(e);
|
||||||
|
@ -930,19 +930,15 @@ usage:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return a default volblocksize for the pool which always uses more than
|
* Calculate the minimum allocation size based on the top-level vdevs.
|
||||||
* half of the data sectors. This primarily applies to dRAID which always
|
|
||||||
* writes full stripe widths.
|
|
||||||
*/
|
*/
|
||||||
static uint64_t
|
static uint64_t
|
||||||
default_volblocksize(zpool_handle_t *zhp, nvlist_t *props)
|
calculate_volblocksize(nvlist_t *config)
|
||||||
{
|
{
|
||||||
uint64_t volblocksize, asize = SPA_MINBLOCKSIZE;
|
uint64_t asize = SPA_MINBLOCKSIZE;
|
||||||
nvlist_t *tree, **vdevs;
|
nvlist_t *tree, **vdevs;
|
||||||
uint_t nvdevs;
|
uint_t nvdevs;
|
||||||
|
|
||||||
nvlist_t *config = zpool_get_config(zhp, NULL);
|
|
||||||
|
|
||||||
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &tree) != 0 ||
|
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &tree) != 0 ||
|
||||||
nvlist_lookup_nvlist_array(tree, ZPOOL_CONFIG_CHILDREN,
|
nvlist_lookup_nvlist_array(tree, ZPOOL_CONFIG_CHILDREN,
|
||||||
&vdevs, &nvdevs) != 0) {
|
&vdevs, &nvdevs) != 0) {
|
||||||
@ -973,6 +969,24 @@ default_volblocksize(zpool_handle_t *zhp, nvlist_t *props)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
* Calculate the target volblocksize such that more than half
|
||||||
* of the asize is used. The following table is for 4k sectors.
|
* of the asize is used. The following table is for 4k sectors.
|
||||||
@ -5303,6 +5317,7 @@ zfs_do_receive(int argc, char **argv)
|
|||||||
#define ZFS_DELEG_PERM_MOUNT "mount"
|
#define ZFS_DELEG_PERM_MOUNT "mount"
|
||||||
#define ZFS_DELEG_PERM_SHARE "share"
|
#define ZFS_DELEG_PERM_SHARE "share"
|
||||||
#define ZFS_DELEG_PERM_SEND "send"
|
#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 "receive"
|
||||||
#define ZFS_DELEG_PERM_RECEIVE_APPEND "receive:append"
|
#define ZFS_DELEG_PERM_RECEIVE_APPEND "receive:append"
|
||||||
#define ZFS_DELEG_PERM_ALLOW "allow"
|
#define ZFS_DELEG_PERM_ALLOW "allow"
|
||||||
@ -5345,6 +5360,7 @@ static zfs_deleg_perm_tab_t zfs_deleg_perm_tbl[] = {
|
|||||||
{ ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
|
{ ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
|
||||||
{ ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
|
{ ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
|
||||||
{ ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
|
{ 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_SHARE, ZFS_DELEG_NOTE_SHARE },
|
||||||
{ ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
|
{ ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
|
||||||
{ ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
|
{ ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
|
||||||
@ -5929,6 +5945,10 @@ deleg_perm_comment(zfs_deleg_note_t note)
|
|||||||
case ZFS_DELEG_NOTE_SEND:
|
case ZFS_DELEG_NOTE_SEND:
|
||||||
str = gettext("");
|
str = gettext("");
|
||||||
break;
|
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:
|
case ZFS_DELEG_NOTE_SHARE:
|
||||||
str = gettext("Allows sharing file systems over NFS or SMB"
|
str = gettext("Allows sharing file systems over NFS or SMB"
|
||||||
"\n\t\t\t\tprotocols");
|
"\n\t\t\t\tprotocols");
|
||||||
@ -6858,17 +6878,17 @@ print_holds(boolean_t scripted, int nwidth, int tagwidth, nvlist_t *nvl,
|
|||||||
|
|
||||||
if (scripted) {
|
if (scripted) {
|
||||||
if (parsable) {
|
if (parsable) {
|
||||||
(void) printf("%s\t%s\t%ld\n", zname,
|
(void) printf("%s\t%s\t%lld\n", zname,
|
||||||
tagname, time);
|
tagname, (long long)time);
|
||||||
} else {
|
} else {
|
||||||
(void) printf("%s\t%s\t%s\n", zname,
|
(void) printf("%s\t%s\t%s\n", zname,
|
||||||
tagname, tsbuf);
|
tagname, tsbuf);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (parsable) {
|
if (parsable) {
|
||||||
(void) printf("%-*s %-*s %ld\n",
|
(void) printf("%-*s %-*s %lld\n",
|
||||||
nwidth, zname, tagwidth,
|
nwidth, zname, tagwidth,
|
||||||
tagname, time);
|
tagname, (long long)time);
|
||||||
} else {
|
} else {
|
||||||
(void) printf("%-*s %-*s %s\n",
|
(void) printf("%-*s %-*s %s\n",
|
||||||
nwidth, zname, tagwidth,
|
nwidth, zname, tagwidth,
|
||||||
|
335
cmd/zhack.c
335
cmd/zhack.c
@ -54,6 +54,7 @@
|
|||||||
#include <sys/dmu_tx.h>
|
#include <sys/dmu_tx.h>
|
||||||
#include <zfeature_common.h>
|
#include <zfeature_common.h>
|
||||||
#include <libzutil.h>
|
#include <libzutil.h>
|
||||||
|
#include <sys/metaslab_impl.h>
|
||||||
|
|
||||||
static importargs_t g_importargs;
|
static importargs_t g_importargs;
|
||||||
static char *g_pool;
|
static char *g_pool;
|
||||||
@ -69,7 +70,8 @@ static __attribute__((noreturn)) void
|
|||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"Usage: zhack [-c cachefile] [-d dir] <subcommand> <args> ...\n"
|
"Usage: zhack [-o tunable] [-c cachefile] [-d dir] <subcommand> "
|
||||||
|
"<args> ...\n"
|
||||||
"where <subcommand> <args> is one of the following:\n"
|
"where <subcommand> <args> is one of the following:\n"
|
||||||
"\n");
|
"\n");
|
||||||
|
|
||||||
@ -93,7 +95,10 @@ usage(void)
|
|||||||
" -c repair corrupted label checksums\n"
|
" -c repair corrupted label checksums\n"
|
||||||
" -u restore the label on a detached device\n"
|
" -u restore the label on a detached device\n"
|
||||||
"\n"
|
"\n"
|
||||||
" <device> : path to vdev\n");
|
" <device> : path to vdev\n"
|
||||||
|
"\n"
|
||||||
|
" metaslab leak <pool>\n"
|
||||||
|
" apply allocation map from zdb to specified pool\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,10 +368,12 @@ feature_incr_sync(void *arg, dmu_tx_t *tx)
|
|||||||
zfeature_info_t *feature = arg;
|
zfeature_info_t *feature = arg;
|
||||||
uint64_t refcount;
|
uint64_t refcount;
|
||||||
|
|
||||||
|
mutex_enter(&spa->spa_feat_stats_lock);
|
||||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||||
feature_sync(spa, feature, refcount + 1, tx);
|
feature_sync(spa, feature, refcount + 1, tx);
|
||||||
spa_history_log_internal(spa, "zhack feature incr", tx,
|
spa_history_log_internal(spa, "zhack feature incr", tx,
|
||||||
"name=%s", feature->fi_guid);
|
"name=%s", feature->fi_guid);
|
||||||
|
mutex_exit(&spa->spa_feat_stats_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -376,10 +383,12 @@ feature_decr_sync(void *arg, dmu_tx_t *tx)
|
|||||||
zfeature_info_t *feature = arg;
|
zfeature_info_t *feature = arg;
|
||||||
uint64_t refcount;
|
uint64_t refcount;
|
||||||
|
|
||||||
|
mutex_enter(&spa->spa_feat_stats_lock);
|
||||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||||
feature_sync(spa, feature, refcount - 1, tx);
|
feature_sync(spa, feature, refcount - 1, tx);
|
||||||
spa_history_log_internal(spa, "zhack feature decr", tx,
|
spa_history_log_internal(spa, "zhack feature decr", tx,
|
||||||
"name=%s", feature->fi_guid);
|
"name=%s", feature->fi_guid);
|
||||||
|
mutex_exit(&spa->spa_feat_stats_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -496,6 +505,186 @@ zhack_do_feature(int argc, char **argv)
|
|||||||
return (0);
|
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) \
|
#define ASHIFT_UBERBLOCK_SHIFT(ashift) \
|
||||||
MIN(MAX(ashift, UBERBLOCK_SHIFT), \
|
MIN(MAX(ashift, UBERBLOCK_SHIFT), \
|
||||||
MAX_UBERBLOCK_SHIFT)
|
MAX_UBERBLOCK_SHIFT)
|
||||||
@ -525,6 +714,23 @@ zhack_repair_read_label(const int fd, vdev_label_t *vl,
|
|||||||
return (0);
|
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
|
static void
|
||||||
zhack_repair_calc_cksum(const int byteswap, void *data, const uint64_t offset,
|
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)
|
const uint64_t abdsize, zio_eck_t *eck, zio_cksum_t *cksum)
|
||||||
@ -551,33 +757,10 @@ zhack_repair_calc_cksum(const int byteswap, void *data, const uint64_t offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
zhack_repair_check_label(uberblock_t *ub, const int l, const char **cfg_keys,
|
zhack_repair_get_ashift(nvlist_t *cfg, const int l, uint64_t *ashift)
|
||||||
const size_t cfg_keys_len, nvlist_t *cfg, nvlist_t *vdev_tree_cfg,
|
|
||||||
uint64_t *ashift)
|
|
||||||
{
|
{
|
||||||
int err;
|
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,
|
err = nvlist_lookup_nvlist(cfg,
|
||||||
ZPOOL_CONFIG_VDEV_TREE, &vdev_tree_cfg);
|
ZPOOL_CONFIG_VDEV_TREE, &vdev_tree_cfg);
|
||||||
@ -601,7 +784,7 @@ zhack_repair_check_label(uberblock_t *ub, const int l, const char **cfg_keys,
|
|||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: nvlist key %s is zero\n",
|
"error: label %d: nvlist key %s is zero\n",
|
||||||
l, ZPOOL_CONFIG_ASHIFT);
|
l, ZPOOL_CONFIG_ASHIFT);
|
||||||
return (err);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -616,30 +799,35 @@ zhack_repair_undetach(uberblock_t *ub, nvlist_t *cfg, const int l)
|
|||||||
*/
|
*/
|
||||||
if (BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp) != 0) {
|
if (BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp) != 0) {
|
||||||
const uint64_t txg = BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp);
|
const uint64_t txg = BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp);
|
||||||
|
int err;
|
||||||
|
|
||||||
ub->ub_txg = txg;
|
ub->ub_txg = txg;
|
||||||
|
|
||||||
if (nvlist_remove_all(cfg, ZPOOL_CONFIG_CREATE_TXG) != 0) {
|
err = nvlist_remove_all(cfg, ZPOOL_CONFIG_CREATE_TXG);
|
||||||
|
if (err) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: "
|
"error: label %d: "
|
||||||
"Failed to remove pool creation TXG\n",
|
"Failed to remove pool creation TXG\n",
|
||||||
l);
|
l);
|
||||||
return (1);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvlist_remove_all(cfg, ZPOOL_CONFIG_POOL_TXG) != 0) {
|
err = nvlist_remove_all(cfg, ZPOOL_CONFIG_POOL_TXG);
|
||||||
|
if (err) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: Failed to remove pool TXG to "
|
"error: label %d: Failed to remove pool TXG to "
|
||||||
"be replaced.\n",
|
"be replaced.\n",
|
||||||
l);
|
l);
|
||||||
return (1);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvlist_add_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, txg) != 0) {
|
err = nvlist_add_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, txg);
|
||||||
|
if (err) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: "
|
"error: label %d: "
|
||||||
"Failed to add pool TXG of %" PRIu64 "\n",
|
"Failed to add pool TXG of %" PRIu64 "\n",
|
||||||
l, txg);
|
l, txg);
|
||||||
return (1);
|
return (err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -733,6 +921,7 @@ zhack_repair_test_cksum(const int byteswap, void *vdev_data,
|
|||||||
BSWAP_64(ZEC_MAGIC) : ZEC_MAGIC;
|
BSWAP_64(ZEC_MAGIC) : ZEC_MAGIC;
|
||||||
const uint64_t actual_magic = vdev_eck->zec_magic;
|
const uint64_t actual_magic = vdev_eck->zec_magic;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (actual_magic != expected_magic) {
|
if (actual_magic != expected_magic) {
|
||||||
(void) fprintf(stderr, "error: label %d: "
|
(void) fprintf(stderr, "error: label %d: "
|
||||||
"Expected "
|
"Expected "
|
||||||
@ -754,6 +943,36 @@ zhack_repair_test_cksum(const int byteswap, void *vdev_data,
|
|||||||
return (err);
|
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
|
static void
|
||||||
zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
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,
|
vdev_label_t *vl, const uint64_t label_offset, const int l,
|
||||||
@ -767,10 +986,7 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
(zio_eck_t *)((char *)(vdev_data) + VDEV_PHYS_SIZE) - 1;
|
(zio_eck_t *)((char *)(vdev_data) + VDEV_PHYS_SIZE) - 1;
|
||||||
const uint64_t vdev_phys_offset =
|
const uint64_t vdev_phys_offset =
|
||||||
label_offset + offsetof(vdev_label_t, vl_vdev_phys);
|
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 *cfg;
|
||||||
nvlist_t *vdev_tree_cfg = NULL;
|
|
||||||
uint64_t ashift;
|
uint64_t ashift;
|
||||||
int byteswap;
|
int byteswap;
|
||||||
|
|
||||||
@ -778,18 +994,9 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
if (err)
|
if (err)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (vdev_eck->zec_magic == 0) {
|
err = zhack_repair_get_byteswap(vdev_eck, l, &byteswap);
|
||||||
(void) fprintf(stderr, "error: label %d: "
|
if (err)
|
||||||
"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;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
byteswap =
|
|
||||||
(vdev_eck->zec_magic == BSWAP_64((uint64_t)ZEC_MAGIC));
|
|
||||||
|
|
||||||
if (byteswap) {
|
if (byteswap) {
|
||||||
byteswap_uint64_array(&vdev_eck->zec_cksum,
|
byteswap_uint64_array(&vdev_eck->zec_cksum,
|
||||||
@ -805,16 +1012,7 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = nvlist_unpack(vl->vl_vdev_phys.vp_nvlist,
|
err = zhack_repair_unpack_cfg(vl, l, &cfg);
|
||||||
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)
|
if (err)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -822,6 +1020,19 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
char *buf;
|
char *buf;
|
||||||
size_t buflen;
|
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);
|
err = zhack_repair_undetach(ub, cfg, l);
|
||||||
if (err)
|
if (err)
|
||||||
return;
|
return;
|
||||||
@ -981,7 +1192,7 @@ main(int argc, char **argv)
|
|||||||
dprintf_setup(&argc, argv);
|
dprintf_setup(&argc, argv);
|
||||||
zfs_prop_init();
|
zfs_prop_init();
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "+c:d:")) != -1) {
|
while ((c = getopt(argc, argv, "+c:d:o:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
g_importargs.cachefile = optarg;
|
g_importargs.cachefile = optarg;
|
||||||
@ -990,6 +1201,10 @@ main(int argc, char **argv)
|
|||||||
assert(g_importargs.paths < MAX_NUM_PATHS);
|
assert(g_importargs.paths < MAX_NUM_PATHS);
|
||||||
g_importargs.path[g_importargs.paths++] = optarg;
|
g_importargs.path[g_importargs.paths++] = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'o':
|
||||||
|
if (handle_tunable_option(optarg, B_FALSE) != 0)
|
||||||
|
exit(1);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
@ -1011,6 +1226,8 @@ main(int argc, char **argv)
|
|||||||
rv = zhack_do_feature(argc, argv);
|
rv = zhack_do_feature(argc, argv);
|
||||||
} else if (strcmp(subcommand, "label") == 0) {
|
} else if (strcmp(subcommand, "label") == 0) {
|
||||||
return (zhack_do_label(argc, argv));
|
return (zhack_do_label(argc, argv));
|
||||||
|
} else if (strcmp(subcommand, "metaslab") == 0) {
|
||||||
|
rv = zhack_do_metaslab(argc, argv);
|
||||||
} else {
|
} else {
|
||||||
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||||
subcommand);
|
subcommand);
|
||||||
|
@ -107,6 +107,8 @@
|
|||||||
* zinject
|
* zinject
|
||||||
* zinject <-a | -u pool>
|
* zinject <-a | -u pool>
|
||||||
* zinject -c <id|all>
|
* 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]
|
* zinject [-q] <-t type> [-f freq] [-u] [-a] [-m] [-e errno] [-l level]
|
||||||
* [-r range] <object>
|
* [-r range] <object>
|
||||||
* zinject [-f freq] [-a] [-m] [-u] -b objset:object:level:start:end pool
|
* zinject [-f freq] [-a] [-m] [-u] -b objset:object:level:start:end pool
|
||||||
@ -132,14 +134,18 @@
|
|||||||
* The '-f' flag controls the frequency of errors injected, expressed as a
|
* The '-f' flag controls the frequency of errors injected, expressed as a
|
||||||
* real number percentage between 0.0001 and 100. The default is 100.
|
* real number percentage between 0.0001 and 100. The default is 100.
|
||||||
*
|
*
|
||||||
* The this form is responsible for actually injecting the handler into the
|
* The <object> form is responsible for actually injecting the handler into the
|
||||||
* framework. It takes the arguments described above, translates them to the
|
* framework. It takes the arguments described above, translates them to the
|
||||||
* internal tuple using libzpool, and then issues an ioctl() to register the
|
* internal tuple using libzpool, and then issues an ioctl() to register the
|
||||||
* handler.
|
* handler.
|
||||||
*
|
*
|
||||||
* The final form can target a specific bookmark, regardless of whether a
|
* The '-b' option can target a specific bookmark, regardless of whether a
|
||||||
* human-readable interface has been designed. It allows developers to specify
|
* human-readable interface has been designed. It allows developers to specify
|
||||||
* a particular block by number.
|
* 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>
|
#include <errno.h>
|
||||||
@ -346,6 +352,13 @@ usage(void)
|
|||||||
"\t\tsuch that the operation takes a minimum of supplied seconds\n"
|
"\t\tsuch that the operation takes a minimum of supplied seconds\n"
|
||||||
"\t\tto complete.\n"
|
"\t\tto complete.\n"
|
||||||
"\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"
|
"\tzinject -I [-s <seconds> | -g <txgs>] pool\n"
|
||||||
"\t\tCause the pool to stop writing blocks yet not\n"
|
"\t\tCause the pool to stop writing blocks yet not\n"
|
||||||
"\t\treport errors for a duration. Simulates buggy hardware\n"
|
"\t\treport errors for a duration. Simulates buggy hardware\n"
|
||||||
@ -724,12 +737,15 @@ register_handler(const char *pool, int flags, zinject_record_t *record,
|
|||||||
if (quiet) {
|
if (quiet) {
|
||||||
(void) printf("%llu\n", (u_longlong_t)zc.zc_guid);
|
(void) printf("%llu\n", (u_longlong_t)zc.zc_guid);
|
||||||
} else {
|
} else {
|
||||||
|
boolean_t show_object = B_FALSE;
|
||||||
|
boolean_t show_iotype = B_FALSE;
|
||||||
(void) printf("Added handler %llu with the following "
|
(void) printf("Added handler %llu with the following "
|
||||||
"properties:\n", (u_longlong_t)zc.zc_guid);
|
"properties:\n", (u_longlong_t)zc.zc_guid);
|
||||||
(void) printf(" pool: %s\n", pool);
|
(void) printf(" pool: %s\n", pool);
|
||||||
if (record->zi_guid) {
|
if (record->zi_guid) {
|
||||||
(void) printf(" vdev: %llx\n",
|
(void) printf(" vdev: %llx\n",
|
||||||
(u_longlong_t)record->zi_guid);
|
(u_longlong_t)record->zi_guid);
|
||||||
|
show_iotype = B_TRUE;
|
||||||
} else if (record->zi_func[0] != '\0') {
|
} else if (record->zi_func[0] != '\0') {
|
||||||
(void) printf(" panic function: %s\n",
|
(void) printf(" panic function: %s\n",
|
||||||
record->zi_func);
|
record->zi_func);
|
||||||
@ -742,7 +758,18 @@ register_handler(const char *pool, int flags, zinject_record_t *record,
|
|||||||
} else if (record->zi_timer > 0) {
|
} else if (record->zi_timer > 0) {
|
||||||
(void) printf(" timer: %lld ms\n",
|
(void) printf(" timer: %lld ms\n",
|
||||||
(u_longlong_t)NSEC2MSEC(record->zi_timer));
|
(u_longlong_t)NSEC2MSEC(record->zi_timer));
|
||||||
|
if (record->zi_cmd == ZINJECT_DELAY_READY) {
|
||||||
|
show_object = B_TRUE;
|
||||||
|
show_iotype = B_TRUE;
|
||||||
|
}
|
||||||
} else {
|
} 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",
|
(void) printf("objset: %llu\n",
|
||||||
(u_longlong_t)record->zi_objset);
|
(u_longlong_t)record->zi_objset);
|
||||||
(void) printf("object: %llu\n",
|
(void) printf("object: %llu\n",
|
||||||
@ -910,6 +937,7 @@ main(int argc, char **argv)
|
|||||||
int ret;
|
int ret;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
uint32_t dvas = 0;
|
uint32_t dvas = 0;
|
||||||
|
hrtime_t ready_delay = -1;
|
||||||
|
|
||||||
if ((g_zfs = libzfs_init()) == NULL) {
|
if ((g_zfs = libzfs_init()) == NULL) {
|
||||||
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
|
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
|
||||||
@ -940,7 +968,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ((c = getopt(argc, argv,
|
while ((c = getopt(argc, argv,
|
||||||
":aA:b:C:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:P:")) != -1) {
|
":aA:b:C:d:D:E:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:P:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
flags |= ZINJECT_FLUSH_ARC;
|
flags |= ZINJECT_FLUSH_ARC;
|
||||||
@ -1113,6 +1141,18 @@ main(int argc, char **argv)
|
|||||||
case 'u':
|
case 'u':
|
||||||
flags |= ZINJECT_UNLOAD_SPA;
|
flags |= ZINJECT_UNLOAD_SPA;
|
||||||
break;
|
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':
|
case 'L':
|
||||||
if ((label = name_to_type(optarg)) == TYPE_INVAL &&
|
if ((label = name_to_type(optarg)) == TYPE_INVAL &&
|
||||||
!LABEL_TYPE(type)) {
|
!LABEL_TYPE(type)) {
|
||||||
@ -1150,7 +1190,7 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
||||||
level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED ||
|
level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED ||
|
||||||
record.zi_freq > 0 || dvas != 0) {
|
record.zi_freq > 0 || dvas != 0 || ready_delay >= 0) {
|
||||||
(void) fprintf(stderr, "cancel (-c) incompatible with "
|
(void) fprintf(stderr, "cancel (-c) incompatible with "
|
||||||
"any other options\n");
|
"any other options\n");
|
||||||
usage();
|
usage();
|
||||||
@ -1186,7 +1226,7 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
||||||
level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED ||
|
level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED ||
|
||||||
dvas != 0) {
|
dvas != 0 || ready_delay >= 0) {
|
||||||
(void) fprintf(stderr, "device (-d) incompatible with "
|
(void) fprintf(stderr, "device (-d) incompatible with "
|
||||||
"data error injection\n");
|
"data error injection\n");
|
||||||
usage();
|
usage();
|
||||||
@ -1276,13 +1316,23 @@ main(int argc, char **argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
record.zi_cmd = ZINJECT_DATA_FAULT;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (translate_raw(raw, &record) != 0) {
|
if (translate_raw(raw, &record) != 0) {
|
||||||
libzfs_fini(g_zfs);
|
libzfs_fini(g_zfs);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
if (!error)
|
|
||||||
error = EIO;
|
|
||||||
} else if (record.zi_cmd == ZINJECT_PANIC) {
|
} else if (record.zi_cmd == ZINJECT_PANIC) {
|
||||||
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
|
||||||
level != 0 || device != NULL || record.zi_freq > 0 ||
|
level != 0 || device != NULL || record.zi_freq > 0 ||
|
||||||
@ -1410,6 +1460,13 @@ main(int argc, char **argv)
|
|||||||
record.zi_dvas = dvas;
|
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 (error == EACCES) {
|
||||||
if (type != TYPE_DATA) {
|
if (type != TYPE_DATA) {
|
||||||
(void) fprintf(stderr, "decryption errors "
|
(void) fprintf(stderr, "decryption errors "
|
||||||
@ -1425,8 +1482,12 @@ main(int argc, char **argv)
|
|||||||
* not found.
|
* not found.
|
||||||
*/
|
*/
|
||||||
error = ECKSUM;
|
error = ECKSUM;
|
||||||
} else {
|
} else if (record.zi_cmd == ZINJECT_UNINITIALIZED) {
|
||||||
record.zi_cmd = ZINJECT_DATA_FAULT;
|
record.zi_cmd = ZINJECT_DATA_FAULT;
|
||||||
|
if (!error)
|
||||||
|
error = EIO;
|
||||||
|
} else {
|
||||||
|
record.zi_iotype = io_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (translate_record(type, argv[0], range, level, &record, pool,
|
if (translate_record(type, argv[0], range, level, &record, pool,
|
||||||
@ -1434,8 +1495,6 @@ main(int argc, char **argv)
|
|||||||
libzfs_fini(g_zfs);
|
libzfs_fini(g_zfs);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
if (!error)
|
|
||||||
error = EIO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -148,6 +148,7 @@ dist_zpoolcompat_DATA = \
|
|||||||
%D%/compatibility.d/openzfs-2.1-linux \
|
%D%/compatibility.d/openzfs-2.1-linux \
|
||||||
%D%/compatibility.d/openzfs-2.2 \
|
%D%/compatibility.d/openzfs-2.2 \
|
||||||
%D%/compatibility.d/openzfs-2.3 \
|
%D%/compatibility.d/openzfs-2.3 \
|
||||||
|
%D%/compatibility.d/openzfs-2.4 \
|
||||||
%D%/compatibility.d/openzfsonosx-1.7.0 \
|
%D%/compatibility.d/openzfsonosx-1.7.0 \
|
||||||
%D%/compatibility.d/openzfsonosx-1.8.1 \
|
%D%/compatibility.d/openzfsonosx-1.8.1 \
|
||||||
%D%/compatibility.d/openzfsonosx-1.9.3 \
|
%D%/compatibility.d/openzfsonosx-1.9.3 \
|
||||||
@ -187,7 +188,9 @@ zpoolcompatlinks = \
|
|||||||
"openzfs-2.2 openzfs-2.2-linux" \
|
"openzfs-2.2 openzfs-2.2-linux" \
|
||||||
"openzfs-2.2 openzfs-2.2-freebsd" \
|
"openzfs-2.2 openzfs-2.2-freebsd" \
|
||||||
"openzfs-2.3 openzfs-2.3-linux" \
|
"openzfs-2.3 openzfs-2.3-linux" \
|
||||||
"openzfs-2.3 openzfs-2.3-freebsd"
|
"openzfs-2.3 openzfs-2.3-freebsd" \
|
||||||
|
"openzfs-2.4 openzfs-2.4-linux" \
|
||||||
|
"openzfs-2.4 openzfs-2.4-freebsd"
|
||||||
|
|
||||||
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
||||||
INSTALL_DATA_HOOKS += zpool-install-data-hook
|
INSTALL_DATA_HOOKS += zpool-install-data-hook
|
||||||
|
48
cmd/zpool/compatibility.d/openzfs-2.4
Normal file
48
cmd/zpool/compatibility.d/openzfs-2.4
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# 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,6 +26,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
||||||
|
* Copyright (c) 2025, Klara, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
@ -52,7 +53,7 @@
|
|||||||
typedef struct zpool_node {
|
typedef struct zpool_node {
|
||||||
zpool_handle_t *zn_handle;
|
zpool_handle_t *zn_handle;
|
||||||
uu_avl_node_t zn_avlnode;
|
uu_avl_node_t zn_avlnode;
|
||||||
int zn_mark;
|
hrtime_t zn_last_refresh;
|
||||||
} zpool_node_t;
|
} zpool_node_t;
|
||||||
|
|
||||||
struct zpool_list {
|
struct zpool_list {
|
||||||
@ -62,6 +63,7 @@ struct zpool_list {
|
|||||||
uu_avl_pool_t *zl_pool;
|
uu_avl_pool_t *zl_pool;
|
||||||
zprop_list_t **zl_proplist;
|
zprop_list_t **zl_proplist;
|
||||||
zfs_type_t zl_type;
|
zfs_type_t zl_type;
|
||||||
|
hrtime_t zl_last_refresh;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -81,32 +83,47 @@ zpool_compare(const void *larg, const void *rarg, void *unused)
|
|||||||
* of known pools.
|
* of known pools.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
add_pool(zpool_handle_t *zhp, void *data)
|
add_pool(zpool_handle_t *zhp, zpool_list_t *zlp)
|
||||||
{
|
{
|
||||||
zpool_list_t *zlp = data;
|
zpool_node_t *node, *new = safe_malloc(sizeof (zpool_node_t));
|
||||||
zpool_node_t *node = safe_malloc(sizeof (zpool_node_t));
|
|
||||||
uu_avl_index_t idx;
|
uu_avl_index_t idx;
|
||||||
|
|
||||||
node->zn_handle = zhp;
|
new->zn_handle = zhp;
|
||||||
uu_avl_node_init(node, &node->zn_avlnode, zlp->zl_pool);
|
uu_avl_node_init(new, &new->zn_avlnode, zlp->zl_pool);
|
||||||
if (uu_avl_find(zlp->zl_avl, node, NULL, &idx) == NULL) {
|
|
||||||
|
node = uu_avl_find(zlp->zl_avl, new, NULL, &idx);
|
||||||
|
if (node == NULL) {
|
||||||
if (zlp->zl_proplist &&
|
if (zlp->zl_proplist &&
|
||||||
zpool_expand_proplist(zhp, zlp->zl_proplist,
|
zpool_expand_proplist(zhp, zlp->zl_proplist,
|
||||||
zlp->zl_type, zlp->zl_literal) != 0) {
|
zlp->zl_type, zlp->zl_literal) != 0) {
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
free(node);
|
free(new);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
uu_avl_insert(zlp->zl_avl, node, idx);
|
new->zn_last_refresh = zlp->zl_last_refresh;
|
||||||
|
uu_avl_insert(zlp->zl_avl, new, idx);
|
||||||
} else {
|
} else {
|
||||||
|
node->zn_last_refresh = zlp->zl_last_refresh;
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
free(node);
|
free(new);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
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
|
* 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
|
* arguments, then iterate over all pools in the system and add them to the AVL
|
||||||
@ -135,9 +152,10 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, zfs_type_t type,
|
|||||||
zlp->zl_type = type;
|
zlp->zl_type = type;
|
||||||
|
|
||||||
zlp->zl_literal = literal;
|
zlp->zl_literal = literal;
|
||||||
|
zlp->zl_last_refresh = gethrtime();
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
(void) zpool_iter(g_zfs, add_pool, zlp);
|
(void) zpool_iter(g_zfs, add_pool_cb, zlp);
|
||||||
zlp->zl_findall = B_TRUE;
|
zlp->zl_findall = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
@ -159,15 +177,69 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, zfs_type_t type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Search for any new pools, adding them to the list. We only add pools when no
|
* Refresh the state of all pools on the list. Additionally, if no options were
|
||||||
* options were given on the command line. Otherwise, we keep the list fixed as
|
* given on the command line, add any new pools and remove any that are no
|
||||||
* those that were explicitly specified.
|
* longer available.
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
pool_list_update(zpool_list_t *zlp)
|
pool_list_refresh(zpool_list_t *zlp)
|
||||||
{
|
{
|
||||||
if (zlp->zl_findall)
|
zlp->zl_last_refresh = gethrtime();
|
||||||
(void) zpool_iter(g_zfs, add_pool, zlp);
|
|
||||||
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -190,23 +262,6 @@ pool_list_iter(zpool_list_t *zlp, int unavail, zpool_iter_f func,
|
|||||||
return (ret);
|
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.
|
* Free all the handles associated with this list.
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
* Copyright (c) 2017, Intel Corporation.
|
* Copyright (c) 2017, Intel Corporation.
|
||||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||||
* Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
* Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
||||||
* Copyright (c) 2021, 2023, Klara Inc.
|
* Copyright (c) 2021, 2023, 2025, Klara, Inc.
|
||||||
* Copyright (c) 2021, 2025 Hewlett Packard Enterprise Development LP.
|
* Copyright (c) 2021, 2025 Hewlett Packard Enterprise Development LP.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -456,7 +456,7 @@ get_usage(zpool_help_t idx)
|
|||||||
"<pool> <vdev> ...\n"));
|
"<pool> <vdev> ...\n"));
|
||||||
case HELP_ATTACH:
|
case HELP_ATTACH:
|
||||||
return (gettext("\tattach [-fsw] [-o property=value] "
|
return (gettext("\tattach [-fsw] [-o property=value] "
|
||||||
"<pool> <device> <new-device>\n"));
|
"<pool> <vdev> <new-device>\n"));
|
||||||
case HELP_CLEAR:
|
case HELP_CLEAR:
|
||||||
return (gettext("\tclear [[--power]|[-nF]] <pool> [device]\n"));
|
return (gettext("\tclear [[--power]|[-nF]] <pool> [device]\n"));
|
||||||
case HELP_CREATE:
|
case HELP_CREATE:
|
||||||
@ -5761,24 +5761,6 @@ children:
|
|||||||
return (ret);
|
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.
|
* Callback to print out the iostats for the given pool.
|
||||||
*/
|
*/
|
||||||
@ -6359,15 +6341,14 @@ get_namewidth_iostat(zpool_handle_t *zhp, void *data)
|
|||||||
* This command can be tricky because we want to be able to deal with pool
|
* 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
|
* 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
|
* processing is handled by the pool_list_* routines in zpool_iter.c. We rely
|
||||||
* on pool_list_update() to detect the addition of new pools. Configuration
|
* on pool_list_refresh() to detect the addition and removal of pools.
|
||||||
* changes are all handled within libzfs.
|
* Configuration changes are all handled within libzfs.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
zpool_do_iostat(int argc, char **argv)
|
zpool_do_iostat(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
int ret;
|
int ret;
|
||||||
int npools;
|
|
||||||
float interval = 0;
|
float interval = 0;
|
||||||
unsigned long count = 0;
|
unsigned long count = 0;
|
||||||
zpool_list_t *list;
|
zpool_list_t *list;
|
||||||
@ -6618,10 +6599,24 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int last_npools = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if ((npools = pool_list_count(list)) == 0)
|
/*
|
||||||
|
* Refresh all pools in list, adding or removing pools as
|
||||||
|
* necessary.
|
||||||
|
*/
|
||||||
|
int npools = pool_list_refresh(list);
|
||||||
|
if (npools == 0) {
|
||||||
(void) fprintf(stderr, gettext("no pools available\n"));
|
(void) fprintf(stderr, gettext("no pools available\n"));
|
||||||
else {
|
} 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;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is the first iteration and -y was supplied
|
* If this is the first iteration and -y was supplied
|
||||||
* we skip any printing.
|
* we skip any printing.
|
||||||
@ -6629,15 +6624,6 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
boolean_t skip = (omit_since_boot &&
|
boolean_t skip = (omit_since_boot &&
|
||||||
cb.cb_iteration == 0);
|
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
|
* Iterate over all pools to determine the maximum width
|
||||||
* for the pool / device name column across all pools.
|
* for the pool / device name column across all pools.
|
||||||
@ -6728,6 +6714,8 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
|
|
||||||
(void) fflush(stdout);
|
(void) fflush(stdout);
|
||||||
(void) fsleep(interval);
|
(void) fsleep(interval);
|
||||||
|
|
||||||
|
last_npools = npools;
|
||||||
}
|
}
|
||||||
|
|
||||||
pool_list_free(list);
|
pool_list_free(list);
|
||||||
@ -7644,7 +7632,7 @@ zpool_do_replace(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool attach [-fsw] [-o property=value] <pool> <device>|<vdev> <new_device>
|
* zpool attach [-fsw] [-o property=value] <pool> <vdev> <new_device>
|
||||||
*
|
*
|
||||||
* -f Force attach, even if <new_device> appears to be in use.
|
* -f Force attach, even if <new_device> appears to be in use.
|
||||||
* -s Use sequential instead of healing reconstruction for resilver.
|
* -s Use sequential instead of healing reconstruction for resilver.
|
||||||
@ -7652,9 +7640,9 @@ zpool_do_replace(int argc, char **argv)
|
|||||||
* -w Wait for resilvering (mirror) or expansion (raidz) to complete
|
* -w Wait for resilvering (mirror) or expansion (raidz) to complete
|
||||||
* before returning.
|
* before returning.
|
||||||
*
|
*
|
||||||
* Attach <new_device> to a <device> or <vdev>, where the vdev can be of type
|
* Attach <new_device> to a <vdev>, where the vdev can be of type
|
||||||
* mirror or raidz. If <device> is not part of a mirror, then <device> will
|
* device, mirror or raidz. If <vdev> is not part of a mirror, then <vdev> will
|
||||||
* be transformed into a mirror of <device> and <new_device>. When a mirror
|
* be transformed into a mirror of <vdev> and <new_device>. When a mirror
|
||||||
* is involved, <new_device> will begin life with a DTL of [0, now], and will
|
* 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
|
* immediately begin to resilver itself. For the raidz case, a expansion will
|
||||||
* commence and reflow the raidz data across all the disks including the
|
* commence and reflow the raidz data across all the disks including the
|
||||||
|
@ -76,11 +76,10 @@ typedef struct zpool_list zpool_list_t;
|
|||||||
|
|
||||||
zpool_list_t *pool_list_get(int, char **, zprop_list_t **, zfs_type_t,
|
zpool_list_t *pool_list_get(int, char **, zprop_list_t **, zfs_type_t,
|
||||||
boolean_t, int *);
|
boolean_t, int *);
|
||||||
void pool_list_update(zpool_list_t *);
|
int pool_list_refresh(zpool_list_t *);
|
||||||
int pool_list_iter(zpool_list_t *, int unavail, zpool_iter_f, void *);
|
int pool_list_iter(zpool_list_t *, int unavail, zpool_iter_f, void *);
|
||||||
void pool_list_free(zpool_list_t *);
|
void pool_list_free(zpool_list_t *);
|
||||||
int pool_list_count(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;
|
extern libzfs_handle_t *g_zfs;
|
||||||
|
|
||||||
|
@ -609,22 +609,28 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
ZPOOL_CONFIG_PATH, &path) == 0);
|
ZPOOL_CONFIG_PATH, &path) == 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have a raidz/mirror that combines disks
|
* Skip active spares they should never cause
|
||||||
* with files, report it as an error.
|
* the pool to be evaluated as inconsistent.
|
||||||
*/
|
*/
|
||||||
if (!dontreport && type != NULL &&
|
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().
|
||||||
|
*/
|
||||||
|
if (fatal && !dontreport && type != NULL &&
|
||||||
strcmp(type, childtype) != 0) {
|
strcmp(type, childtype) != 0) {
|
||||||
if (ret != NULL)
|
if (ret != NULL)
|
||||||
free(ret);
|
free(ret);
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
if (fatal)
|
vdev_error(gettext(
|
||||||
vdev_error(gettext(
|
"mismatched replication "
|
||||||
"mismatched replication "
|
"level: %s contains both "
|
||||||
"level: %s contains both "
|
"files and devices\n"),
|
||||||
"files and devices\n"),
|
rep.zprl_type);
|
||||||
rep.zprl_type);
|
|
||||||
else
|
|
||||||
return (NULL);
|
|
||||||
dontreport = B_TRUE;
|
dontreport = B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ zstream_LDADD = \
|
|||||||
libzpool.la \
|
libzpool.la \
|
||||||
libnvpair.la
|
libnvpair.la
|
||||||
|
|
||||||
PHONY += install-exec-hook
|
cmd-zstream-install-exec-hook:
|
||||||
install-exec-hook:
|
|
||||||
cd $(DESTDIR)$(sbindir) && $(LN_S) -f zstream zstreamdump
|
cd $(DESTDIR)$(sbindir) && $(LN_S) -f zstream zstreamdump
|
||||||
|
|
||||||
|
INSTALL_EXEC_HOOKS += cmd-zstream-install-exec-hook
|
||||||
|
@ -16,10 +16,14 @@ SHELLCHECK_OPTS = $(call JUST_SHELLCHECK_OPTS,$(1)) $(call JUST_CHECKBAS
|
|||||||
|
|
||||||
PHONY += shellcheck
|
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-,,$@))
|
_STGT = $(subst ^,/,$(subst shellcheck-here-,,$@))
|
||||||
shellcheck-here-%:
|
shellcheck-here-%:
|
||||||
if HAVE_SHELLCHECK
|
if HAVE_SHELLCHECK
|
||||||
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_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)"
|
||||||
else
|
else
|
||||||
@echo "skipping shellcheck of" $(_STGT) "because shellcheck is not installed"
|
@echo "skipping shellcheck of" $(_STGT) "because shellcheck is not installed"
|
||||||
endif
|
endif
|
||||||
@ -29,11 +33,15 @@ shellcheck: $(SHELLCHECKSCRIPTS) $(call JUST_SHELLCHECK_OPTS,$(SHELLCHECKSCRIPTS
|
|||||||
|
|
||||||
PHONY += checkbashisms
|
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
|
# command -v *is* specified by POSIX and every shell in existence supports it
|
||||||
_BTGT = $(subst ^,/,$(subst checkbashisms-here-,,$@))
|
_BTGT = $(subst ^,/,$(subst checkbashisms-here-,,$@))
|
||||||
checkbashisms-here-%:
|
checkbashisms-here-%:
|
||||||
if HAVE_CHECKBASHISMS
|
if HAVE_CHECKBASHISMS
|
||||||
! { [ -n "$(SHELLCHECK_SHELL)" ] && echo '#!/bin/$(SHELLCHECK_SHELL)'; cat "$$([ -e "$(_BTGT)" ] || echo "$(srcdir)/")$(_BTGT)"; } | \
|
$(checkbashisms_verbose)! { [ -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
|
checkbashisms -npx 2>&1 | grep -vFe "'command' with option other than -p" -e 'command -v' -e 'any possible bashisms' $(CHECKBASHISMS_IGNORE) >&2
|
||||||
else
|
else
|
||||||
@echo "skipping checkbashisms of" $(_BTGT) "because checkbashisms is not installed"
|
@echo "skipping checkbashisms of" $(_BTGT) "because checkbashisms is not installed"
|
||||||
|
@ -34,8 +34,26 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_ARCH], [
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
AM_CONDITIONAL([TARGET_CPU_AARCH64], test $TARGET_CPU = aarch64)
|
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_X86_64], test $TARGET_CPU = x86_64)
|
||||||
AM_CONDITIONAL([TARGET_CPU_POWERPC], test $TARGET_CPU = powerpc)
|
AM_CONDITIONAL([TARGET_CPU_POWERPC], test $TARGET_CPU = powerpc)
|
||||||
AM_CONDITIONAL([TARGET_CPU_SPARC64], test $TARGET_CPU = sparc64)
|
AM_CONDITIONAL([TARGET_CPU_SPARC64], test $TARGET_CPU = sparc64)
|
||||||
AM_CONDITIONAL([TARGET_CPU_ARM], test $TARGET_CPU = arm)
|
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,6 +155,34 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH], [
|
|||||||
AC_SUBST([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 #
|
||||||
dnl # Check if cc supports -Wno-clobbered option.
|
dnl # Check if cc supports -Wno-clobbered option.
|
||||||
dnl #
|
dnl #
|
||||||
@ -181,6 +209,27 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED], [
|
|||||||
AC_SUBST([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 #
|
||||||
dnl # Check if cc supports -Wimplicit-fallthrough option.
|
dnl # Check if cc supports -Wimplicit-fallthrough option.
|
||||||
dnl #
|
dnl #
|
||||||
@ -231,19 +280,16 @@ dnl #
|
|||||||
dnl # Check if kernel cc supports -Winfinite-recursion option.
|
dnl # Check if kernel cc supports -Winfinite-recursion option.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_INFINITE_RECURSION], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_INFINITE_RECURSION], [
|
||||||
AC_MSG_CHECKING([whether $KERNEL_CC supports -Winfinite-recursion])
|
|
||||||
|
|
||||||
saved_cc="$CC"
|
saved_cc="$CC"
|
||||||
saved_flags="$CFLAGS"
|
AS_IF(
|
||||||
CC="gcc"
|
[ test -n "$KERNEL_CC" ], [ CC="$KERNEL_CC" ],
|
||||||
CFLAGS="$CFLAGS -Werror -Winfinite-recursion"
|
[ test -n "$KERNEL_LLVM" ], [ CC="clang" ],
|
||||||
|
[ CC="gcc" ]
|
||||||
|
)
|
||||||
|
AC_MSG_CHECKING([whether $CC supports -Winfinite-recursion])
|
||||||
|
|
||||||
AS_IF([ test -n "$KERNEL_CC" ], [
|
saved_flags="$CFLAGS"
|
||||||
CC="$KERNEL_CC"
|
CFLAGS="$CFLAGS -Werror -Winfinite-recursion"
|
||||||
])
|
|
||||||
AS_IF([ test -n "$KERNEL_LLVM" ], [
|
|
||||||
CC="clang"
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||||
KERNEL_INFINITE_RECURSION=-Winfinite-recursion
|
KERNEL_INFINITE_RECURSION=-Winfinite-recursion
|
||||||
@ -329,19 +375,16 @@ dnl #
|
|||||||
dnl # Check if kernel cc supports -fno-ipa-sra option.
|
dnl # Check if kernel cc supports -fno-ipa-sra option.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA], [
|
||||||
AC_MSG_CHECKING([whether $KERNEL_CC supports -fno-ipa-sra])
|
|
||||||
|
|
||||||
saved_cc="$CC"
|
saved_cc="$CC"
|
||||||
saved_flags="$CFLAGS"
|
AS_IF(
|
||||||
CC="gcc"
|
[ test -n "$KERNEL_CC" ], [ CC="$KERNEL_CC" ],
|
||||||
CFLAGS="$CFLAGS -Werror -fno-ipa-sra"
|
[ test -n "$KERNEL_LLVM" ], [ CC="clang" ],
|
||||||
|
[ CC="gcc" ]
|
||||||
|
)
|
||||||
|
AC_MSG_CHECKING([whether $CC supports -fno-ipa-sra])
|
||||||
|
|
||||||
AS_IF([ test -n "$KERNEL_CC" ], [
|
saved_flags="$CFLAGS"
|
||||||
CC="$KERNEL_CC"
|
CFLAGS="$CFLAGS -Werror -fno-ipa-sra"
|
||||||
])
|
|
||||||
AS_IF([ test -n "$KERNEL_LLVM" ], [
|
|
||||||
CC="clang"
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||||
KERNEL_NO_IPA_SRA=-fno-ipa-sra
|
KERNEL_NO_IPA_SRA=-fno-ipa-sra
|
||||||
|
@ -29,9 +29,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH_4ARG], [
|
|||||||
const char *path = "path";
|
const char *path = "path";
|
||||||
fmode_t mode = 0;
|
fmode_t mode = 0;
|
||||||
void *holder = NULL;
|
void *holder = NULL;
|
||||||
struct blk_holder_ops h;
|
|
||||||
|
|
||||||
bdev = blkdev_get_by_path(path, mode, holder, &h);
|
bdev = blkdev_get_by_path(path, mode, holder, NULL);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -48,9 +47,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_OPEN_BY_PATH], [
|
|||||||
const char *path = "path";
|
const char *path = "path";
|
||||||
fmode_t mode = 0;
|
fmode_t mode = 0;
|
||||||
void *holder = NULL;
|
void *holder = NULL;
|
||||||
struct blk_holder_ops h;
|
|
||||||
|
|
||||||
bdh = bdev_open_by_path(path, mode, holder, &h);
|
bdh = bdev_open_by_path(path, mode, holder, NULL);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -68,9 +66,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_FILE_OPEN_BY_PATH], [
|
|||||||
const char *path = "path";
|
const char *path = "path";
|
||||||
fmode_t mode = 0;
|
fmode_t mode = 0;
|
||||||
void *holder = NULL;
|
void *holder = NULL;
|
||||||
struct blk_holder_ops h;
|
|
||||||
|
|
||||||
file = bdev_file_open_by_path(path, mode, holder, &h);
|
file = bdev_file_open_by_path(path, mode, holder, NULL);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -24,6 +24,9 @@ dnl #
|
|||||||
dnl # 2.6.38 API change
|
dnl # 2.6.38 API change
|
||||||
dnl # Added d_set_d_op() helper function.
|
dnl # Added d_set_d_op() helper function.
|
||||||
dnl #
|
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], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_SET_D_OP], [
|
||||||
ZFS_LINUX_TEST_SRC([d_set_d_op], [
|
ZFS_LINUX_TEST_SRC([d_set_d_op], [
|
||||||
#include <linux/dcache.h>
|
#include <linux/dcache.h>
|
||||||
@ -34,22 +37,46 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_D_SET_D_OP], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
|
AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
|
||||||
AC_MSG_CHECKING([whether d_set_d_op() is available])
|
AC_MSG_CHECKING([whether d_set_d_op() is available])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([d_set_d_op],
|
ZFS_LINUX_TEST_RESULT([d_set_d_op], [
|
||||||
[d_set_d_op], [fs/dcache.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_D_SET_D_OP, 1,
|
||||||
|
[Define if d_set_d_op() is available])
|
||||||
], [
|
], [
|
||||||
ZFS_LINUX_TEST_ERROR([d_set_d_op])
|
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)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
|
||||||
ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
|
ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
|
||||||
ZFS_AC_KERNEL_SRC_D_SET_D_OP
|
ZFS_AC_KERNEL_SRC_D_SET_D_OP
|
||||||
ZFS_AC_KERNEL_SRC_S_D_OP
|
ZFS_AC_KERNEL_SRC_SET_DEFAULT_D_OP
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
|
AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
|
||||||
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
||||||
ZFS_AC_KERNEL_D_SET_D_OP
|
ZFS_AC_KERNEL_D_SET_D_OP
|
||||||
ZFS_AC_KERNEL_S_D_OP
|
ZFS_AC_KERNEL_SET_DEFAULT_D_OP
|
||||||
])
|
])
|
||||||
|
@ -70,6 +70,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_COMMIT_METADATA
|
ZFS_AC_KERNEL_SRC_COMMIT_METADATA
|
||||||
ZFS_AC_KERNEL_SRC_SETATTR_PREPARE
|
ZFS_AC_KERNEL_SRC_SETATTR_PREPARE
|
||||||
ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED
|
ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED
|
||||||
|
ZFS_AC_KERNEL_SRC_DENTRY
|
||||||
ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
|
ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
|
||||||
ZFS_AC_KERNEL_SRC_SECURITY_INODE
|
ZFS_AC_KERNEL_SRC_SECURITY_INODE
|
||||||
ZFS_AC_KERNEL_SRC_FST_MOUNT
|
ZFS_AC_KERNEL_SRC_FST_MOUNT
|
||||||
@ -188,6 +189,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_COMMIT_METADATA
|
ZFS_AC_KERNEL_COMMIT_METADATA
|
||||||
ZFS_AC_KERNEL_SETATTR_PREPARE
|
ZFS_AC_KERNEL_SETATTR_PREPARE
|
||||||
ZFS_AC_KERNEL_INSERT_INODE_LOCKED
|
ZFS_AC_KERNEL_INSERT_INODE_LOCKED
|
||||||
|
ZFS_AC_KERNEL_DENTRY
|
||||||
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
|
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
|
||||||
ZFS_AC_KERNEL_SECURITY_INODE
|
ZFS_AC_KERNEL_SECURITY_INODE
|
||||||
ZFS_AC_KERNEL_FST_MOUNT
|
ZFS_AC_KERNEL_FST_MOUNT
|
||||||
|
@ -2,7 +2,7 @@ dnl #
|
|||||||
dnl # Check for statx() function and STATX_MNT_ID availability
|
dnl # Check for statx() function and STATX_MNT_ID availability
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
||||||
AC_CHECK_HEADERS([linux/stat.h],
|
AC_CHECK_HEADERS([sys/stat.h],
|
||||||
[have_stat_headers=yes],
|
[have_stat_headers=yes],
|
||||||
[have_stat_headers=no])
|
[have_stat_headers=no])
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
|||||||
AC_MSG_CHECKING([for STATX_MNT_ID])
|
AC_MSG_CHECKING([for STATX_MNT_ID])
|
||||||
AC_COMPILE_IFELSE([
|
AC_COMPILE_IFELSE([
|
||||||
AC_LANG_PROGRAM([[
|
AC_LANG_PROGRAM([[
|
||||||
#include <linux/stat.h>
|
#include <sys/stat.h>
|
||||||
]], [[
|
]], [[
|
||||||
struct statx stx;
|
struct statx stx;
|
||||||
int mask = STATX_MNT_ID;
|
int mask = STATX_MNT_ID;
|
||||||
@ -29,6 +29,6 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
], [
|
], [
|
||||||
AC_MSG_WARN([linux/stat.h not found; skipping statx support])
|
AC_MSG_WARN([sys/stat.h not found; skipping statx support])
|
||||||
])
|
])
|
||||||
]) dnl end AC_DEFUN
|
]) dnl end AC_DEFUN
|
||||||
|
@ -252,10 +252,12 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
|||||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED
|
ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION
|
ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION
|
||||||
ZFS_AC_CONFIG_ALWAYS_KERNEL_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_IMPLICIT_FALLTHROUGH
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
|
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
|
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH
|
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_FORMAT_OVERFLOW
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER
|
ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER
|
||||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA
|
ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA
|
||||||
@ -265,6 +267,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
|||||||
ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD
|
ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD
|
||||||
ZFS_AC_CONFIG_ALWAYS_SYSTEM
|
ZFS_AC_CONFIG_ALWAYS_SYSTEM
|
||||||
ZFS_AC_CONFIG_ALWAYS_ARCH
|
ZFS_AC_CONFIG_ALWAYS_ARCH
|
||||||
|
ZFS_AC_CONFIG_CHECK_ARCH_VAR
|
||||||
ZFS_AC_CONFIG_ALWAYS_PYTHON
|
ZFS_AC_CONFIG_ALWAYS_PYTHON
|
||||||
ZFS_AC_CONFIG_ALWAYS_PYZFS
|
ZFS_AC_CONFIG_ALWAYS_PYZFS
|
||||||
ZFS_AC_CONFIG_ALWAYS_SED
|
ZFS_AC_CONFIG_ALWAYS_SED
|
||||||
|
@ -4,7 +4,7 @@ The detailed contributor information can be found in [2][3].
|
|||||||
|
|
||||||
Files: contrib/debian/*
|
Files: contrib/debian/*
|
||||||
Copyright:
|
Copyright:
|
||||||
2013-2016, Aron Xu <aron@debian.org>
|
2013-2025, Aron Xu <aron@debian.org>
|
||||||
2016, Petter Reinholdtsen <pere@hungry.com>
|
2016, Petter Reinholdtsen <pere@hungry.com>
|
||||||
2013, Carlos Alberto Lopez Perez <clopez@igalia.com>
|
2013, Carlos Alberto Lopez Perez <clopez@igalia.com>
|
||||||
2013, Turbo Fredriksson <turbo@bayour.com>
|
2013, Turbo Fredriksson <turbo@bayour.com>
|
||||||
@ -12,6 +12,8 @@ Copyright:
|
|||||||
2011-2013, Darik Horn <dajhorn@vanadac.com>
|
2011-2013, Darik Horn <dajhorn@vanadac.com>
|
||||||
2018-2019, Mo Zhou <cdluminate@gmail.com>
|
2018-2019, Mo Zhou <cdluminate@gmail.com>
|
||||||
2018-2020, Mo Zhou <lumin@debian.org>
|
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+
|
License: GPL-2+
|
||||||
|
|
||||||
[1] https://tracker.debian.org/pkg/zfs-linux
|
[1] https://tracker.debian.org/pkg/zfs-linux
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
usr/bin/arc_summary.py
|
usr/bin/zarcsummary.py
|
||||||
usr/share/zfs/zfs-helpers.sh
|
usr/share/zfs/zfs-helpers.sh
|
||||||
etc/default/zfs
|
etc/default/zfs
|
||||||
etc/init.d
|
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.sas_switch.example
|
||||||
etc/zfs/vdev_id.conf.scsi.example
|
etc/zfs/vdev_id.conf.scsi.example
|
||||||
etc/zfs/zfs-functions
|
etc/zfs/zfs-functions
|
||||||
lib/systemd/system/zfs-import.service
|
usr/lib/systemd/system/zfs-import.service
|
||||||
|
@ -1 +1 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*
|
usr/lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
lib/*/security/pam_zfs_key.so
|
usr/lib/*/security/pam_zfs_key.so
|
||||||
usr/share/pam-configs/zfs_key
|
usr/share/pam-configs/zfs_key
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if ! $(ldd "/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security/pam_zfs_key.so" | grep -q "libasan") ; then
|
if ! $(ldd "/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security/pam_zfs_key.so" | grep -q "libasan") ; then
|
||||||
pam-auth-update --package
|
pam-auth-update --package
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/libuutil.so.*
|
usr/lib/@DEB_HOST_MULTIARCH@/libuutil.so.*
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/*.a usr/lib/@DEB_HOST_MULTIARCH@
|
usr/lib/@DEB_HOST_MULTIARCH@/*.a
|
||||||
|
usr/lib/@DEB_HOST_MULTIARCH@/*.so
|
||||||
|
usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig
|
||||||
usr/include
|
usr/include
|
||||||
usr/lib/@DEB_HOST_MULTIARCH@
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/libzfs.so.*
|
usr/lib/@DEB_HOST_MULTIARCH@/libzfs.so.*
|
||||||
lib/@DEB_HOST_MULTIARCH@/libzfs_core.so.*
|
usr/lib/@DEB_HOST_MULTIARCH@/libzfs_core.so.*
|
||||||
|
@ -1 +1 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*
|
usr/lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*
|
||||||
|
@ -1 +1 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
|
usr/lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
sbin/ztest
|
usr/sbin/ztest
|
||||||
usr/bin/raidz_test
|
usr/bin/raidz_test
|
||||||
usr/share/man/man1/raidz_test.1
|
usr/share/man/man1/raidz_test.1
|
||||||
usr/share/man/man1/test-runner.1
|
usr/share/man/man1/test-runner.1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
etc/zfs/zed.d/*
|
etc/zfs/zed.d/*
|
||||||
lib/systemd/system/zfs-zed.service
|
usr/lib/systemd/system/zfs-zed.service
|
||||||
usr/lib/zfs-linux/zed.d/*
|
usr/lib/zfs-linux/zed.d/*
|
||||||
usr/sbin/zed
|
usr/sbin/zed
|
||||||
usr/share/man/man8/zed.8
|
usr/share/man/man8/zed.8
|
||||||
|
@ -1,48 +1,48 @@
|
|||||||
etc/default/zfs
|
etc/default/zfs
|
||||||
etc/zfs/zfs-functions
|
etc/zfs/zfs-functions
|
||||||
etc/zfs/zpool.d/
|
etc/zfs/zpool.d/
|
||||||
lib/systemd/system-generators/
|
usr/lib/systemd/system-generators/
|
||||||
lib/systemd/system-preset/
|
usr/lib/systemd/system-preset/
|
||||||
lib/systemd/system/zfs-import-cache.service
|
usr/lib/systemd/system/zfs-import-cache.service
|
||||||
lib/systemd/system/zfs-import-scan.service
|
usr/lib/systemd/system/zfs-import-scan.service
|
||||||
lib/systemd/system/zfs-import.target
|
usr/lib/systemd/system/zfs-import.target
|
||||||
lib/systemd/system/zfs-load-key.service
|
usr/lib/systemd/system/zfs-load-key.service
|
||||||
lib/systemd/system/zfs-mount.service
|
usr/lib/systemd/system/zfs-mount.service
|
||||||
lib/systemd/system/zfs-mount@.service
|
usr/lib/systemd/system/zfs-mount@.service
|
||||||
lib/systemd/system/zfs-scrub-monthly@.timer
|
usr/lib/systemd/system/zfs-scrub-monthly@.timer
|
||||||
lib/systemd/system/zfs-scrub-weekly@.timer
|
usr/lib/systemd/system/zfs-scrub-weekly@.timer
|
||||||
lib/systemd/system/zfs-scrub@.service
|
usr/lib/systemd/system/zfs-scrub@.service
|
||||||
lib/systemd/system/zfs-trim-monthly@.timer
|
usr/lib/systemd/system/zfs-trim-monthly@.timer
|
||||||
lib/systemd/system/zfs-trim-weekly@.timer
|
usr/lib/systemd/system/zfs-trim-weekly@.timer
|
||||||
lib/systemd/system/zfs-trim@.service
|
usr/lib/systemd/system/zfs-trim@.service
|
||||||
lib/systemd/system/zfs-share.service
|
usr/lib/systemd/system/zfs-share.service
|
||||||
lib/systemd/system/zfs-volume-wait.service
|
usr/lib/systemd/system/zfs-volume-wait.service
|
||||||
lib/systemd/system/zfs-volumes.target
|
usr/lib/systemd/system/zfs-volumes.target
|
||||||
lib/systemd/system/zfs.target
|
usr/lib/systemd/system/zfs.target
|
||||||
lib/udev/
|
usr/lib/udev/
|
||||||
sbin/fsck.zfs
|
usr/sbin/fsck.zfs
|
||||||
sbin/mount.zfs
|
usr/sbin/mount.zfs
|
||||||
sbin/zdb
|
usr/sbin/zdb
|
||||||
sbin/zfs
|
usr/sbin/zfs
|
||||||
sbin/zfs_ids_to_path
|
usr/sbin/zfs_ids_to_path
|
||||||
sbin/zgenhostid
|
usr/sbin/zgenhostid
|
||||||
sbin/zhack
|
usr/sbin/zhack
|
||||||
sbin/zinject
|
usr/sbin/zinject
|
||||||
sbin/zpool
|
usr/sbin/zpool
|
||||||
sbin/zstream
|
usr/sbin/zstream
|
||||||
sbin/zstreamdump
|
usr/sbin/zstreamdump
|
||||||
usr/bin/zvol_wait
|
usr/bin/zvol_wait
|
||||||
usr/lib/modules-load.d/ lib/
|
usr/lib/modules-load.d/
|
||||||
usr/lib/zfs-linux/zpool.d/
|
usr/lib/zfs-linux/zpool.d/
|
||||||
usr/lib/zfs-linux/zpool_influxdb
|
usr/lib/zfs-linux/zpool_influxdb
|
||||||
usr/lib/zfs-linux/zfs_prepare_disk
|
usr/lib/zfs-linux/zfs_prepare_disk
|
||||||
usr/sbin/arc_summary
|
usr/bin/zarcsummary
|
||||||
usr/sbin/arcstat
|
usr/bin/zarcstat
|
||||||
usr/sbin/dbufstat
|
usr/bin/dbufstat usr/sbin
|
||||||
usr/sbin/zilstat
|
usr/bin/zilstat
|
||||||
usr/share/zfs/compatibility.d/
|
usr/share/zfs/compatibility.d/
|
||||||
usr/share/bash-completion/completions
|
usr/share/bash-completion/completions
|
||||||
usr/share/man/man1/arcstat.1
|
usr/share/man/man1/zarcstat.1
|
||||||
usr/share/man/man1/zhack.1
|
usr/share/man/man1/zhack.1
|
||||||
usr/share/man/man1/zvol_wait.1
|
usr/share/man/man1/zvol_wait.1
|
||||||
usr/share/man/man5/
|
usr/share/man/man5/
|
||||||
|
3
contrib/debian/openzfs-zfsutils.links
Normal file
3
contrib/debian/openzfs-zfsutils.links
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
usr/sbin/zfs usr/bin/zfs
|
||||||
|
usr/sbin/zpool usr/bin/zpool
|
||||||
|
usr/lib/zfs-linux/zpool_influxdb usr/bin/zpool_influxdb
|
@ -37,18 +37,19 @@ override_dh_auto_configure:
|
|||||||
@# Build the userland, but don't build the kernel modules.
|
@# Build the userland, but don't build the kernel modules.
|
||||||
dh_auto_configure -- @CFGOPTS@ \
|
dh_auto_configure -- @CFGOPTS@ \
|
||||||
--bindir=/usr/bin \
|
--bindir=/usr/bin \
|
||||||
--sbindir=/sbin \
|
--sbindir=/usr/sbin \
|
||||||
--libdir=/lib/"$(DEB_HOST_MULTIARCH)" \
|
--with-mounthelperdir=/usr/sbin \
|
||||||
--with-udevdir=/lib/udev \
|
--libdir=/usr/lib/"$(DEB_HOST_MULTIARCH)" \
|
||||||
|
--with-udevdir=/usr/lib/udev \
|
||||||
--with-zfsexecdir=/usr/lib/zfs-linux \
|
--with-zfsexecdir=/usr/lib/zfs-linux \
|
||||||
--enable-systemd \
|
--enable-systemd \
|
||||||
--enable-pyzfs \
|
--enable-pyzfs \
|
||||||
--with-python=python3 \
|
--with-python=python3 \
|
||||||
--with-pammoduledir='/lib/$(DEB_HOST_MULTIARCH)/security' \
|
--with-pammoduledir='/usr/lib/$(DEB_HOST_MULTIARCH)/security' \
|
||||||
--with-pkgconfigdir='/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig' \
|
--with-pkgconfigdir='/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig' \
|
||||||
--with-systemdunitdir=/lib/systemd/system \
|
--with-systemdunitdir=/usr/lib/systemd/system \
|
||||||
--with-systemdpresetdir=/lib/systemd/system-preset \
|
--with-systemdpresetdir=/usr/lib/systemd/system-preset \
|
||||||
--with-systemdgeneratordir=/lib/systemd/system-generators \
|
--with-systemdgeneratordir=/usr/lib/systemd/system-generators \
|
||||||
--with-config=user
|
--with-config=user
|
||||||
|
|
||||||
for i in $(wildcard $(CURDIR)/debian/*.install.in) ; do \
|
for i in $(wildcard $(CURDIR)/debian/*.install.in) ; do \
|
||||||
@ -77,19 +78,6 @@ override_dh_auto_install:
|
|||||||
@# Install the utilities.
|
@# Install the utilities.
|
||||||
$(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
|
$(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.
|
@# Install the DKMS source.
|
||||||
@# We only want the files needed to build the modules
|
@# We only want the files needed to build the modules
|
||||||
install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
|
install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
|
||||||
@ -131,11 +119,6 @@ override_dh_auto_install:
|
|||||||
cd '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)'; ./autogen.sh
|
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'
|
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/zfs/zfs-functions'
|
||||||
chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
|
chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
|
||||||
|
|
||||||
@ -159,7 +142,7 @@ override_dh_auto_clean:
|
|||||||
@if test -e META.orig; then mv META.orig META; fi
|
@if test -e META.orig; then mv META.orig META; fi
|
||||||
|
|
||||||
override_dh_install:
|
override_dh_install:
|
||||||
find debian/tmp/lib -name '*.la' -delete
|
find debian/tmp/usr/lib -name '*.la' -delete
|
||||||
dh_install
|
dh_install
|
||||||
|
|
||||||
override_dh_missing:
|
override_dh_missing:
|
||||||
@ -173,8 +156,8 @@ override_dh_installinit:
|
|||||||
dh_installinit -R --name zfs-zed
|
dh_installinit -R --name zfs-zed
|
||||||
|
|
||||||
override_dh_installsystemd:
|
override_dh_installsystemd:
|
||||||
mkdir -p debian/openzfs-zfsutils/lib/systemd/system
|
mkdir -p debian/openzfs-zfsutils/usr/lib/systemd/system
|
||||||
ln -sr /dev/null debian/openzfs-zfsutils/lib/systemd/system/zfs-import.service
|
ln -sr /dev/null debian/openzfs-zfsutils/usr/lib/systemd/system/zfs-import.service
|
||||||
dh_installsystemd --no-stop-on-upgrade -X zfs-zed.service
|
dh_installsystemd --no-stop-on-upgrade -X zfs-zed.service
|
||||||
dh_installsystemd --name zfs-zed
|
dh_installsystemd --name zfs-zed
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
PREREQ="udev"
|
PREREQ="udev"
|
||||||
PREREQ_UDEV_RULES="60-zvol.rules 69-vdev.rules"
|
PREREQ_UDEV_RULES="60-zvol.rules 69-vdev.rules"
|
||||||
COPY_EXEC_LIST="/lib/udev/zvol_id /lib/udev/vdev_id"
|
COPY_EXEC_LIST="/usr/lib/udev/zvol_id /usr/lib/udev/vdev_id"
|
||||||
|
|
||||||
# Generic result code.
|
# Generic result code.
|
||||||
RC=0
|
RC=0
|
||||||
|
@ -16,7 +16,8 @@ depends() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
installkernel() {
|
installkernel() {
|
||||||
instmods -c zfs
|
hostonly='' instmods -c zfs
|
||||||
|
instmods mpt3sas virtio_blk
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
|
@ -8,3 +8,12 @@ fi
|
|||||||
. /usr/share/initramfs-tools/hook-functions
|
. /usr/share/initramfs-tools/hook-functions
|
||||||
|
|
||||||
copy_exec /usr/share/initramfs-tools/zfsunlock /usr/bin/zfsunlock
|
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:
|
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)
|
[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 above kernels versions, the following patches needs to be applied using:
|
When using QAT with the above kernel versions, the following patches need to be applied using:
|
||||||
patch -p1 < _$PATCH_
|
patch -p1 < _$PATCH_
|
||||||
_Where $PATCH refers to the path of the patch in question_
|
_Where $PATCH refers to the path of the patch in question_
|
||||||
|
|
||||||
|
@ -391,7 +391,11 @@ static int
|
|||||||
zfs_key_config_load(pam_handle_t *pamh, zfs_key_config_t *config,
|
zfs_key_config_load(pam_handle_t *pamh, zfs_key_config_t *config,
|
||||||
int argc, const char **argv)
|
int argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
#if defined(__FreeBSD__)
|
||||||
|
config->homes_prefix = strdup("zroot/home");
|
||||||
|
#else
|
||||||
config->homes_prefix = strdup("rpool/home");
|
config->homes_prefix = strdup("rpool/home");
|
||||||
|
#endif
|
||||||
if (config->homes_prefix == NULL) {
|
if (config->homes_prefix == NULL) {
|
||||||
pam_syslog(pamh, LOG_ERR, "strdup failure");
|
pam_syslog(pamh, LOG_ERR, "strdup failure");
|
||||||
return (PAM_SERVICE_ERR);
|
return (PAM_SERVICE_ERR);
|
||||||
|
@ -604,5 +604,4 @@ class RaidzExpansionRunning(ZFSError):
|
|||||||
errno = ZFS_ERR_RAIDZ_EXPAND_IN_PROGRESS
|
errno = ZFS_ERR_RAIDZ_EXPAND_IN_PROGRESS
|
||||||
message = "A raidz device is currently expanding"
|
message = "A raidz device is currently expanding"
|
||||||
|
|
||||||
|
|
||||||
# vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4
|
# vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4
|
||||||
|
@ -4223,7 +4223,7 @@ class _TempPool(object):
|
|||||||
self.getRoot().reset()
|
self.getRoot().reset()
|
||||||
return
|
return
|
||||||
|
|
||||||
# On the Buildbot builders this may fail with "pool is busy"
|
# On the CI builders this may fail with "pool is busy"
|
||||||
# Retry 5 times before raising an error
|
# Retry 5 times before raising an error
|
||||||
retry = 0
|
retry = 0
|
||||||
while True:
|
while True:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
These script were written with the primary intention of being portable and
|
These scripts were written with the primary intention of being portable and
|
||||||
usable on as many systems as possible.
|
usable on as many systems as possible.
|
||||||
|
|
||||||
This is, in practice, usually not possible. But the intention is there.
|
This is, in practice, usually not possible. But the intention is there.
|
||||||
|
@ -62,6 +62,17 @@ typedef longlong_t hrtime_t;
|
|||||||
#define SEC_TO_TICK(sec) ((sec) * hz)
|
#define SEC_TO_TICK(sec) ((sec) * hz)
|
||||||
#define NSEC_TO_TICK(nsec) ((nsec) / (NANOSEC / 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
|
static __inline hrtime_t
|
||||||
gethrtime(void)
|
gethrtime(void)
|
||||||
{
|
{
|
||||||
|
@ -542,24 +542,6 @@ blk_generic_alloc_queue(make_request_fn make_request, int node_id)
|
|||||||
}
|
}
|
||||||
#endif /* !HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */
|
#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
|
static inline int
|
||||||
io_is_flush(struct bio *bio, struct request *rq)
|
io_is_flush(struct bio *bio, struct request *rq)
|
||||||
{
|
{
|
||||||
|
@ -60,32 +60,6 @@
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#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
|
* Walk and invalidate all dentry aliases of an inode
|
||||||
* unless it's a mountpoint
|
* 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.
|
* The Linux rwsem implementation does not require a matching destroy.
|
||||||
*/
|
*/
|
||||||
#define rw_destroy(rwp) ((void) 0)
|
#define rw_destroy(rwp) ASSERT(!(RW_LOCK_HELD(rwp)))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Upgrading a rwsem from a reader to a writer is not supported by the
|
* Upgrading a rwsem from a reader to a writer is not supported by the
|
||||||
|
@ -25,6 +25,6 @@
|
|||||||
#ifndef _SPL_STAT_H
|
#ifndef _SPL_STAT_H
|
||||||
#define _SPL_STAT_H
|
#define _SPL_STAT_H
|
||||||
|
|
||||||
#include <linux/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#endif /* SPL_STAT_H */
|
#endif /* SPL_STAT_H */
|
||||||
|
@ -79,6 +79,14 @@ gethrestime_sec(void)
|
|||||||
return (ts.tv_sec);
|
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
|
static inline hrtime_t
|
||||||
gethrtime(void)
|
gethrtime(void)
|
||||||
{
|
{
|
||||||
|
@ -55,6 +55,7 @@ extern const struct file_operations zpl_dir_file_operations;
|
|||||||
extern void zpl_prune_sb(uint64_t nr_to_scan, void *arg);
|
extern void zpl_prune_sb(uint64_t nr_to_scan, void *arg);
|
||||||
|
|
||||||
extern const struct super_operations zpl_super_operations;
|
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 const struct export_operations zpl_export_operations;
|
||||||
extern struct file_system_type zpl_fs_type;
|
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_ZPOOL_CHECKPOINT "com.delphix:zpool_checkpoint"
|
||||||
#define DMU_POOL_LOG_SPACEMAP_ZAP "com.delphix:log_spacemap_zap"
|
#define DMU_POOL_LOG_SPACEMAP_ZAP "com.delphix:log_spacemap_zap"
|
||||||
#define DMU_POOL_DELETED_CLONES "com.delphix:deleted_clones"
|
#define DMU_POOL_DELETED_CLONES "com.delphix:deleted_clones"
|
||||||
#define DMU_POOL_TXG_LOG_TIME_MINUTES "com.klaraystems:txg_log_time:minutes"
|
#define DMU_POOL_TXG_LOG_TIME_MINUTES "com.klarasystems:txg_log_time:minutes"
|
||||||
#define DMU_POOL_TXG_LOG_TIME_DAYS "com.klaraystems:txg_log_time:days"
|
#define DMU_POOL_TXG_LOG_TIME_DAYS "com.klarasystems:txg_log_time:days"
|
||||||
#define DMU_POOL_TXG_LOG_TIME_MONTHS "com.klaraystems:txg_log_time:months"
|
#define DMU_POOL_TXG_LOG_TIME_MONTHS "com.klarasystems:txg_log_time:months"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate an object from this objset. The range of object numbers
|
* Allocate an object from this objset. The range of object numbers
|
||||||
|
@ -46,6 +46,7 @@ extern "C" {
|
|||||||
#define ZFS_DELEG_PERM_MOUNT "mount"
|
#define ZFS_DELEG_PERM_MOUNT "mount"
|
||||||
#define ZFS_DELEG_PERM_SHARE "share"
|
#define ZFS_DELEG_PERM_SHARE "share"
|
||||||
#define ZFS_DELEG_PERM_SEND "send"
|
#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 "receive"
|
||||||
#define ZFS_DELEG_PERM_RECEIVE_APPEND "receive:append"
|
#define ZFS_DELEG_PERM_RECEIVE_APPEND "receive:append"
|
||||||
#define ZFS_DELEG_PERM_ALLOW "allow"
|
#define ZFS_DELEG_PERM_ALLOW "allow"
|
||||||
|
@ -58,6 +58,7 @@ extern "C" {
|
|||||||
#define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure"
|
#define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure"
|
||||||
#define FM_EREPORT_ZFS_LOG_REPLAY "log_replay"
|
#define FM_EREPORT_ZFS_LOG_REPLAY "log_replay"
|
||||||
#define FM_EREPORT_ZFS_CONFIG_CACHE_WRITE "config_cache_write"
|
#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 "pool"
|
||||||
#define FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE "pool_failmode"
|
#define FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE "pool_failmode"
|
||||||
|
@ -385,6 +385,8 @@ typedef enum {
|
|||||||
VDEV_PROP_TRIM_SUPPORT,
|
VDEV_PROP_TRIM_SUPPORT,
|
||||||
VDEV_PROP_TRIM_ERRORS,
|
VDEV_PROP_TRIM_ERRORS,
|
||||||
VDEV_PROP_SLOW_IOS,
|
VDEV_PROP_SLOW_IOS,
|
||||||
|
VDEV_PROP_SIT_OUT,
|
||||||
|
VDEV_PROP_AUTOSIT,
|
||||||
VDEV_NUM_PROPS
|
VDEV_NUM_PROPS
|
||||||
} vdev_prop_t;
|
} vdev_prop_t;
|
||||||
|
|
||||||
@ -746,6 +748,8 @@ typedef struct zpool_load_policy {
|
|||||||
#define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift"
|
#define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift"
|
||||||
#define ZPOOL_CONFIG_ASHIFT "ashift"
|
#define ZPOOL_CONFIG_ASHIFT "ashift"
|
||||||
#define ZPOOL_CONFIG_ASIZE "asize"
|
#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_DTL "DTL"
|
||||||
#define ZPOOL_CONFIG_SCAN_STATS "scan_stats" /* not stored on disk */
|
#define ZPOOL_CONFIG_SCAN_STATS "scan_stats" /* not stored on disk */
|
||||||
#define ZPOOL_CONFIG_REMOVAL_STATS "removal_stats" /* not stored on disk */
|
#define ZPOOL_CONFIG_REMOVAL_STATS "removal_stats" /* not stored on disk */
|
||||||
@ -1673,6 +1677,7 @@ typedef enum {
|
|||||||
ZFS_ERR_RAIDZ_EXPAND_IN_PROGRESS,
|
ZFS_ERR_RAIDZ_EXPAND_IN_PROGRESS,
|
||||||
ZFS_ERR_ASHIFT_MISMATCH,
|
ZFS_ERR_ASHIFT_MISMATCH,
|
||||||
ZFS_ERR_STREAM_LARGE_MICROZAP,
|
ZFS_ERR_STREAM_LARGE_MICROZAP,
|
||||||
|
ZFS_ERR_TOO_MANY_SITOUTS,
|
||||||
} zfs_errno_t;
|
} zfs_errno_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -238,8 +238,7 @@ zfs_rs_set_end_raw(zfs_range_seg_t *rs, zfs_range_tree_t *rt, uint64_t end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
zfs_zfs_rs_set_fill_raw(zfs_range_seg_t *rs, zfs_range_tree_t *rt,
|
zfs_rs_set_fill_raw(zfs_range_seg_t *rs, zfs_range_tree_t *rt, uint64_t fill)
|
||||||
uint64_t fill)
|
|
||||||
{
|
{
|
||||||
ASSERT3U(rt->rt_type, <=, ZFS_RANGE_SEG_NUM_TYPES);
|
ASSERT3U(rt->rt_type, <=, ZFS_RANGE_SEG_NUM_TYPES);
|
||||||
switch (rt->rt_type) {
|
switch (rt->rt_type) {
|
||||||
@ -277,7 +276,7 @@ static inline void
|
|||||||
zfs_rs_set_fill(zfs_range_seg_t *rs, zfs_range_tree_t *rt, uint64_t fill)
|
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));
|
ASSERT(IS_P2ALIGNED(fill, 1ULL << rt->rt_shift));
|
||||||
zfs_zfs_rs_set_fill_raw(rs, rt, fill >> rt->rt_shift);
|
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);
|
typedef void zfs_range_tree_func_t(void *arg, uint64_t start, uint64_t size);
|
||||||
|
@ -1084,6 +1084,7 @@ extern pool_state_t spa_state(spa_t *spa);
|
|||||||
extern spa_load_state_t spa_load_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_freeze_txg(spa_t *spa);
|
||||||
extern uint64_t spa_get_worst_case_asize(spa_t *spa, uint64_t lsize);
|
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_dspace(spa_t *spa);
|
||||||
extern uint64_t spa_get_checkpoint_space(spa_t *spa);
|
extern uint64_t spa_get_checkpoint_space(spa_t *spa);
|
||||||
extern uint64_t spa_get_slop_space(spa_t *spa);
|
extern uint64_t spa_get_slop_space(spa_t *spa);
|
||||||
|
@ -265,6 +265,7 @@ struct spa {
|
|||||||
uint64_t spa_min_ashift; /* of vdevs in normal class */
|
uint64_t spa_min_ashift; /* of vdevs in normal class */
|
||||||
uint64_t spa_max_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_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_gcd_alloc; /* of vdevs in normal class */
|
||||||
uint64_t spa_config_guid; /* config pool guid */
|
uint64_t spa_config_guid; /* config pool guid */
|
||||||
uint64_t spa_load_guid; /* spa_load initialized guid */
|
uint64_t spa_load_guid; /* spa_load initialized guid */
|
||||||
|
@ -279,10 +279,12 @@ struct vdev {
|
|||||||
uint64_t vdev_noalloc; /* device is passivated? */
|
uint64_t vdev_noalloc; /* device is passivated? */
|
||||||
uint64_t vdev_removing; /* device is being removed? */
|
uint64_t vdev_removing; /* device is being removed? */
|
||||||
uint64_t vdev_failfast; /* device failfast setting */
|
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_rz_expanding; /* raidz is being expanded? */
|
||||||
boolean_t vdev_ishole; /* is a hole in the namespace */
|
boolean_t vdev_ishole; /* is a hole in the namespace */
|
||||||
uint64_t vdev_top_zap;
|
uint64_t vdev_top_zap;
|
||||||
vdev_alloc_bias_t vdev_alloc_bias; /* metaslab allocation bias */
|
vdev_alloc_bias_t vdev_alloc_bias; /* metaslab allocation bias */
|
||||||
|
uint64_t vdev_last_latency_check;
|
||||||
|
|
||||||
/* pool checkpoint related */
|
/* pool checkpoint related */
|
||||||
space_map_t *vdev_checkpoint_sm; /* contains reserved blocks */
|
space_map_t *vdev_checkpoint_sm; /* contains reserved blocks */
|
||||||
@ -431,6 +433,10 @@ struct vdev {
|
|||||||
hrtime_t vdev_mmp_pending; /* 0 if write finished */
|
hrtime_t vdev_mmp_pending; /* 0 if write finished */
|
||||||
uint64_t vdev_mmp_kstat_id; /* to find kstat entry */
|
uint64_t vdev_mmp_kstat_id; /* to find kstat entry */
|
||||||
uint64_t vdev_expansion_time; /* vdev's last expansion time */
|
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 */
|
list_node_t vdev_leaf_node; /* leaf vdev list */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -61,6 +61,9 @@ void vdev_raidz_checksum_error(zio_t *, struct raidz_col *, abd_t *);
|
|||||||
struct raidz_row *vdev_raidz_row_alloc(int, zio_t *);
|
struct raidz_row *vdev_raidz_row_alloc(int, zio_t *);
|
||||||
void vdev_raidz_reflow_copy_scratch(spa_t *);
|
void vdev_raidz_reflow_copy_scratch(spa_t *);
|
||||||
void raidz_dtl_reassessed(vdev_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;
|
extern const zio_vsd_ops_t vdev_raidz_vsd_ops;
|
||||||
|
|
||||||
|
@ -119,6 +119,7 @@ typedef struct raidz_col {
|
|||||||
uint8_t rc_need_orig_restore:1; /* need to restore from orig_data? */
|
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_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_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_devidx; /* for double write during expansion */
|
||||||
int rc_shadow_error; /* for double write during expansion */
|
int rc_shadow_error; /* for double write during expansion */
|
||||||
uint64_t rc_shadow_offset; /* for double write during expansion */
|
uint64_t rc_shadow_offset; /* for double write during expansion */
|
||||||
@ -133,6 +134,7 @@ typedef struct raidz_row {
|
|||||||
int rr_firstdatacol; /* First data column/parity count */
|
int rr_firstdatacol; /* First data column/parity count */
|
||||||
abd_t *rr_abd_empty; /* dRAID empty sector buffer */
|
abd_t *rr_abd_empty; /* dRAID empty sector buffer */
|
||||||
int rr_nempty; /* empty sectors included in parity */
|
int rr_nempty; /* empty sectors included in parity */
|
||||||
|
int rr_outlier_cnt; /* Count of latency outlier devices */
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
uint64_t rr_offset; /* Logical offset for *_io_verify() */
|
uint64_t rr_offset; /* Logical offset for *_io_verify() */
|
||||||
uint64_t rr_size; /* Physical size 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_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,
|
int zfs_file_pwrite(zfs_file_t *fp, const void *buf, size_t len, loff_t off,
|
||||||
ssize_t *resid);
|
uint8_t ashift, ssize_t *resid);
|
||||||
int zfs_file_read(zfs_file_t *fp, void *buf, size_t len, 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,
|
int zfs_file_pread(zfs_file_t *fp, void *buf, size_t len, loff_t off,
|
||||||
ssize_t *resid);
|
ssize_t *resid);
|
||||||
|
@ -455,6 +455,7 @@ typedef enum zinject_type {
|
|||||||
ZINJECT_DECRYPT_FAULT,
|
ZINJECT_DECRYPT_FAULT,
|
||||||
ZINJECT_DELAY_IMPORT,
|
ZINJECT_DELAY_IMPORT,
|
||||||
ZINJECT_DELAY_EXPORT,
|
ZINJECT_DELAY_EXPORT,
|
||||||
|
ZINJECT_DELAY_READY,
|
||||||
} zinject_type_t;
|
} zinject_type_t;
|
||||||
|
|
||||||
typedef enum zinject_iotype {
|
typedef enum zinject_iotype {
|
||||||
|
@ -82,7 +82,8 @@ gbh_nblkptrs(uint64_t size) {
|
|||||||
static inline zio_eck_t *
|
static inline zio_eck_t *
|
||||||
gbh_eck(zio_gbh_phys_t *gbh, uint64_t size) {
|
gbh_eck(zio_gbh_phys_t *gbh, uint64_t size) {
|
||||||
ASSERT(IS_P2ALIGNED(size, sizeof (blkptr_t)));
|
ASSERT(IS_P2ALIGNED(size, sizeof (blkptr_t)));
|
||||||
return ((zio_eck_t *)((uintptr_t)gbh + size - sizeof (zio_eck_t)));
|
return ((zio_eck_t *)((uintptr_t)gbh + (size_t)size -
|
||||||
|
sizeof (zio_eck_t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline blkptr_t *
|
static inline blkptr_t *
|
||||||
@ -717,6 +718,7 @@ extern void zio_handle_ignored_writes(zio_t *zio);
|
|||||||
extern hrtime_t zio_handle_io_delay(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_import_delay(spa_t *spa, hrtime_t elapsed);
|
||||||
extern void zio_handle_export_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
|
* 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_volthreading(const char *, boolean_t);
|
||||||
extern int zvol_set_common(const char *, zfs_prop_t, zprop_source_t, uint64_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_set_ro(const char *, boolean_t);
|
||||||
extern zvol_state_handle_t *zvol_suspend(const char *);
|
extern int zvol_suspend(const char *, zvol_state_handle_t **);
|
||||||
extern int zvol_resume(zvol_state_handle_t *);
|
extern int zvol_resume(zvol_state_handle_t *);
|
||||||
extern void *zvol_tag(zvol_state_handle_t *);
|
extern void *zvol_tag(zvol_state_handle_t *);
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ typedef enum {
|
|||||||
ZFS_DELEG_NOTE_PROMOTE,
|
ZFS_DELEG_NOTE_PROMOTE,
|
||||||
ZFS_DELEG_NOTE_RENAME,
|
ZFS_DELEG_NOTE_RENAME,
|
||||||
ZFS_DELEG_NOTE_SEND,
|
ZFS_DELEG_NOTE_SEND,
|
||||||
|
ZFS_DELEG_NOTE_SEND_RAW,
|
||||||
ZFS_DELEG_NOTE_RECEIVE,
|
ZFS_DELEG_NOTE_RECEIVE,
|
||||||
ZFS_DELEG_NOTE_ALLOW,
|
ZFS_DELEG_NOTE_ALLOW,
|
||||||
ZFS_DELEG_NOTE_USERPROP,
|
ZFS_DELEG_NOTE_USERPROP,
|
||||||
|
@ -2,6 +2,9 @@ include $(srcdir)/%D%/include/Makefile.am
|
|||||||
|
|
||||||
libspl_assert_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS) $(LIBUNWIND_CFLAGS)
|
libspl_assert_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS) $(LIBUNWIND_CFLAGS)
|
||||||
libspl_la_CFLAGS = $(libspl_assert_la_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
|
noinst_LTLIBRARIES += libspl_assert.la libspl.la
|
||||||
CPPCHECKTARGETS += libspl_assert.la libspl.la
|
CPPCHECKTARGETS += libspl_assert.la libspl.la
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_STATX
|
#ifdef HAVE_STATX
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <linux/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -97,6 +97,15 @@ gethrestime_sec(void)
|
|||||||
return (tv.tv_sec);
|
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
|
static inline hrtime_t
|
||||||
gethrtime(void)
|
gethrtime(void)
|
||||||
{
|
{
|
||||||
|
@ -6117,7 +6117,9 @@
|
|||||||
<enumerator name='VDEV_PROP_TRIM_SUPPORT' value='49'/>
|
<enumerator name='VDEV_PROP_TRIM_SUPPORT' value='49'/>
|
||||||
<enumerator name='VDEV_PROP_TRIM_ERRORS' value='50'/>
|
<enumerator name='VDEV_PROP_TRIM_ERRORS' value='50'/>
|
||||||
<enumerator name='VDEV_PROP_SLOW_IOS' value='51'/>
|
<enumerator name='VDEV_PROP_SLOW_IOS' value='51'/>
|
||||||
<enumerator name='VDEV_NUM_PROPS' value='52'/>
|
<enumerator name='VDEV_PROP_SIT_OUT' value='52'/>
|
||||||
|
<enumerator name='VDEV_PROP_AUTOSIT' value='53'/>
|
||||||
|
<enumerator name='VDEV_NUM_PROPS' value='54'/>
|
||||||
</enum-decl>
|
</enum-decl>
|
||||||
<typedef-decl name='vdev_prop_t' type-id='1573bec8' id='5aa5c90c'/>
|
<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'>
|
<class-decl name='zpool_load_policy' size-in-bits='256' is-struct='yes' visibility='default' id='2f65b36f'>
|
||||||
|
@ -5549,6 +5549,8 @@ zpool_get_vdev_prop_value(nvlist_t *nvprop, vdev_prop_t prop, char *prop_name,
|
|||||||
/* Only use if provided by the RAIDZ VDEV above */
|
/* Only use if provided by the RAIDZ VDEV above */
|
||||||
if (prop == VDEV_PROP_RAIDZ_EXPANDING)
|
if (prop == VDEV_PROP_RAIDZ_EXPANDING)
|
||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
|
if (prop == VDEV_PROP_SIT_OUT)
|
||||||
|
return (ENOENT);
|
||||||
}
|
}
|
||||||
if (vdev_prop_index_to_string(prop, intval,
|
if (vdev_prop_index_to_string(prop, intval,
|
||||||
(const char **)&strval) != 0)
|
(const char **)&strval) != 0)
|
||||||
@ -5718,8 +5720,16 @@ zpool_set_vdev_prop(zpool_handle_t *zhp, const char *vdevname,
|
|||||||
nvlist_free(nvl);
|
nvlist_free(nvl);
|
||||||
nvlist_free(outnvl);
|
nvlist_free(outnvl);
|
||||||
|
|
||||||
if (ret)
|
if (ret) {
|
||||||
(void) zpool_standard_error(zhp->zpool_hdl, errno, errbuf);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
@ -776,6 +776,11 @@ zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
|||||||
case ZFS_ERR_ASHIFT_MISMATCH:
|
case ZFS_ERR_ASHIFT_MISMATCH:
|
||||||
zfs_verror(hdl, EZFS_ASHIFT_MISMATCH, fmt, ap);
|
zfs_verror(hdl, EZFS_ASHIFT_MISMATCH, fmt, ap);
|
||||||
break;
|
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:
|
default:
|
||||||
zfs_error_aux(hdl, "%s", zfs_strerror(error));
|
zfs_error_aux(hdl, "%s", zfs_strerror(error));
|
||||||
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
|
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
|
int
|
||||||
zfs_file_pwrite(zfs_file_t *fp, const void *buf,
|
zfs_file_pwrite(zfs_file_t *fp, const void *buf,
|
||||||
size_t count, loff_t pos, ssize_t *resid)
|
size_t count, loff_t pos, uint8_t ashift, ssize_t *resid)
|
||||||
{
|
{
|
||||||
ssize_t rc, split, done;
|
ssize_t rc, split, done;
|
||||||
int sectors;
|
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.
|
* system calls so that the process can be killed in between.
|
||||||
* This is used by ztest to simulate realistic failure modes.
|
* This is used by ztest to simulate realistic failure modes.
|
||||||
*/
|
*/
|
||||||
sectors = count >> SPA_MINBLOCKSHIFT;
|
sectors = count >> ashift;
|
||||||
split = (sectors > 0 ? rand() % sectors : 0) << SPA_MINBLOCKSHIFT;
|
split = (sectors > 0 ? rand() % sectors : 0) << ashift;
|
||||||
rc = pwrite64(fp->f_fd, buf, split, pos);
|
rc = pwrite64(fp->f_fd, buf, split, pos);
|
||||||
if (rc != -1) {
|
if (rc != -1) {
|
||||||
done = rc;
|
done = rc;
|
||||||
|
@ -2,7 +2,7 @@ dist_noinst_man_MANS = \
|
|||||||
%D%/man1/cstyle.1
|
%D%/man1/cstyle.1
|
||||||
|
|
||||||
dist_man_MANS = \
|
dist_man_MANS = \
|
||||||
%D%/man1/arcstat.1 \
|
%D%/man1/zarcstat.1 \
|
||||||
%D%/man1/raidz_test.1 \
|
%D%/man1/raidz_test.1 \
|
||||||
%D%/man1/test-runner.1 \
|
%D%/man1/test-runner.1 \
|
||||||
%D%/man1/zhack.1 \
|
%D%/man1/zhack.1 \
|
||||||
@ -124,10 +124,21 @@ dist_noinst_DATA += $(dist_noinst_man_MANS) $(dist_man_MANS)
|
|||||||
|
|
||||||
SUBSTFILES += $(nodist_man_MANS)
|
SUBSTFILES += $(nodist_man_MANS)
|
||||||
|
|
||||||
CHECKS += mancheck
|
MANFILES = $(dist_noinst_man_MANS) $(dist_man_MANS) $(nodist_man_MANS)
|
||||||
mancheck:
|
|
||||||
$(top_srcdir)/scripts/mancheck.sh $(srcdir)/%D%
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
if BUILD_LINUX
|
if BUILD_LINUX
|
||||||
# The manual pager in most Linux distros defaults to "BSD" when .Os is blank,
|
# The manual pager in most Linux distros defaults to "BSD" when .Os is blank,
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" CDDL HEADER END
|
.\" CDDL HEADER END
|
||||||
.\"
|
.\"
|
||||||
.Dd May 26, 2021
|
.Dd April 4, 2022
|
||||||
.Dt CSTYLE 1
|
.Dt CSTYLE 1
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user