mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-22 08:51:30 +03:00
Compare commits
282 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c702dda34 | ||
|
|
3dcd071b51 | ||
|
|
46500a0803 | ||
|
|
c629e594e4 | ||
|
|
f83a7864aa | ||
|
|
612d4019f1 | ||
|
|
25327ed7ce | ||
|
|
11647c669e | ||
|
|
a0350f61c4 | ||
|
|
936a98c716 | ||
|
|
e1ade37573 | ||
|
|
fdaec98d4b | ||
|
|
a42bb54050 | ||
|
|
618cfa02ea | ||
|
|
82ed6842ba | ||
|
|
184e9b3cd5 | ||
|
|
c710f87923 | ||
|
|
96ffe51004 | ||
|
|
f2c40b4586 | ||
|
|
e78596e05e | ||
|
|
8a9bbaa7cf | ||
|
|
2328b37eb9 | ||
|
|
8dec2d94b4 | ||
|
|
8e946b5ae8 | ||
|
|
f1321648a5 | ||
|
|
5889b7ce90 | ||
|
|
c62c3aeb13 | ||
|
|
026d4ee1a9 | ||
|
|
f27550e985 | ||
|
|
c54825f7eb | ||
|
|
9ef326b987 | ||
|
|
8a3ff09350 | ||
|
|
bea96d7d4b | ||
|
|
1028571218 | ||
|
|
b86f15d84b | ||
|
|
425691cf59 | ||
|
|
01f089509e | ||
|
|
ddbfd0f2e1 | ||
|
|
c4ad5e2938 | ||
|
|
22b959d2e5 | ||
|
|
23476277c0 | ||
|
|
7c80abdd7c | ||
|
|
79c3810088 | ||
|
|
554a81b20a | ||
|
|
aebbfdb37a | ||
|
|
343cc96d7d | ||
|
|
d69f7c5e9b | ||
|
|
d08e561d0a | ||
|
|
6218a5eb03 | ||
|
|
2c9fec38d0 | ||
|
|
6f7f71825f | ||
|
|
42c2b2d774 | ||
|
|
26fcf5848b | ||
|
|
eaa645be5d | ||
|
|
b1d3b5e567 | ||
|
|
4cc3056c56 | ||
|
|
65e13c33d8 | ||
|
|
8a826c0f68 | ||
|
|
bc3320f0cc | ||
|
|
6a9d7820e6 | ||
|
|
edd3d33433 | ||
|
|
a5d9f233fa | ||
|
|
6ab8f46c6c | ||
|
|
cb1833023f | ||
|
|
2422c1f3b9 | ||
|
|
ccf956c2b3 | ||
|
|
09587c7385 | ||
|
|
35ee242abc | ||
|
|
ccb7c82aa1 | ||
|
|
0de2da6a37 | ||
|
|
8d391531eb | ||
|
|
8dd01181aa | ||
|
|
76871c295a | ||
|
|
96b1d2fae9 | ||
|
|
4ab2027f59 | ||
|
|
4905686e67 | ||
|
|
fa857113a3 | ||
|
|
2428043709 | ||
|
|
135103a648 | ||
|
|
d5724f8f3f | ||
|
|
e865ddad5c | ||
|
|
8a79d09680 | ||
|
|
5e0f20088d | ||
|
|
6482a27e81 | ||
|
|
8dc656b873 | ||
|
|
743334913e | ||
|
|
2143bff328 | ||
|
|
42411327cb | ||
|
|
47319ef7a6 | ||
|
|
0bcbee6040 | ||
|
|
74bbdda1ef | ||
|
|
663dc86de2 | ||
|
|
145c606c60 | ||
|
|
c9845a1332 | ||
|
|
028d66b9dd | ||
|
|
206487b9b1 | ||
|
|
f8572e2a97 | ||
|
|
8c1eaea952 | ||
|
|
25d755e108 | ||
|
|
5946eeb8df | ||
|
|
5e271995d1 | ||
|
|
a2f768f61f | ||
|
|
872266a5f3 | ||
|
|
ed87bc593f | ||
|
|
e1f0baa546 | ||
|
|
071369803e | ||
|
|
6e10a51b74 | ||
|
|
001ce40cd4 | ||
|
|
68c1df8db3 | ||
|
|
a41ef36858 | ||
|
|
a785ddc5f3 | ||
|
|
2aad3dee23 | ||
|
|
cdbe788a39 | ||
|
|
d12eb47d96 | ||
|
|
304810208e | ||
|
|
aa091a17bd | ||
|
|
f45622ff42 | ||
|
|
2e09f166f0 | ||
|
|
c8ecd63acd | ||
|
|
d06ebddee4 | ||
|
|
040c533280 | ||
|
|
099f69ff5d | ||
|
|
7a919fb70c | ||
|
|
5714090fb9 | ||
|
|
5b2489caf2 | ||
|
|
ff536b1538 | ||
|
|
7ebb5e9b3f | ||
|
|
1e8c96d7d5 | ||
|
|
41878d57ea | ||
|
|
002bc3da6a | ||
|
|
e895c76194 | ||
|
|
ac0bc4cc00 | ||
|
|
e305c7d596 | ||
|
|
e1734111fd | ||
|
|
aaf374bd40 | ||
|
|
583db40030 | ||
|
|
84dd55510b | ||
|
|
015729a11b | ||
|
|
4fd926ab40 | ||
|
|
7b121388fb | ||
|
|
055e908d47 | ||
|
|
a2a34d9212 | ||
|
|
dda711dbb5 | ||
|
|
be1e5d599b | ||
|
|
612e8f1e57 | ||
|
|
5582e8b08e | ||
|
|
c9835dab1f | ||
|
|
67fc49433f | ||
|
|
e3acd0a728 | ||
|
|
178a8be216 | ||
|
|
29567f13f6 | ||
|
|
e8d2e08345 | ||
|
|
5847626175 | ||
|
|
9a9e06e5dd | ||
|
|
82d59f7666 | ||
|
|
672fea2a50 | ||
|
|
ad6eee2b9b | ||
|
|
f43839e7fd | ||
|
|
814f9afba7 | ||
|
|
6f6e1c90ae | ||
|
|
aeff23939a | ||
|
|
7730109762 | ||
|
|
2778832e22 | ||
|
|
005c631499 | ||
|
|
04d0f83f4e | ||
|
|
49f078997a | ||
|
|
3fb241157f | ||
|
|
799bda73e2 | ||
|
|
b0106a1b74 | ||
|
|
084f8d0077 | ||
|
|
7987d4deb4 | ||
|
|
1956417b54 | ||
|
|
3378a324df | ||
|
|
f16fa115d1 | ||
|
|
f0c76f8a7b | ||
|
|
c1f55bff8b | ||
|
|
f0bff230f9 | ||
|
|
b9356f06ed | ||
|
|
30a3e609a2 | ||
|
|
964dfc3176 | ||
|
|
e4a393cf78 | ||
|
|
e09c86cb1f | ||
|
|
6c73fd8eeb | ||
|
|
9050ecb75c | ||
|
|
cf9163f250 | ||
|
|
250e2ec229 | ||
|
|
968cfc3df2 | ||
|
|
627b530059 | ||
|
|
6809137db5 | ||
|
|
3e7e19e028 | ||
|
|
4c84b77bc4 | ||
|
|
37d8d4619f | ||
|
|
1585a10a85 | ||
|
|
b9d1e28a71 | ||
|
|
01180a63bd | ||
|
|
ead0fb736d | ||
|
|
073b34b3ee | ||
|
|
c0d63f5435 | ||
|
|
2f50d67409 | ||
|
|
0939787e83 | ||
|
|
f3295ec763 | ||
|
|
35ec4b14ab | ||
|
|
abda34b1c0 | ||
|
|
9079f986ae | ||
|
|
a9bcf4faf3 | ||
|
|
ca9b89bd2d | ||
|
|
654a2ccc74 | ||
|
|
ddecc5ff21 | ||
|
|
e1a6ec42d4 | ||
|
|
460858dfd6 | ||
|
|
954fe5e1be | ||
|
|
d33d0cac5a | ||
|
|
9bd8f4379c | ||
|
|
6dad2f61a3 | ||
|
|
61a68554de | ||
|
|
9bcda0b5fe | ||
|
|
2380e0b679 | ||
|
|
83066c9627 | ||
|
|
ef9b7dde91 | ||
|
|
9c6f72021d | ||
|
|
15a6b982c5 | ||
|
|
42b9995f88 | ||
|
|
a056b3c341 | ||
|
|
5f7253ca11 | ||
|
|
e3eb3ca3dc | ||
|
|
d0084a4109 | ||
|
|
4698208c78 | ||
|
|
406f76b7e3 | ||
|
|
1ca4cd8a33 | ||
|
|
8b548776ff | ||
|
|
a4cb155e8d | ||
|
|
53c8d7071d | ||
|
|
da33cfd436 | ||
|
|
efdb4bf07a | ||
|
|
cac483dbd4 | ||
|
|
c9de42e089 | ||
|
|
41c6eaac8b | ||
|
|
b5d41deca9 | ||
|
|
2f41193a26 | ||
|
|
95d677efde | ||
|
|
43a9d9ac57 | ||
|
|
6c4ede4026 | ||
|
|
4a7a04630d | ||
|
|
3dc345851c | ||
|
|
df55ba7c49 | ||
|
|
0df85ec27c | ||
|
|
123bfc32f3 | ||
|
|
177e9d07d0 | ||
|
|
e2e708241a | ||
|
|
26983d6fa7 | ||
|
|
ca4f7d6d49 | ||
|
|
717c57c834 | ||
|
|
743866cd2a | ||
|
|
5bf1500ee3 | ||
|
|
dc53e5c484 | ||
|
|
0df91abe82 | ||
|
|
d469371033 | ||
|
|
87e35bd3ab | ||
|
|
cfd640c3e8 | ||
|
|
b23eae62be | ||
|
|
b727163db9 | ||
|
|
02fa962af0 | ||
|
|
c755aa486d | ||
|
|
34ca2b8392 | ||
|
|
f8e2152db7 | ||
|
|
cbc6d57012 | ||
|
|
e5132a3382 | ||
|
|
b5b6deb985 | ||
|
|
886f29e1f6 | ||
|
|
56e8ab4a3e | ||
|
|
24baccb75e | ||
|
|
92d4b135b6 | ||
|
|
31b9646681 | ||
|
|
04d991dbc4 | ||
|
|
5846a85155 | ||
|
|
8604e67dc9 | ||
|
|
c00c3e33bb | ||
|
|
92579489e0 | ||
|
|
c539d6f211 | ||
|
|
2fc6bf82b6 | ||
|
|
774a34f3ff | ||
|
|
e3392a5e7d |
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. -->
|
||||||
|
|||||||
12
.github/workflows/scripts/generate-ci-type.py
vendored
12
.github/workflows/scripts/generate-ci-type.py
vendored
@ -7,7 +7,7 @@ Prints "quick" if (explicity required by user):
|
|||||||
- the *last* commit message contains 'ZFS-CI-Type: quick'
|
- the *last* commit message contains 'ZFS-CI-Type: quick'
|
||||||
or if (heuristics):
|
or if (heuristics):
|
||||||
- the files changed are not in the list of specified directories, and
|
- the files changed are not in the list of specified directories, and
|
||||||
- all commit messages do not contain 'ZFS-CI-Type: full'
|
- all commit messages do not contain 'ZFS-CI-Type: (full|linux|freebsd)'
|
||||||
|
|
||||||
Otherwise prints "full".
|
Otherwise prints "full".
|
||||||
"""
|
"""
|
||||||
@ -65,12 +65,12 @@ 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():
|
||||||
if line.strip().lower() == 'zfs-ci-type: quick':
|
if line.strip().lower() == 'zfs-ci-type: quick':
|
||||||
output_type('quick', f'explicitly requested by HEAD commit {head}')
|
output_type('quick', f'requested by HEAD commit {head}')
|
||||||
|
|
||||||
# check all commit messages
|
# check all commit messages
|
||||||
all_commit_message_raw = subprocess.run([
|
all_commit_message_raw = subprocess.run([
|
||||||
@ -83,8 +83,12 @@ if __name__ == '__main__':
|
|||||||
for line in all_commit_message:
|
for line in all_commit_message:
|
||||||
if line.startswith('ZFS-CI-Commit:'):
|
if line.startswith('ZFS-CI-Commit:'):
|
||||||
commit_ref = line.lstrip('ZFS-CI-Commit:').rstrip()
|
commit_ref = line.lstrip('ZFS-CI-Commit:').rstrip()
|
||||||
|
if line.strip().lower() == 'zfs-ci-type: freebsd':
|
||||||
|
output_type('freebsd', f'requested by commit {commit_ref}')
|
||||||
|
if line.strip().lower() == 'zfs-ci-type: linux':
|
||||||
|
output_type('linux', f'requested by commit {commit_ref}')
|
||||||
if line.strip().lower() == 'zfs-ci-type: full':
|
if line.strip().lower() == 'zfs-ci-type: full':
|
||||||
output_type('full', f'explicitly requested by commit {commit_ref}')
|
output_type('full', f'requested by commit {commit_ref}')
|
||||||
|
|
||||||
# check changed files
|
# check changed files
|
||||||
changed_files_raw = subprocess.run([
|
changed_files_raw = subprocess.run([
|
||||||
|
|||||||
114
.github/workflows/scripts/qemu-1-setup.sh
vendored
114
.github/workflows/scripts/qemu-1-setup.sh
vendored
@ -6,6 +6,20 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
# The default 'azure.archive.ubuntu.com' mirrors can be really slow.
|
||||||
|
# Prioritize the official Ubuntu mirrors.
|
||||||
|
#
|
||||||
|
# The normal apt-mirrors.txt will look like:
|
||||||
|
#
|
||||||
|
# http://azure.archive.ubuntu.com/ubuntu/ priority:1
|
||||||
|
# https://archive.ubuntu.com/ubuntu/ priority:2
|
||||||
|
# https://security.ubuntu.com/ubuntu/ priority:3
|
||||||
|
#
|
||||||
|
# Just delete the 'azure.archive.ubuntu.com' line.
|
||||||
|
sudo sed -i '/azure.archive.ubuntu.com/d' /etc/apt/apt-mirrors.txt
|
||||||
|
echo "Using mirrors:"
|
||||||
|
cat /etc/apt/apt-mirrors.txt
|
||||||
|
|
||||||
# install needed packages
|
# install needed packages
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
@ -20,35 +34,89 @@ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
|
|||||||
sudo systemctl stop docker.socket
|
sudo systemctl stop docker.socket
|
||||||
sudo systemctl stop multipathd.socket
|
sudo systemctl stop multipathd.socket
|
||||||
|
|
||||||
# remove default swapfile and /mnt
|
|
||||||
sudo swapoff -a
|
sudo swapoff -a
|
||||||
sudo umount -l /mnt
|
|
||||||
DISK="/dev/disk/cloud/azure_resource-part1"
|
# Special case:
|
||||||
sudo sed -e "s|^$DISK.*||g" -i /etc/fstab
|
#
|
||||||
sudo wipefs -aq $DISK
|
# For reasons unknown, the runner can boot-up with two different block device
|
||||||
sudo systemctl daemon-reload
|
# configurations. On one config you get two 75GB block devices, and on the
|
||||||
|
# other you get a single 150GB block device. Here's what both look like:
|
||||||
|
#
|
||||||
|
# --- Two 75GB block devices ---
|
||||||
|
# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||||
|
# sda 8:0 0 150G 0 disk
|
||||||
|
# ├─sda1 8:1 0 149G 0 part /
|
||||||
|
# ├─sda14 8:14 0 4M 0 part
|
||||||
|
# ├─sda15 8:15 0 106M 0 part /boot/efi
|
||||||
|
# └─sda16 259:0 0 913M 0 part /boot
|
||||||
|
#
|
||||||
|
# lrwxrwxrwx 1 root root 9 Jan 29 18:07 azure_root -> ../../sda
|
||||||
|
# lrwxrwxrwx 1 root root 10 Jan 29 18:07 azure_root-part1 -> ../../sda1
|
||||||
|
# lrwxrwxrwx 1 root root 11 Jan 29 18:07 azure_root-part14 -> ../../sda14
|
||||||
|
# lrwxrwxrwx 1 root root 11 Jan 29 18:07 azure_root-part15 -> ../../sda15
|
||||||
|
# lrwxrwxrwx 1 root root 11 Jan 29 18:07 azure_root-part16 -> ../../sda16
|
||||||
|
#
|
||||||
|
# --- One 150GB block device ---
|
||||||
|
# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||||
|
# sda 8:0 0 75G 0 disk
|
||||||
|
# ├─sda1 8:1 0 74G 0 part /
|
||||||
|
# ├─sda14 8:14 0 4M 0 part
|
||||||
|
# ├─sda15 8:15 0 106M 0 part /boot/efi
|
||||||
|
# └─sda16 259:0 0 913M 0 part /boot
|
||||||
|
# sdb 8:16 0 75G 0 disk
|
||||||
|
# └─sdb1 8:17 0 75G 0 part
|
||||||
|
#
|
||||||
|
# lrwxrwxrwx 1 root root 9 Jan 29 18:07 azure_resource -> ../../sdb
|
||||||
|
# lrwxrwxrwx 1 root root 10 Jan 29 18:07 azure_resource-part1 -> ../../sdb1
|
||||||
|
# lrwxrwxrwx 1 root root 9 Jan 29 18:07 azure_root -> ../../sda
|
||||||
|
# lrwxrwxrwx 1 root root 10 Jan 29 18:07 azure_root-part1 -> ../../sda1
|
||||||
|
# lrwxrwxrwx 1 root root 11 Jan 29 18:07 azure_root-part14 -> ../../sda14
|
||||||
|
# lrwxrwxrwx 1 root root 11 Jan 29 18:07 azure_root-part15 -> ../../sda15
|
||||||
|
#
|
||||||
|
# If we have the azure_resource-part1 partition, umount it, partition it, and
|
||||||
|
# use it as our ZFS disk and swap partition. If not, just create a file VDEV
|
||||||
|
# and swap file and use that instead.
|
||||||
|
|
||||||
|
# remove default swapfile and /mnt
|
||||||
|
if [ -e /dev/disk/cloud/azure_resource-part1 ] ; then
|
||||||
|
sudo umount -l /mnt
|
||||||
|
DISK="/dev/disk/cloud/azure_resource-part1"
|
||||||
|
sudo sed -e "s|^$DISK.*||g" -i /etc/fstab
|
||||||
|
sudo wipefs -aq $DISK
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
fi
|
||||||
|
|
||||||
sudo modprobe loop
|
sudo modprobe loop
|
||||||
sudo modprobe zfs
|
sudo modprobe zfs
|
||||||
|
|
||||||
# partition the disk as needed
|
if [ -e /dev/disk/cloud/azure_resource-part1 ] ; then
|
||||||
DISK="/dev/disk/cloud/azure_resource"
|
echo "We have two 75GB block devices"
|
||||||
sudo sgdisk --zap-all $DISK
|
# partition the disk as needed
|
||||||
sudo sgdisk -p \
|
DISK="/dev/disk/cloud/azure_resource"
|
||||||
-n 1:0:+16G -c 1:"swap" \
|
sudo sgdisk --zap-all $DISK
|
||||||
-n 2:0:0 -c 2:"tests" \
|
sudo sgdisk -p \
|
||||||
$DISK
|
-n 1:0:+16G -c 1:"swap" \
|
||||||
sync
|
-n 2:0:0 -c 2:"tests" \
|
||||||
sleep 1
|
$DISK
|
||||||
|
sync
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
sudo fallocate -l 12G /test.ssd2
|
||||||
|
DISKS="$DISK-part2 /test.ssd2"
|
||||||
|
|
||||||
|
SWAP=$DISK-part1
|
||||||
|
else
|
||||||
|
echo "We have a single 150GB block device"
|
||||||
|
sudo fallocate -l 72G /test.ssd2
|
||||||
|
SWAP=/swapfile.ssd
|
||||||
|
sudo fallocate -l 16G $SWAP
|
||||||
|
sudo chmod 600 $SWAP
|
||||||
|
DISKS="/test.ssd2"
|
||||||
|
fi
|
||||||
|
|
||||||
# swap with same size as RAM (16GiB)
|
# swap with same size as RAM (16GiB)
|
||||||
sudo mkswap $DISK-part1
|
sudo mkswap $SWAP
|
||||||
sudo swapon $DISK-part1
|
sudo swapon $SWAP
|
||||||
|
|
||||||
# JBOD 2xdisk for OpenZFS storage (test vm's)
|
|
||||||
SSD1="$DISK-part2"
|
|
||||||
sudo fallocate -l 12G /test.ssd2
|
|
||||||
SSD2=$(sudo losetup -b 4096 -f /test.ssd2 --show)
|
|
||||||
|
|
||||||
# adjust zfs module parameter and create pool
|
# adjust zfs module parameter and create pool
|
||||||
exec 1>/dev/null
|
exec 1>/dev/null
|
||||||
@ -57,7 +125,7 @@ ARC_MAX=$((1024*1024*512))
|
|||||||
echo $ARC_MIN | sudo tee /sys/module/zfs/parameters/zfs_arc_min
|
echo $ARC_MIN | sudo tee /sys/module/zfs/parameters/zfs_arc_min
|
||||||
echo $ARC_MAX | sudo tee /sys/module/zfs/parameters/zfs_arc_max
|
echo $ARC_MAX | sudo tee /sys/module/zfs/parameters/zfs_arc_max
|
||||||
echo 1 | sudo tee /sys/module/zfs/parameters/zvol_use_blk_mq
|
echo 1 | sudo tee /sys/module/zfs/parameters/zvol_use_blk_mq
|
||||||
sudo zpool create -f -o ashift=12 zpool $SSD1 $SSD2 -O relatime=off \
|
sudo zpool create -f -o ashift=12 zpool $DISKS -O relatime=off \
|
||||||
-O atime=off -O xattr=sa -O compression=lz4 -O sync=disabled \
|
-O atime=off -O xattr=sa -O compression=lz4 -O sync=disabled \
|
||||||
-O redundant_metadata=none -O mountpoint=/mnt/tests
|
-O redundant_metadata=none -O mountpoint=/mnt/tests
|
||||||
|
|
||||||
|
|||||||
84
.github/workflows/scripts/qemu-2-start.sh
vendored
84
.github/workflows/scripts/qemu-2-start.sh
vendored
@ -43,20 +43,25 @@ case "$OS" in
|
|||||||
OSv="almalinux9"
|
OSv="almalinux9"
|
||||||
URL="https://repo.almalinux.org/almalinux/10/cloud/x86_64/images/AlmaLinux-10-GenericCloud-latest.x86_64.qcow2"
|
URL="https://repo.almalinux.org/almalinux/10/cloud/x86_64/images/AlmaLinux-10-GenericCloud-latest.x86_64.qcow2"
|
||||||
;;
|
;;
|
||||||
|
alpine3-23)
|
||||||
|
OSNAME="Alpine Linux 3.23.2"
|
||||||
|
# Alpine Linux v3.22 and v3.23 are unknown to osinfo as of 2025-12-26.
|
||||||
|
OSv="alpinelinux3.21"
|
||||||
|
URL="https://dl-cdn.alpinelinux.org/alpine/v3.23/releases/cloud/generic_alpine-3.23.2-x86_64-bios-cloudinit-r0.qcow2"
|
||||||
|
;;
|
||||||
archlinux)
|
archlinux)
|
||||||
OSNAME="Archlinux"
|
OSNAME="Archlinux"
|
||||||
URL="https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2"
|
URL="https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2"
|
||||||
;;
|
;;
|
||||||
centos-stream10)
|
|
||||||
OSNAME="CentOS Stream 10"
|
|
||||||
# TODO: #16903 Overwrite OSv to stream9 for virt-install until it's added to osinfo
|
|
||||||
OSv="centos-stream9"
|
|
||||||
URL="https://cloud.centos.org/centos/10-stream/x86_64/images/CentOS-Stream-GenericCloud-10-latest.x86_64.qcow2"
|
|
||||||
;;
|
|
||||||
centos-stream9)
|
centos-stream9)
|
||||||
OSNAME="CentOS Stream 9"
|
OSNAME="CentOS Stream 9"
|
||||||
URL="https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2"
|
URL="https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2"
|
||||||
;;
|
;;
|
||||||
|
centos-stream10)
|
||||||
|
OSNAME="CentOS Stream 10"
|
||||||
|
OSv="centos-stream9"
|
||||||
|
URL="https://cloud.centos.org/centos/10-stream/x86_64/images/CentOS-Stream-GenericCloud-10-latest.x86_64.qcow2"
|
||||||
|
;;
|
||||||
debian11)
|
debian11)
|
||||||
OSNAME="Debian 11"
|
OSNAME="Debian 11"
|
||||||
URL="https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2"
|
URL="https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2"
|
||||||
@ -83,6 +88,11 @@ case "$OS" in
|
|||||||
OSv="fedora-unknown"
|
OSv="fedora-unknown"
|
||||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2"
|
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2"
|
||||||
;;
|
;;
|
||||||
|
fedora43)
|
||||||
|
OSNAME="Fedora 43"
|
||||||
|
OSv="fedora-unknown"
|
||||||
|
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/43/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2"
|
||||||
|
;;
|
||||||
freebsd13-5r)
|
freebsd13-5r)
|
||||||
FreeBSD="13.5-RELEASE"
|
FreeBSD="13.5-RELEASE"
|
||||||
OSNAME="FreeBSD $FreeBSD"
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
@ -91,13 +101,6 @@ case "$OS" in
|
|||||||
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
||||||
NIC="rtl8139"
|
NIC="rtl8139"
|
||||||
;;
|
;;
|
||||||
freebsd14-2r)
|
|
||||||
FreeBSD="14.2-RELEASE"
|
|
||||||
OSNAME="FreeBSD $FreeBSD"
|
|
||||||
OSv="freebsd14.0"
|
|
||||||
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
|
||||||
URLxz="$FREEBSD_REL/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
|
||||||
;;
|
|
||||||
freebsd14-3r)
|
freebsd14-3r)
|
||||||
FreeBSD="14.3-RELEASE"
|
FreeBSD="14.3-RELEASE"
|
||||||
OSNAME="FreeBSD $FreeBSD"
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
@ -120,8 +123,15 @@ case "$OS" in
|
|||||||
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"
|
||||||
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
;;
|
;;
|
||||||
freebsd15-0c)
|
freebsd15-0s)
|
||||||
FreeBSD="15.0-PRERELEASE"
|
FreeBSD="15.0-STABLE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
|
OSv="freebsd14.0"
|
||||||
|
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI-ufs.raw.xz"
|
||||||
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
|
;;
|
||||||
|
freebsd16-0c)
|
||||||
|
FreeBSD="16.0-CURRENT"
|
||||||
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"
|
||||||
@ -212,13 +222,21 @@ if [ ${OS:0:7} != "freebsd" ]; then
|
|||||||
hostname: $OS
|
hostname: $OS
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: root
|
- name: root
|
||||||
shell: $BASH
|
shell: /bin/bash
|
||||||
- name: zfs
|
sudo: ['ALL=(ALL) NOPASSWD:ALL']
|
||||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
- name: zfs
|
||||||
shell: $BASH
|
shell: /bin/bash
|
||||||
ssh_authorized_keys:
|
sudo: ['ALL=(ALL) NOPASSWD:ALL']
|
||||||
- $PUBKEY
|
ssh_authorized_keys:
|
||||||
|
- $PUBKEY
|
||||||
|
# Workaround for Alpine Linux.
|
||||||
|
lock_passwd: false
|
||||||
|
passwd: '*'
|
||||||
|
|
||||||
|
packages:
|
||||||
|
- sudo
|
||||||
|
- bash
|
||||||
|
|
||||||
growpart:
|
growpart:
|
||||||
mode: auto
|
mode: auto
|
||||||
@ -287,7 +305,7 @@ else
|
|||||||
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
||||||
ssh 2>/dev/null root@vm0 "uname -a" && break
|
ssh 2>/dev/null root@vm0 "uname -a" && break
|
||||||
done
|
done
|
||||||
ssh root@vm0 "pkg install -y bash ca_root_nss git qemu-guest-agent python3 py311-cloud-init"
|
ssh root@vm0 "env IGNORE_OSVERSION=yes pkg install -y bash ca_root_nss git qemu-guest-agent python3 py311-cloud-init"
|
||||||
ssh root@vm0 "chsh -s $BASH root"
|
ssh root@vm0 "chsh -s $BASH root"
|
||||||
ssh root@vm0 'sysrc qemu_guest_agent_enable="YES"'
|
ssh root@vm0 'sysrc qemu_guest_agent_enable="YES"'
|
||||||
ssh root@vm0 'sysrc cloudinit_enable="YES"'
|
ssh root@vm0 'sysrc cloudinit_enable="YES"'
|
||||||
@ -301,3 +319,23 @@ else
|
|||||||
scp ~/src.txz "root@vm0:/tmp/src.txz"
|
scp ~/src.txz "root@vm0:/tmp/src.txz"
|
||||||
ssh root@vm0 'tar -C / -zxf /tmp/src.txz'
|
ssh root@vm0 'tar -C / -zxf /tmp/src.txz'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Config for Alpine Linux similar to FreeBSD.
|
||||||
|
#
|
||||||
|
if [ ${OS:0:6} == "alpine" ]; then
|
||||||
|
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
||||||
|
ssh 2>/dev/null zfs@vm0 "uname -a" && break
|
||||||
|
done
|
||||||
|
# Enable community and testing repositories.
|
||||||
|
ssh zfs@vm0 "sudo rm -rf /etc/apk/repositories"
|
||||||
|
ssh zfs@vm0 "sudo setup-apkrepos -c1"
|
||||||
|
ssh zfs@vm0 "echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' | sudo tee -a /etc/apk/repositories"
|
||||||
|
# Upgrade to edge or latest-stable.
|
||||||
|
#ssh zfs@vm0 "sudo sed -i 's#/v[0-9]\+\.[0-9]\+/#/edge/#g' /etc/apk/repositories"
|
||||||
|
#ssh zfs@vm0 "sudo sed -i 's#/v[0-9]\+\.[0-9]\+/#/latest-stable/#g' /etc/apk/repositories"
|
||||||
|
# Update and upgrade after repository setup.
|
||||||
|
ssh zfs@vm0 "sudo apk update"
|
||||||
|
ssh zfs@vm0 "sudo apk add --upgrade apk-tools"
|
||||||
|
ssh zfs@vm0 "sudo apk upgrade --available"
|
||||||
|
fi
|
||||||
|
|||||||
61
.github/workflows/scripts/qemu-3-deps-vm.sh
vendored
61
.github/workflows/scripts/qemu-3-deps-vm.sh
vendored
@ -10,6 +10,32 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
function alpine() {
|
||||||
|
echo "##[group]Install Development Tools"
|
||||||
|
sudo apk add \
|
||||||
|
acl alpine-sdk attr autoconf automake bash build-base clang21 coreutils \
|
||||||
|
cpio cryptsetup curl curl-dev dhcpcd eudev eudev-dev eudev-libs findutils \
|
||||||
|
fio gawk gdb gettext-dev git grep jq libaio libaio-dev libcurl \
|
||||||
|
libtirpc-dev libtool libunwind libunwind-dev linux-headers linux-tools \
|
||||||
|
linux-virt linux-virt-dev lsscsi m4 make nfs-utils openssl-dev parted \
|
||||||
|
pax procps py3-cffi py3-distlib py3-packaging py3-setuptools python3 \
|
||||||
|
python3-dev qemu-guest-agent rng-tools rsync samba samba-server sed \
|
||||||
|
strace sysstat util-linux util-linux-dev wget words xfsprogs xxhash \
|
||||||
|
zlib-dev pamtester@testing
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Switch to eudev"
|
||||||
|
sudo setup-devd udev
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Install ksh93 from Source"
|
||||||
|
git clone --depth 1 https://github.com/ksh93/ksh.git /tmp/ksh
|
||||||
|
cd /tmp/ksh
|
||||||
|
./bin/package make
|
||||||
|
sudo ./bin/package install /
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
function archlinux() {
|
function archlinux() {
|
||||||
echo "##[group]Running pacman -Syu"
|
echo "##[group]Running pacman -Syu"
|
||||||
sudo btrfs filesystem resize max /
|
sudo btrfs filesystem resize max /
|
||||||
@ -20,13 +46,17 @@ 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]"
|
||||||
}
|
}
|
||||||
|
|
||||||
function debian() {
|
function debian() {
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
|
echo "##[group]Wait for cloud-init to finish"
|
||||||
|
cloud-init status --wait
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
echo "##[group]Running apt-get update+upgrade"
|
echo "##[group]Running apt-get update+upgrade"
|
||||||
sudo sed -i '/[[:alpha:]]-backports/d' /etc/apt/sources.list
|
sudo sed -i '/[[:alpha:]]-backports/d' /etc/apt/sources.list
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
@ -43,7 +73,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 +118,13 @@ 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
|
||||||
|
|
||||||
|
# These are needed for building Lustre. We only install these on EL VMs since
|
||||||
|
# we don't plan to test build Lustre on other platforms.
|
||||||
|
sudo dnf install -y libnl3-devel libyaml-devel libmount-devel
|
||||||
|
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +140,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"
|
||||||
|
|
||||||
@ -139,6 +175,9 @@ case "$1" in
|
|||||||
sudo dnf install -y kernel-abi-stablelists
|
sudo dnf install -y kernel-abi-stablelists
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
;;
|
;;
|
||||||
|
alpine*)
|
||||||
|
alpine
|
||||||
|
;;
|
||||||
archlinux)
|
archlinux)
|
||||||
archlinux
|
archlinux
|
||||||
;;
|
;;
|
||||||
@ -187,6 +226,16 @@ test -z "${ONLY_DEPS:-}" || exit 0
|
|||||||
# Start services
|
# Start services
|
||||||
echo "##[group]Enable services"
|
echo "##[group]Enable services"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
alpine*)
|
||||||
|
sudo -E rc-update add qemu-guest-agent
|
||||||
|
sudo -E rc-update add nfs
|
||||||
|
sudo -E rc-update add samba
|
||||||
|
sudo -E rc-update add dhcpcd
|
||||||
|
# Remove services related to cloud-init.
|
||||||
|
sudo -E rc-update del cloud-init default
|
||||||
|
sudo -E rc-update del cloud-final default
|
||||||
|
sudo -E rc-update del cloud-config default
|
||||||
|
;;
|
||||||
freebsd*)
|
freebsd*)
|
||||||
# add virtio things
|
# add virtio things
|
||||||
echo 'virtio_load="YES"' | sudo -E tee -a /boot/loader.conf
|
echo 'virtio_load="YES"' | sudo -E tee -a /boot/loader.conf
|
||||||
@ -242,7 +291,7 @@ case "$1" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
archlinux|freebsd*)
|
alpine*|archlinux|freebsd*)
|
||||||
true
|
true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
2
.github/workflows/scripts/qemu-4-build-vm.sh
vendored
2
.github/workflows/scripts/qemu-4-build-vm.sh
vendored
@ -181,7 +181,7 @@ function freebsd() {
|
|||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|
||||||
echo "##[group]Build"
|
echo "##[group]Build"
|
||||||
run gmake -j$(sysctl -n hw.ncpu)
|
run gmake -j$(nproc)
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|
||||||
echo "##[group]Install"
|
echo "##[group]Install"
|
||||||
|
|||||||
47
.github/workflows/scripts/qemu-5-setup.sh
vendored
47
.github/workflows/scripts/qemu-5-setup.sh
vendored
@ -58,13 +58,21 @@ for ((i=1; i<=VMs; i++)); do
|
|||||||
fqdn: vm$i
|
fqdn: vm$i
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: root
|
- name: root
|
||||||
shell: $BASH
|
shell: /bin/bash
|
||||||
- name: zfs
|
sudo: ['ALL=(ALL) NOPASSWD:ALL']
|
||||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
- name: zfs
|
||||||
shell: $BASH
|
shell: /bin/bash
|
||||||
ssh_authorized_keys:
|
sudo: ['ALL=(ALL) NOPASSWD:ALL']
|
||||||
- $PUBKEY
|
ssh_authorized_keys:
|
||||||
|
- $PUBKEY
|
||||||
|
# Workaround for Alpine Linux.
|
||||||
|
lock_passwd: false
|
||||||
|
passwd: '*'
|
||||||
|
|
||||||
|
packages:
|
||||||
|
- sudo
|
||||||
|
- bash
|
||||||
|
|
||||||
growpart:
|
growpart:
|
||||||
mode: auto
|
mode: auto
|
||||||
@ -108,19 +116,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."
|
||||||
|
|||||||
51
.github/workflows/scripts/qemu-6-lustre-tests-vm.sh
vendored
Executable file
51
.github/workflows/scripts/qemu-6-lustre-tests-vm.sh
vendored
Executable file
@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# 6) Test if Lustre can still build against ZFS
|
||||||
|
######################################################################
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Build from the latest Lustre tag rather than the master branch. We do this
|
||||||
|
# under the assumption that master is going to have a lot of churn thus will be
|
||||||
|
# more prone to breaking the build than a point release. We don't want ZFS
|
||||||
|
# PR's reporting bad test results simply because upstream Lustre accidentally
|
||||||
|
# broke their build.
|
||||||
|
#
|
||||||
|
# Skip any RC tags, or any tags where the last version digit is 50 or more.
|
||||||
|
# Versions with 50 or more are development versions of Lustre.
|
||||||
|
repo=https://github.com/lustre/lustre-release.git
|
||||||
|
tag="$(git ls-remote --refs --exit-code --sort=version:refname --tags $repo | \
|
||||||
|
awk -F '_' '/-RC/{next}; /refs\/tags\/v/{if ($NF < 50){print}}' | \
|
||||||
|
tail -n 1 | sed 's/.*\///')"
|
||||||
|
|
||||||
|
echo "Cloning Lustre tag $tag"
|
||||||
|
git clone --depth 1 --branch "$tag" "$repo"
|
||||||
|
|
||||||
|
cd lustre-release
|
||||||
|
|
||||||
|
# Include Lustre patches to build against master/zfs-2.4.x. Once these
|
||||||
|
# patches are merged we can remove these lines.
|
||||||
|
patches=('https://review.whamcloud.com/changes/fs%2Flustre-release~62101/revisions/2/patch?download'
|
||||||
|
'https://review.whamcloud.com/changes/fs%2Flustre-release~63267/revisions/9/patch?download')
|
||||||
|
|
||||||
|
for p in "${patches[@]}" ; do
|
||||||
|
curl $p | base64 -d > patch
|
||||||
|
patch -p1 < patch || true
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Configure Lustre"
|
||||||
|
./autogen.sh
|
||||||
|
# EL 9 needs '--disable-gss-keyring'
|
||||||
|
./configure --with-zfs --disable-gss-keyring
|
||||||
|
echo "Building Lustre RPMs"
|
||||||
|
make rpms
|
||||||
|
ls *.rpm
|
||||||
|
|
||||||
|
# There's only a handful of Lustre RPMs we actually need to install
|
||||||
|
lustrerpms="$(ls *.rpm | grep -E 'kmod-lustre-osd-zfs-[0-9]|kmod-lustre-[0-9]|lustre-osd-zfs-mount-[0-9]')"
|
||||||
|
echo "Installing: $lustrerpms"
|
||||||
|
sudo dnf -y install $lustrerpms
|
||||||
|
sudo modprobe -v lustre
|
||||||
|
|
||||||
|
# Should see some Lustre lines in dmesg
|
||||||
|
sudo dmesg | grep -Ei 'lnet|lustre'
|
||||||
134
.github/workflows/scripts/qemu-6-tests.sh
vendored
134
.github/workflows/scripts/qemu-6-tests.sh
vendored
@ -4,7 +4,10 @@
|
|||||||
# 6) load openzfs module and run the tests
|
# 6) load openzfs module and run the tests
|
||||||
#
|
#
|
||||||
# called on runner: qemu-6-tests.sh
|
# called on runner: qemu-6-tests.sh
|
||||||
# called on qemu-vm: qemu-6-tests.sh $OS $2/$3
|
# called on qemu-vm: qemu-6-tests.sh $OS $2 $3 [--lustre|--builtin] [quick|default]
|
||||||
|
#
|
||||||
|
# --lustre: Test build lustre in addition to the normal tests
|
||||||
|
# --builtin: Test build ZFS as a kernel built-in in addition to the normal tests
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
@ -38,6 +41,54 @@ function prefix() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function do_lustre_build() {
|
||||||
|
local rc=0
|
||||||
|
$HOME/zfs/.github/workflows/scripts/qemu-6-lustre-tests-vm.sh &> /var/tmp/lustre.txt || rc=$?
|
||||||
|
echo "$rc" > /var/tmp/lustre-exitcode.txt
|
||||||
|
if [ "$rc" != "0" ] ; then
|
||||||
|
echo "$rc" > /var/tmp/tests-exitcode.txt
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
export -f do_lustre_build
|
||||||
|
|
||||||
|
# Test build ZFS into the kernel directly
|
||||||
|
function do_builtin_build() {
|
||||||
|
local rc=0
|
||||||
|
# Get currently full kernel version (like '6.18.8')
|
||||||
|
fullver=$(uname -r | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+')
|
||||||
|
|
||||||
|
# Get just the major ('6')
|
||||||
|
major=$(echo $fullver | grep -Eo '^[0-9]+')
|
||||||
|
(
|
||||||
|
set -e
|
||||||
|
|
||||||
|
wget https://cdn.kernel.org/pub/linux/kernel/v${major}.x/linux-$fullver.tar.xz
|
||||||
|
tar -xf $HOME/linux-$fullver.tar.xz
|
||||||
|
cd $HOME/linux-$fullver
|
||||||
|
make tinyconfig
|
||||||
|
./scripts/config --enable EFI_PARTITON
|
||||||
|
./scripts/config --enable BLOCK
|
||||||
|
# BTRFS_FS is easiest config option to enable CONFIG_ZLIB_INFLATE|DEFLATE
|
||||||
|
./scripts/config --enable BTRFS_FS
|
||||||
|
yes "" | make oldconfig
|
||||||
|
make prepare
|
||||||
|
|
||||||
|
cd $HOME/zfs
|
||||||
|
./configure --with-linux=$HOME/linux-$fullver --enable-linux-builtin --enable-debug
|
||||||
|
./copy-builtin $HOME/linux-$fullver
|
||||||
|
|
||||||
|
cd $HOME/linux-$fullver
|
||||||
|
./scripts/config --enable ZFS
|
||||||
|
yes "" | make oldconfig
|
||||||
|
make -j `nproc`
|
||||||
|
) &> /var/tmp/builtin.txt || rc=$?
|
||||||
|
echo "$rc" > /var/tmp/builtin-exitcode.txt
|
||||||
|
if [ "$rc" != "0" ] ; then
|
||||||
|
echo "$rc" > /var/tmp/tests-exitcode.txt
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
export -f do_builtin_build
|
||||||
|
|
||||||
# called directly on the runner
|
# called directly on the runner
|
||||||
if [ -z ${1:-} ]; then
|
if [ -z ${1:-} ]; then
|
||||||
cd "/var/tmp"
|
cd "/var/tmp"
|
||||||
@ -49,8 +100,24 @@ if [ -z ${1:-} ]; then
|
|||||||
|
|
||||||
for ((i=1; i<=VMs; i++)); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
IP="192.168.122.1$i"
|
IP="192.168.122.1$i"
|
||||||
|
|
||||||
|
# We do an additional test build of Lustre against ZFS if we're vm2
|
||||||
|
# on almalinux*. At the time of writing, the vm2 tests were
|
||||||
|
# completing roughly 15min before the vm1 tests, so it makes sense
|
||||||
|
# to have vm2 do the build.
|
||||||
|
#
|
||||||
|
# In addition, we do an additional test build of ZFS as a Linux
|
||||||
|
# kernel built-in on Fedora. Again, we do it on vm2 to exploit vm2's
|
||||||
|
# early finish time.
|
||||||
|
extra=""
|
||||||
|
if [[ "$OS" == almalinux* ]] && [[ "$i" == "2" ]] ; then
|
||||||
|
extra="--lustre"
|
||||||
|
elif [[ "$OS" == fedora* ]] && [[ "$i" == "2" ]] ; then
|
||||||
|
extra="--builtin"
|
||||||
|
fi
|
||||||
|
|
||||||
daemonize -c /var/tmp -p vm${i}.pid -o vm${i}log.txt -- \
|
daemonize -c /var/tmp -p vm${i}.pid -o vm${i}log.txt -- \
|
||||||
$SSH zfs@$IP $TESTS $OS $i $VMs $CI_TYPE
|
$SSH zfs@$IP $TESTS $OS $i $VMs $extra $CI_TYPE
|
||||||
# handly line by line and add info prefix
|
# handly line by line and add info prefix
|
||||||
stdbuf -oL tail -fq vm${i}log.txt \
|
stdbuf -oL tail -fq vm${i}log.txt \
|
||||||
| while read -r line; do prefix "$i" "$line"; done &
|
| while read -r line; do prefix "$i" "$line"; done &
|
||||||
@ -70,9 +137,35 @@ if [ -z ${1:-} ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# this part runs inside qemu vm
|
|
||||||
|
#############################################
|
||||||
|
# Everything from here on runs inside qemu vm
|
||||||
|
#############################################
|
||||||
|
|
||||||
|
# Process cmd line args
|
||||||
|
OS="$1"
|
||||||
|
shift
|
||||||
|
NUM="$1"
|
||||||
|
shift
|
||||||
|
DEN="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
BUILD_LUSTRE=0
|
||||||
|
BUILD_BUILTIN=0
|
||||||
|
if [ "$1" == "--lustre" ] ; then
|
||||||
|
BUILD_LUSTRE=1
|
||||||
|
shift
|
||||||
|
elif [ "$1" == "--builtin" ] ; then
|
||||||
|
BUILD_BUILTIN=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "quick" ] ; then
|
||||||
|
export RUNFILES="sanity.run"
|
||||||
|
fi
|
||||||
|
|
||||||
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
|
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
|
||||||
case "$1" in
|
case "$OS" in
|
||||||
freebsd*)
|
freebsd*)
|
||||||
TDIR="/usr/local/share/zfs"
|
TDIR="/usr/local/share/zfs"
|
||||||
sudo kldstat -n zfs 2>/dev/null && sudo kldunload zfs
|
sudo kldstat -n zfs 2>/dev/null && sudo kldunload zfs
|
||||||
@ -95,23 +188,42 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# enable io_uring on el9/el10
|
# Distribution-specific settings.
|
||||||
case "$1" in
|
case "$OS" in
|
||||||
almalinux9|almalinux10|centos-stream*)
|
almalinux9|almalinux10|centos-stream*)
|
||||||
|
# Enable io_uring on Enterprise Linux 9 and 10.
|
||||||
sudo sysctl kernel.io_uring_disabled=0 > /dev/null
|
sudo sysctl kernel.io_uring_disabled=0 > /dev/null
|
||||||
;;
|
;;
|
||||||
|
alpine*)
|
||||||
|
# Ensure `/etc/zfs/zpool.cache` exists.
|
||||||
|
sudo mkdir -p /etc/zfs
|
||||||
|
sudo touch /etc/zfs/zpool.cache
|
||||||
|
sudo chmod 644 /etc/zfs/zpool.cache
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Lustre calls a number of exported ZFS module symbols. To make sure we don't
|
||||||
|
# change the symbols and break Lustre, do a quick Lustre build of the latest
|
||||||
|
# released Lustre against ZFS.
|
||||||
|
#
|
||||||
|
# Note that we do the Lustre test build in parallel with ZTS. ZTS isn't very
|
||||||
|
# CPU intensive, so we can use idle CPU cycles "guilt free" for the build.
|
||||||
|
# The Lustre build on its own takes ~15min.
|
||||||
|
if [ "$BUILD_LUSTRE" == "1" ] ; then
|
||||||
|
do_lustre_build &
|
||||||
|
elif [ "$BUILD_BUILTIN" == "1" ] ; then
|
||||||
|
# Try building ZFS directly into the Linux kernel (not as a module)
|
||||||
|
do_builtin_build &
|
||||||
|
fi
|
||||||
|
|
||||||
# run functional testings and save exitcode
|
# run functional testings and save exitcode
|
||||||
cd /var/tmp
|
cd /var/tmp
|
||||||
TAGS=$2/$3
|
TAGS=$NUM/$DEN
|
||||||
if [ "$4" == "quick" ]; then
|
|
||||||
export RUNFILES="sanity.run"
|
|
||||||
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
|
||||||
|
|||||||
32
.github/workflows/scripts/qemu-8-summary.sh
vendored
32
.github/workflows/scripts/qemu-8-summary.sh
vendored
@ -31,6 +31,12 @@ EOF
|
|||||||
rm -f tmp$$
|
rm -f tmp$$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showfile_tail() {
|
||||||
|
echo "##[group]$2 (final lines)"
|
||||||
|
tail -n 80 $1
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
# overview
|
# overview
|
||||||
cat /tmp/summary.txt
|
cat /tmp/summary.txt
|
||||||
echo ""
|
echo ""
|
||||||
@ -46,6 +52,32 @@ fi
|
|||||||
echo -e "\nFull logs for download:\n $1\n"
|
echo -e "\nFull logs for download:\n $1\n"
|
||||||
|
|
||||||
for ((i=1; i<=VMs; i++)); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
|
|
||||||
|
# Print Lustre build test results (the build is only done on vm2)
|
||||||
|
if [ -f vm$i/lustre-exitcode.txt ] ; then
|
||||||
|
rv=$(< vm$i/lustre-exitcode.txt)
|
||||||
|
if [ $rv = 0 ]; then
|
||||||
|
vm="[92mvm$i[0m"
|
||||||
|
else
|
||||||
|
vm="[1;91mvm$i[0m"
|
||||||
|
touch /tmp/have_failed_tests
|
||||||
|
fi
|
||||||
|
file="vm$i/lustre.txt"
|
||||||
|
test -s "$file" && showfile_tail "$file" "$vm: Lustre build"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f vm$i/builtin-exitcode.txt ] ; then
|
||||||
|
rv=$(< vm$i/builtin-exitcode.txt)
|
||||||
|
if [ $rv = 0 ]; then
|
||||||
|
vm="[92mvm$i[0m"
|
||||||
|
else
|
||||||
|
vm="[1;91mvm$i[0m"
|
||||||
|
touch /tmp/have_failed_tests
|
||||||
|
fi
|
||||||
|
file="vm$i/builtin.txt"
|
||||||
|
test -s "$file" && showfile_tail "$file" "$vm: Linux built-in build"
|
||||||
|
fi
|
||||||
|
|
||||||
rv=$(cat vm$i/tests-exitcode.txt)
|
rv=$(cat vm$i/tests-exitcode.txt)
|
||||||
|
|
||||||
if [ $rv = 0 ]; then
|
if [ $rv = 0 ]; then
|
||||||
|
|||||||
41
.github/workflows/scripts/qemu-test-repo-vm.sh
vendored
41
.github/workflows/scripts/qemu-test-repo-vm.sh
vendored
@ -4,7 +4,11 @@
|
|||||||
#
|
#
|
||||||
# USAGE:
|
# USAGE:
|
||||||
#
|
#
|
||||||
# ./qemu-test-repo-vm [URL]
|
# ./qemu-test-repo-vm [--install] [URL]
|
||||||
|
#
|
||||||
|
# --lookup: When testing a repo, only lookup the latest package versions,
|
||||||
|
# don't try to install them. Installing all of them takes over
|
||||||
|
# an hour, so this is much quicker.
|
||||||
#
|
#
|
||||||
# URL: URL to use instead of http://download.zfsonlinux.org
|
# URL: URL to use instead of http://download.zfsonlinux.org
|
||||||
# If blank, use the default repo from zfs-release RPM.
|
# If blank, use the default repo from zfs-release RPM.
|
||||||
@ -15,6 +19,13 @@ source /etc/os-release
|
|||||||
OS="$ID"
|
OS="$ID"
|
||||||
VERSION="$VERSION_ID"
|
VERSION="$VERSION_ID"
|
||||||
|
|
||||||
|
|
||||||
|
LOOKUP=""
|
||||||
|
if [ -n "$1" ] && [ "$1" == "--lookup" ] ; then
|
||||||
|
LOOKUP=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
ALTHOST=""
|
ALTHOST=""
|
||||||
if [ -n "$1" ] ; then
|
if [ -n "$1" ] ; then
|
||||||
ALTHOST="$1"
|
ALTHOST="$1"
|
||||||
@ -42,7 +53,19 @@ function test_install {
|
|||||||
sudo sed -i "s;baseurl=http://download.zfsonlinux.org;baseurl=$host;g" /etc/yum.repos.d/zfs.repo
|
sudo sed -i "s;baseurl=http://download.zfsonlinux.org;baseurl=$host;g" /etc/yum.repos.d/zfs.repo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo dnf -y install $args zfs zfs-test
|
baseurl=$(grep -A 5 "\[$repo\]" /etc/yum.repos.d/zfs.repo | awk -F'=' '/baseurl=/{print $2; exit}')
|
||||||
|
|
||||||
|
# Just do a version lookup - don't try to install any RPMs
|
||||||
|
if [ "$LOOKUP" == "1" ] ; then
|
||||||
|
package="$(dnf list $args zfs | tail -n 1 | awk '{print $2}')"
|
||||||
|
echo "$repo ${package} $baseurl" >> $SUMMARY
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! sudo dnf -y install $args zfs zfs-test ; then
|
||||||
|
echo "$repo ${package}...[FAILED] $baseurl" >> $SUMMARY
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Load modules and create a simple pool as a sanity test.
|
# Load modules and create a simple pool as a sanity test.
|
||||||
sudo /usr/share/zfs/zfs.sh -r
|
sudo /usr/share/zfs/zfs.sh -r
|
||||||
@ -51,7 +74,6 @@ function test_install {
|
|||||||
sudo zpool status
|
sudo zpool status
|
||||||
|
|
||||||
# Print out repo name, rpm installed (kmod or dkms), and repo URL
|
# Print out repo name, rpm installed (kmod or dkms), and repo URL
|
||||||
baseurl=$(grep -A 5 "\[$repo\]" /etc/yum.repos.d/zfs.repo | awk -F'=' '/baseurl=/{print $2; exit}')
|
|
||||||
package=$(sudo rpm -qa | grep zfs | grep -E 'kmod|dkms')
|
package=$(sudo rpm -qa | grep zfs | grep -E 'kmod|dkms')
|
||||||
|
|
||||||
echo "$repo $package $baseurl" >> $SUMMARY
|
echo "$repo $package $baseurl" >> $SUMMARY
|
||||||
@ -70,16 +92,19 @@ almalinux*)
|
|||||||
name=$(curl -Ls $url | grep 'dnf install' | grep -Eo 'zfs-release-[0-9]+-[0-9]+')
|
name=$(curl -Ls $url | grep 'dnf install' | grep -Eo 'zfs-release-[0-9]+-[0-9]+')
|
||||||
sudo dnf -y install https://zfsonlinux.org/epel/$name$(rpm --eval "%{dist}").noarch.rpm 2>&1
|
sudo dnf -y install https://zfsonlinux.org/epel/$name$(rpm --eval "%{dist}").noarch.rpm 2>&1
|
||||||
sudo rpm -qi zfs-release
|
sudo rpm -qi zfs-release
|
||||||
test_install zfs $ALTHOST
|
for i in zfs zfs-kmod zfs-testing zfs-testing-kmod zfs-latest \
|
||||||
test_install zfs-kmod $ALTHOST
|
zfs-latest-kmod zfs-legacy zfs-legacy-kmod zfs-2.2 \
|
||||||
test_install zfs-testing $ALTHOST
|
zfs-2.2-kmod zfs-2.3 zfs-2.3-kmod zfs-2.4 zfs-2.4-kmod; do
|
||||||
test_install zfs-testing-kmod $ALTHOST
|
test_install $i $ALTHOST
|
||||||
|
done
|
||||||
;;
|
;;
|
||||||
fedora*)
|
fedora*)
|
||||||
url='https://raw.githubusercontent.com/openzfs/openzfs-docs/refs/heads/master/docs/Getting%20Started/Fedora/index.rst'
|
url='https://raw.githubusercontent.com/openzfs/openzfs-docs/refs/heads/master/docs/Getting%20Started/Fedora/index.rst'
|
||||||
name=$(curl -Ls $url | grep 'dnf install' | grep -Eo 'zfs-release-[0-9]+-[0-9]+')
|
name=$(curl -Ls $url | grep 'dnf install' | grep -Eo 'zfs-release-[0-9]+-[0-9]+')
|
||||||
sudo dnf -y install -y https://zfsonlinux.org/fedora/$name$(rpm --eval "%{dist}").noarch.rpm
|
sudo dnf -y install -y https://zfsonlinux.org/fedora/$name$(rpm --eval "%{dist}").noarch.rpm
|
||||||
test_install zfs $ALTHOST
|
for i in zfs zfs-latest zfs-legacy zfs-2.2 zfs-2.3 zfs-2.4 ; do
|
||||||
|
test_install $i $ALTHOST
|
||||||
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "##[endgroup]"
|
echo "##[endgroup]"
|
||||||
|
|||||||
52
.github/workflows/smatch.yml
vendored
Normal file
52
.github/workflows/smatch.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
name: smatch
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
smatch:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout smatch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: error27/smatch
|
||||||
|
ref: master
|
||||||
|
path: smatch
|
||||||
|
- name: Install smatch dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y llvm gcc make sqlite3 libsqlite3-dev libdbd-sqlite3-perl libssl-dev libtry-tiny-perl
|
||||||
|
- name: Make smatch
|
||||||
|
run: |
|
||||||
|
cd $GITHUB_WORKSPACE/smatch
|
||||||
|
make -j$(nproc)
|
||||||
|
- name: Checkout OpenZFS
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
path: zfs
|
||||||
|
- name: Install OpenZFS dependencies
|
||||||
|
run: |
|
||||||
|
cd $GITHUB_WORKSPACE/zfs
|
||||||
|
sudo apt-get purge -y snapd google-chrome-stable firefox
|
||||||
|
ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps-vm.sh ubuntu24
|
||||||
|
- name: Autogen.sh OpenZFS
|
||||||
|
run: |
|
||||||
|
cd $GITHUB_WORKSPACE/zfs
|
||||||
|
./autogen.sh
|
||||||
|
- name: Configure OpenZFS
|
||||||
|
run: |
|
||||||
|
cd $GITHUB_WORKSPACE/zfs
|
||||||
|
./configure --enable-debug
|
||||||
|
- name: Make OpenZFS
|
||||||
|
run: |
|
||||||
|
cd $GITHUB_WORKSPACE/zfs
|
||||||
|
make -j$(nproc) CHECK="$GITHUB_WORKSPACE/smatch/smatch" CC=$GITHUB_WORKSPACE/smatch/cgcc | tee $GITHUB_WORKSPACE/smatch.log
|
||||||
|
- name: Smatch results log
|
||||||
|
run: |
|
||||||
|
grep -E 'error:|warn:|warning:' $GITHUB_WORKSPACE/smatch.log
|
||||||
20
.github/workflows/zfs-qemu-packages.yml
vendored
20
.github/workflows/zfs-qemu-packages.yml
vendored
@ -42,6 +42,12 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
description: "(optional) repo URL (blank: use http://download.zfsonlinux.org)"
|
description: "(optional) repo URL (blank: use http://download.zfsonlinux.org)"
|
||||||
|
lookup:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: "(optional) do version lookup only on repo test"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -52,7 +58,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora41', 'fedora42']
|
os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora41', 'fedora42', 'fedora43']
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -60,20 +66,16 @@ jobs:
|
|||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
timeout-minutes: 10
|
|
||||||
run: .github/workflows/scripts/qemu-1-setup.sh
|
run: .github/workflows/scripts/qemu-1-setup.sh
|
||||||
|
|
||||||
- name: Start build machine
|
- name: Start build machine
|
||||||
timeout-minutes: 10
|
|
||||||
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }}
|
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
|
||||||
run: |
|
run: |
|
||||||
.github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }}
|
.github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }}
|
||||||
|
|
||||||
- name: Build modules or Test repo
|
- name: Build modules or Test repo
|
||||||
timeout-minutes: 30
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
if [ "${{ github.event.inputs.test_type }}" == "Test repo" ] ; then
|
if [ "${{ github.event.inputs.test_type }}" == "Test repo" ] ; then
|
||||||
@ -81,7 +83,12 @@ jobs:
|
|||||||
.github/workflows/scripts/qemu-prepare-for-build.sh
|
.github/workflows/scripts/qemu-prepare-for-build.sh
|
||||||
|
|
||||||
mkdir -p /tmp/repo
|
mkdir -p /tmp/repo
|
||||||
ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-test-repo-vm.sh' ${{ github.event.inputs.repo_url }}
|
EXTRA=""
|
||||||
|
if [ "${{ github.event.inputs.lookup }}" == 'true' ] ; then
|
||||||
|
EXTRA="--lookup"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-test-repo-vm.sh' $EXTRA ${{ github.event.inputs.repo_url }}
|
||||||
else
|
else
|
||||||
EXTRA=""
|
EXTRA=""
|
||||||
if [ -n "${{ github.event.inputs.patch_level }}" ] ; then
|
if [ -n "${{ github.event.inputs.patch_level }}" ] ; then
|
||||||
@ -94,7 +101,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
if: always()
|
if: always()
|
||||||
timeout-minutes: 10
|
|
||||||
run: |
|
run: |
|
||||||
rsync -a zfs@vm0:/tmp/repo /tmp || true
|
rsync -a zfs@vm0:/tmp/repo /tmp || true
|
||||||
.github/workflows/scripts/replace-dupes-with-symlinks.sh /tmp/repo
|
.github/workflows/scripts/replace-dupes-with-symlinks.sh /tmp/repo
|
||||||
|
|||||||
59
.github/workflows/zfs-qemu.yml
vendored
59
.github/workflows/zfs-qemu.yml
vendored
@ -10,6 +10,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
description: "(optional) Experimental kernel version to install on Fedora (like '6.14' or '6.13.3-0.rc3')"
|
description: "(optional) Experimental kernel version to install on Fedora (like '6.14' or '6.13.3-0.rc3')"
|
||||||
|
specific_os:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
description: "(optional) Only run on this specific OS (like 'fedora42' or 'alpine3-23')"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -29,33 +34,45 @@ jobs:
|
|||||||
- name: Generate OS config and CI type
|
- name: Generate OS config and CI type
|
||||||
id: os
|
id: os
|
||||||
run: |
|
run: |
|
||||||
FULL_OS='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian12", "debian13", "fedora41", "fedora42", "freebsd13-5r", "freebsd14-3s", "freebsd15-0c", "ubuntu22", "ubuntu24"]'
|
ci_type="default"
|
||||||
QUICK_OS='["almalinux8", "almalinux9", "almalinux10", "debian12", "fedora42", "freebsd14-3s", "ubuntu24"]'
|
|
||||||
# determine CI type when running on PR
|
# determine CI type when running on PR
|
||||||
ci_type="full"
|
|
||||||
if ${{ github.event_name == 'pull_request' }}; then
|
if ${{ github.event_name == 'pull_request' }}; then
|
||||||
head=${{ github.event.pull_request.head.sha }}
|
head=${{ github.event.pull_request.head.sha }}
|
||||||
base=${{ github.event.pull_request.base.sha }}
|
base=${{ github.event.pull_request.base.sha }}
|
||||||
ci_type=$(python3 .github/workflows/scripts/generate-ci-type.py $head $base)
|
ci_type=$(python3 .github/workflows/scripts/generate-ci-type.py $head $base)
|
||||||
fi
|
fi
|
||||||
if [ "$ci_type" == "quick" ]; then
|
|
||||||
os_selection="$QUICK_OS"
|
|
||||||
else
|
|
||||||
os_selection="$FULL_OS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${{ github.event.inputs.fedora_kernel_ver }} != "" ] ; then
|
case "$ci_type" in
|
||||||
# They specified a custom kernel version for Fedora. Use only
|
quick)
|
||||||
# Fedora runners.
|
os_selection='["almalinux8", "almalinux9", "almalinux10", "debian12", "fedora42", "freebsd15-0s", "ubuntu24"]'
|
||||||
|
;;
|
||||||
|
linux)
|
||||||
|
os_selection='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian11", "debian12", "debian13", "fedora41", "fedora42", "fedora43", "ubuntu22", "ubuntu24"]'
|
||||||
|
;;
|
||||||
|
freebsd)
|
||||||
|
os_selection='["freebsd13-5r", "freebsd14-3r", "freebsd13-5s", "freebsd14-3s", "freebsd15-0s", "freebsd16-0c"]'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# default list
|
||||||
|
os_selection='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian12", "debian13", "fedora42", "fedora43", "freebsd14-3r", "freebsd15-0s", "freebsd16-0c", "ubuntu22", "ubuntu24"]'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if ${{ github.event.inputs.fedora_kernel_ver != '' }}; then
|
||||||
|
# They specified a custom kernel version for Fedora.
|
||||||
|
# Use only Fedora runners.
|
||||||
os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]')
|
os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]')
|
||||||
|
elif ${{ github.event.inputs.specific_os != '' }}; then
|
||||||
|
# Use only the specified runner.
|
||||||
|
os_json=$(jq -cn --arg os "${{ github.event.inputs.specific_os }}" '[ $os ]')
|
||||||
else
|
else
|
||||||
# Normal case
|
# Normal case
|
||||||
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
|
||||||
@ -63,13 +80,13 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# rhl: almalinux8, almalinux9, centos-stream9, fedora4x
|
# rhl: almalinux8, almalinux9, centos-streamX, fedora4x
|
||||||
# debian: debian12, debian13, ubuntu22, ubuntu24
|
# debian: debian12, debian13, ubuntu22, ubuntu24
|
||||||
# misc: archlinux, tumbleweed
|
# misc: archlinux, tumbleweed
|
||||||
# FreeBSD variants of 2025-06:
|
# FreeBSD variants of november 2025:
|
||||||
# FreeBSD Release: freebsd13-5r, freebsd14-2r, freebsd14-3r
|
# FreeBSD Release: freebsd13-5r, freebsd14-3r, freebsd15-0r
|
||||||
# FreeBSD Stable: freebsd13-5s, freebsd14-3s
|
# FreeBSD Stable: freebsd13-5s, freebsd14-3s, freebsd15-0s
|
||||||
# FreeBSD Current: freebsd15-0c
|
# FreeBSD Current: freebsd16-0c
|
||||||
os: ${{ fromJson(needs.test-config.outputs.test_os) }}
|
os: ${{ fromJson(needs.test-config.outputs.test_os) }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
@ -78,7 +95,7 @@ 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: 60
|
||||||
run: .github/workflows/scripts/qemu-1-setup.sh
|
run: .github/workflows/scripts/qemu-1-setup.sh
|
||||||
|
|
||||||
- name: Start build machine
|
- name: Start build machine
|
||||||
@ -86,7 +103,7 @@ jobs:
|
|||||||
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }}
|
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 60
|
||||||
run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} ${{ github.event.inputs.fedora_kernel_ver }}
|
run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} ${{ github.event.inputs.fedora_kernel_ver }}
|
||||||
|
|
||||||
- name: Build modules
|
- name: Build modules
|
||||||
|
|||||||
8
.mailmap
8
.mailmap
@ -53,6 +53,7 @@ Jason Harmening <jason.harmening@gmail.com>
|
|||||||
Jeremy Faulkner <gldisater@gmail.com>
|
Jeremy Faulkner <gldisater@gmail.com>
|
||||||
Jinshan Xiong <jinshan.xiong@gmail.com>
|
Jinshan Xiong <jinshan.xiong@gmail.com>
|
||||||
John Poduska <jpoduska@datto.com>
|
John Poduska <jpoduska@datto.com>
|
||||||
|
Jo Zzsi <jozzsicsataban@gmail.com>
|
||||||
Justin Scholz <git@justinscholz.de>
|
Justin Scholz <git@justinscholz.de>
|
||||||
Ka Ho Ng <khng300@gmail.com>
|
Ka Ho Ng <khng300@gmail.com>
|
||||||
Kash Pande <github@tripleback.net>
|
Kash Pande <github@tripleback.net>
|
||||||
@ -67,6 +68,7 @@ Michael Gmelin <grembo@FreeBSD.org>
|
|||||||
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
||||||
Piotr Kubaj <pkubaj@anongoth.pl>
|
Piotr Kubaj <pkubaj@anongoth.pl>
|
||||||
Quentin Zdanis <zdanisq@gmail.com>
|
Quentin Zdanis <zdanisq@gmail.com>
|
||||||
|
Roberto Ricci <io@r-ricci.it>
|
||||||
Roberto Ricci <ricci@disroot.org>
|
Roberto Ricci <ricci@disroot.org>
|
||||||
Rob Norris <robn@despairlabs.com>
|
Rob Norris <robn@despairlabs.com>
|
||||||
Rob Norris <rob.norris@klarasystems.com>
|
Rob Norris <rob.norris@klarasystems.com>
|
||||||
@ -83,7 +85,10 @@ Youzhong Yang <youzhong@gmail.com>
|
|||||||
# Signed-off-by: overriding Author:
|
# Signed-off-by: overriding Author:
|
||||||
Alexander Ziaee <ziaee@FreeBSD.org> <concussious@runbox.com>
|
Alexander Ziaee <ziaee@FreeBSD.org> <concussious@runbox.com>
|
||||||
Felix Schmidt <felixschmidt20@aol.com> <f.sch.prototype@gmail.com>
|
Felix Schmidt <felixschmidt20@aol.com> <f.sch.prototype@gmail.com>
|
||||||
|
Jean-Sébastien Pédron <dumbbell@FreeBSD.org> <jean-sebastien.pedron@dumbbell.fr>
|
||||||
|
Konstantin Belousov <kib@FreeBSD.org> <kib@kib.kiev.ua>
|
||||||
Olivier Certner <olce@FreeBSD.org> <olce.freebsd@certner.fr>
|
Olivier Certner <olce@FreeBSD.org> <olce.freebsd@certner.fr>
|
||||||
|
Patrick Xia <patrickx@google.com> <octalc0de@aim.com>
|
||||||
Phil Sutter <phil@nwl.cc> <p.github@nwl.cc>
|
Phil Sutter <phil@nwl.cc> <p.github@nwl.cc>
|
||||||
poscat <poscat@poscat.moe> <poscat0x04@outlook.com>
|
poscat <poscat@poscat.moe> <poscat0x04@outlook.com>
|
||||||
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
||||||
@ -125,6 +130,7 @@ buzzingwires <buzzingwires@outlook.com> <131118055+buzzingwires@users.noreply.gi
|
|||||||
Cedric Maunoury <cedric.maunoury@gmail.com> <38213715+cedricmaunoury@users.noreply.github.com>
|
Cedric Maunoury <cedric.maunoury@gmail.com> <38213715+cedricmaunoury@users.noreply.github.com>
|
||||||
Charles Suh <charles.suh@gmail.com> <charlessuh@users.noreply.github.com>
|
Charles Suh <charles.suh@gmail.com> <charlessuh@users.noreply.github.com>
|
||||||
Chris Peredun <chris.peredun@ixsystems.com> <126915832+chrisperedun@users.noreply.github.com>
|
Chris Peredun <chris.peredun@ixsystems.com> <126915832+chrisperedun@users.noreply.github.com>
|
||||||
|
classabbyamp <dev@placeviolette.net> <5366828+classabbyamp@users.noreply.github.com>
|
||||||
Dacian Reece-Stremtan <dacianstremtan@gmail.com> <35844628+dacianstremtan@users.noreply.github.com>
|
Dacian Reece-Stremtan <dacianstremtan@gmail.com> <35844628+dacianstremtan@users.noreply.github.com>
|
||||||
Damian Szuberski <szuberskidamian@gmail.com> <30863496+szubersk@users.noreply.github.com>
|
Damian Szuberski <szuberskidamian@gmail.com> <30863496+szubersk@users.noreply.github.com>
|
||||||
Daniel Hiepler <d-git@coderdu.de> <32984777+heeplr@users.noreply.github.com>
|
Daniel Hiepler <d-git@coderdu.de> <32984777+heeplr@users.noreply.github.com>
|
||||||
@ -185,6 +191,7 @@ Michael Niewöhner <foss@mniewoehner.de> <c0d3z3r0@users.noreply.github.com>
|
|||||||
Michael Zhivich <mzhivich@akamai.com> <33133421+mzhivich@users.noreply.github.com>
|
Michael Zhivich <mzhivich@akamai.com> <33133421+mzhivich@users.noreply.github.com>
|
||||||
MigeljanImeri <ImeriMigel@gmail.com> <78048439+MigeljanImeri@users.noreply.github.com>
|
MigeljanImeri <ImeriMigel@gmail.com> <78048439+MigeljanImeri@users.noreply.github.com>
|
||||||
Mo Zhou <cdluminate@gmail.com> <5723047+cdluminate@users.noreply.github.com>
|
Mo Zhou <cdluminate@gmail.com> <5723047+cdluminate@users.noreply.github.com>
|
||||||
|
nav1s <nav1s@proton.me> <42621369+nav1s@users.noreply.github.com>
|
||||||
Nick Mattis <nickm970@gmail.com> <nmattis@users.noreply.github.com>
|
Nick Mattis <nickm970@gmail.com> <nmattis@users.noreply.github.com>
|
||||||
omni <omni+vagant@hack.org> <79493359+omnivagant@users.noreply.github.com>
|
omni <omni+vagant@hack.org> <79493359+omnivagant@users.noreply.github.com>
|
||||||
Pablo Correa Gómez <ablocorrea@hotmail.com> <32678034+pablofsf@users.noreply.github.com>
|
Pablo Correa Gómez <ablocorrea@hotmail.com> <32678034+pablofsf@users.noreply.github.com>
|
||||||
@ -206,6 +213,7 @@ Samuel Wycliffe <samuelwycliffe@gmail.com> <50765275+npc203@users.noreply.github
|
|||||||
Savyasachee Jha <hi@savyasacheejha.com> <savyajha@users.noreply.github.com>
|
Savyasachee Jha <hi@savyasacheejha.com> <savyajha@users.noreply.github.com>
|
||||||
Scott Colby <scott@scolby.com> <scolby33@users.noreply.github.com>
|
Scott Colby <scott@scolby.com> <scolby33@users.noreply.github.com>
|
||||||
Sean Eric Fagan <kithrup@mac.com> <kithrup@users.noreply.github.com>
|
Sean Eric Fagan <kithrup@mac.com> <kithrup@users.noreply.github.com>
|
||||||
|
Shreshth Srivastava <shreshthsrivastava2@gmail.com> <66148173+Shreshth3@users.noreply.github.com>
|
||||||
Spencer Kinny <spencerkinny1995@gmail.com> <30333052+Spencer-Kinny@users.noreply.github.com>
|
Spencer Kinny <spencerkinny1995@gmail.com> <30333052+Spencer-Kinny@users.noreply.github.com>
|
||||||
Srikanth N S <srikanth.nagasubbaraoseetharaman@hpe.com> <75025422+nssrikanth@users.noreply.github.com>
|
Srikanth N S <srikanth.nagasubbaraoseetharaman@hpe.com> <75025422+nssrikanth@users.noreply.github.com>
|
||||||
Stefan Lendl <s.lendl@proxmox.com> <1321542+stfl@users.noreply.github.com>
|
Stefan Lendl <s.lendl@proxmox.com> <1321542+stfl@users.noreply.github.com>
|
||||||
|
|||||||
14
AUTHORS
14
AUTHORS
@ -154,6 +154,7 @@ CONTRIBUTORS:
|
|||||||
Chris Zubrzycki <github@mid-earth.net>
|
Chris Zubrzycki <github@mid-earth.net>
|
||||||
Chuck Tuffli <ctuffli@gmail.com>
|
Chuck Tuffli <ctuffli@gmail.com>
|
||||||
Chunwei Chen <david.chen@nutanix.com>
|
Chunwei Chen <david.chen@nutanix.com>
|
||||||
|
classabbyamp <dev@placeviolette.net>
|
||||||
Clemens Fruhwirth <clemens@endorphin.org>
|
Clemens Fruhwirth <clemens@endorphin.org>
|
||||||
Clemens Lang <cl@clang.name>
|
Clemens Lang <cl@clang.name>
|
||||||
Clint Armstrong <clint@clintarmstrong.net>
|
Clint Armstrong <clint@clintarmstrong.net>
|
||||||
@ -161,6 +162,7 @@ CONTRIBUTORS:
|
|||||||
Colin Ian King <colin.king@canonical.com>
|
Colin Ian King <colin.king@canonical.com>
|
||||||
Colin Percival <cperciva@tarsnap.com>
|
Colin Percival <cperciva@tarsnap.com>
|
||||||
Colm Buckley <colm@tuatha.org>
|
Colm Buckley <colm@tuatha.org>
|
||||||
|
Cong Zhang <congzhangzh@users.noreply.github.com>
|
||||||
Crag Wang <crag0715@gmail.com>
|
Crag Wang <crag0715@gmail.com>
|
||||||
Craig Loomis <cloomis@astro.princeton.edu>
|
Craig Loomis <cloomis@astro.princeton.edu>
|
||||||
Craig Sanders <github@taz.net.au>
|
Craig Sanders <github@taz.net.au>
|
||||||
@ -217,6 +219,7 @@ CONTRIBUTORS:
|
|||||||
Eitan Adler <lists@eitanadler.com>
|
Eitan Adler <lists@eitanadler.com>
|
||||||
Eli Rosenthal <eli.rosenthal@delphix.com>
|
Eli Rosenthal <eli.rosenthal@delphix.com>
|
||||||
Eli Schwartz <eschwartz93@gmail.com>
|
Eli Schwartz <eschwartz93@gmail.com>
|
||||||
|
Eric A. Borisch <eborisch@gmail.com>
|
||||||
Eric Desrochers <eric.desrochers@canonical.com>
|
Eric Desrochers <eric.desrochers@canonical.com>
|
||||||
Eric Dillmann <eric@jave.fr>
|
Eric Dillmann <eric@jave.fr>
|
||||||
Eric Schrock <Eric.Schrock@delphix.com>
|
Eric Schrock <Eric.Schrock@delphix.com>
|
||||||
@ -288,6 +291,7 @@ CONTRIBUTORS:
|
|||||||
Henrik Riomar <henrik.riomar@gmail.com>
|
Henrik Riomar <henrik.riomar@gmail.com>
|
||||||
Herb Wartens <wartens2@llnl.gov>
|
Herb Wartens <wartens2@llnl.gov>
|
||||||
Hiếu Lê <leorize+oss@disroot.org>
|
Hiếu Lê <leorize+oss@disroot.org>
|
||||||
|
hoshinomori <hoshinomorimorimo@gmail.com>
|
||||||
Huang Liu <liu.huang@zte.com.cn>
|
Huang Liu <liu.huang@zte.com.cn>
|
||||||
Håkan Johansson <f96hajo@chalmers.se>
|
Håkan Johansson <f96hajo@chalmers.se>
|
||||||
Igor K <igor@dilos.org>
|
Igor K <igor@dilos.org>
|
||||||
@ -300,6 +304,7 @@ CONTRIBUTORS:
|
|||||||
ilovezfs <ilovezfs@icloud.com>
|
ilovezfs <ilovezfs@icloud.com>
|
||||||
InsanePrawn <Insane.Prawny@gmail.com>
|
InsanePrawn <Insane.Prawny@gmail.com>
|
||||||
Isaac Huang <he.huang@intel.com>
|
Isaac Huang <he.huang@intel.com>
|
||||||
|
Ivan Shapovalov <intelfx@intelfx.name>
|
||||||
Ivan Volosyuk <Ivan.Volosyuk@gmail.com>
|
Ivan Volosyuk <Ivan.Volosyuk@gmail.com>
|
||||||
Jacek Fefliński <feflik@gmail.com>
|
Jacek Fefliński <feflik@gmail.com>
|
||||||
Jacob Adams <tookmund@gmail.com>
|
Jacob Adams <tookmund@gmail.com>
|
||||||
@ -322,6 +327,7 @@ CONTRIBUTORS:
|
|||||||
Javen Wu <wu.javen@gmail.com>
|
Javen Wu <wu.javen@gmail.com>
|
||||||
Jaydeep Kshirsagar <jkshirsagar@maxlinear.com>
|
Jaydeep Kshirsagar <jkshirsagar@maxlinear.com>
|
||||||
Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
|
Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
|
||||||
|
Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
|
||||||
Jeff Dike <jdike@akamai.com>
|
Jeff Dike <jdike@akamai.com>
|
||||||
Jeremy Faulkner <gldisater@gmail.com>
|
Jeremy Faulkner <gldisater@gmail.com>
|
||||||
Jeremy Gill <jgill@parallax-innovations.com>
|
Jeremy Gill <jgill@parallax-innovations.com>
|
||||||
@ -355,7 +361,9 @@ CONTRIBUTORS:
|
|||||||
Josh Soref <jsoref@users.noreply.github.com>
|
Josh Soref <jsoref@users.noreply.github.com>
|
||||||
Joshua M. Clulow <josh@sysmgr.org>
|
Joshua M. Clulow <josh@sysmgr.org>
|
||||||
José Luis Salvador Rufo <salvador.joseluis@gmail.com>
|
José Luis Salvador Rufo <salvador.joseluis@gmail.com>
|
||||||
|
Jo Zzsi <jozzsicsataban@gmail.com>
|
||||||
João Carlos Mendes Luís <jonny@jonny.eng.br>
|
João Carlos Mendes Luís <jonny@jonny.eng.br>
|
||||||
|
JT Pennington <jt.pennington@klarasystems.com>
|
||||||
Julian Brunner <julian.brunner@gmail.com>
|
Julian Brunner <julian.brunner@gmail.com>
|
||||||
Julian Heuking <JulianH@beckhoff.com>
|
Julian Heuking <JulianH@beckhoff.com>
|
||||||
jumbi77 <jumbi77@users.noreply.github.com>
|
jumbi77 <jumbi77@users.noreply.github.com>
|
||||||
@ -388,6 +396,7 @@ CONTRIBUTORS:
|
|||||||
Kleber Tarcísio <klebertarcisio@yahoo.com.br>
|
Kleber Tarcísio <klebertarcisio@yahoo.com.br>
|
||||||
Kody A Kantor <kody.kantor@gmail.com>
|
Kody A Kantor <kody.kantor@gmail.com>
|
||||||
Kohsuke Kawaguchi <kk@kohsuke.org>
|
Kohsuke Kawaguchi <kk@kohsuke.org>
|
||||||
|
Konstantin Belousov <kib@FreeBSD.org>
|
||||||
Konstantin Khorenko <khorenko@virtuozzo.com>
|
Konstantin Khorenko <khorenko@virtuozzo.com>
|
||||||
KORN Andras <korn@elan.rulez.org>
|
KORN Andras <korn@elan.rulez.org>
|
||||||
kotauskas <v.toncharov@gmail.com>
|
kotauskas <v.toncharov@gmail.com>
|
||||||
@ -416,6 +425,7 @@ CONTRIBUTORS:
|
|||||||
luozhengzheng <luo.zhengzheng@zte.com.cn>
|
luozhengzheng <luo.zhengzheng@zte.com.cn>
|
||||||
Luís Henriques <henrix@camandro.org>
|
Luís Henriques <henrix@camandro.org>
|
||||||
Madhav Suresh <madhav.suresh@delphix.com>
|
Madhav Suresh <madhav.suresh@delphix.com>
|
||||||
|
Maksym Shkolnyi <maksym.shkolnyi@workato.com>
|
||||||
manfromafar <jonsonb10@gmail.com>
|
manfromafar <jonsonb10@gmail.com>
|
||||||
Manoj Joseph <manoj.joseph@delphix.com>
|
Manoj Joseph <manoj.joseph@delphix.com>
|
||||||
Manuel Amador (Rudd-O) <rudd-o@rudd-o.com>
|
Manuel Amador (Rudd-O) <rudd-o@rudd-o.com>
|
||||||
@ -482,6 +492,7 @@ CONTRIBUTORS:
|
|||||||
Nathaniel Clark <Nathaniel.Clark@misrule.us>
|
Nathaniel Clark <Nathaniel.Clark@misrule.us>
|
||||||
Nathaniel Wesley Filardo <nwf@cs.jhu.edu>
|
Nathaniel Wesley Filardo <nwf@cs.jhu.edu>
|
||||||
Nathan Lewis <linux.robotdude@gmail.com>
|
Nathan Lewis <linux.robotdude@gmail.com>
|
||||||
|
nav1s <nav1s@proton.me>
|
||||||
Nav Ravindranath <nav@delphix.com>
|
Nav Ravindranath <nav@delphix.com>
|
||||||
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
|
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
|
||||||
Ned Bass <bass6@llnl.gov>
|
Ned Bass <bass6@llnl.gov>
|
||||||
@ -506,6 +517,7 @@ CONTRIBUTORS:
|
|||||||
Palash Gandhi <pbg4930@rit.edu>
|
Palash Gandhi <pbg4930@rit.edu>
|
||||||
Patrick Fasano <patrick@patrickfasano.com>
|
Patrick Fasano <patrick@patrickfasano.com>
|
||||||
Patrick Mooney <pmooney@pfmooney.com>
|
Patrick Mooney <pmooney@pfmooney.com>
|
||||||
|
Patrick Xia <patrickx@google.com>
|
||||||
Patrik Greco <sikevux@sikevux.se>
|
Patrik Greco <sikevux@sikevux.se>
|
||||||
Paul B. Henson <henson@acm.org>
|
Paul B. Henson <henson@acm.org>
|
||||||
Paul Dagnelie <pcd@delphix.com>
|
Paul Dagnelie <pcd@delphix.com>
|
||||||
@ -605,6 +617,7 @@ CONTRIBUTORS:
|
|||||||
Shengqi Chen <harry-chen@outlook.com>
|
Shengqi Chen <harry-chen@outlook.com>
|
||||||
SHENGYI HONG <aokblast@FreeBSD.org>
|
SHENGYI HONG <aokblast@FreeBSD.org>
|
||||||
Shen Yan <shenyanxxxy@qq.com>
|
Shen Yan <shenyanxxxy@qq.com>
|
||||||
|
Shreshth Srivastava <shreshthsrivastava2@gmail.com>
|
||||||
Sietse <sietse@wizdom.nu>
|
Sietse <sietse@wizdom.nu>
|
||||||
Simon Guest <simon.guest@tesujimath.org>
|
Simon Guest <simon.guest@tesujimath.org>
|
||||||
Simon Howard <fraggle@soulsphere.org>
|
Simon Howard <fraggle@soulsphere.org>
|
||||||
@ -665,6 +678,7 @@ CONTRIBUTORS:
|
|||||||
Toyam Cox <aviator45003@gmail.com>
|
Toyam Cox <aviator45003@gmail.com>
|
||||||
Trevor Bautista <trevrb@trevrb.net>
|
Trevor Bautista <trevrb@trevrb.net>
|
||||||
Trey Dockendorf <treydock@gmail.com>
|
Trey Dockendorf <treydock@gmail.com>
|
||||||
|
trick2011 <trick2011@users.noreply.github.com>
|
||||||
Troels Nørgaard <tnn@tradeshift.com>
|
Troels Nørgaard <tnn@tradeshift.com>
|
||||||
tstabrawa <tstabrawa@users.noreply.github.com>
|
tstabrawa <tstabrawa@users.noreply.github.com>
|
||||||
Tulsi Jain <tulsi.jain@delphix.com>
|
Tulsi Jain <tulsi.jain@delphix.com>
|
||||||
|
|||||||
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.1
|
||||||
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.19
|
||||||
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)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ This repository contains the code for running OpenZFS on Linux and FreeBSD.
|
|||||||
# Official Resources
|
# Official Resources
|
||||||
|
|
||||||
* [Documentation](https://openzfs.github.io/openzfs-docs/) - for using and developing this repo
|
* [Documentation](https://openzfs.github.io/openzfs-docs/) - for using and developing this repo
|
||||||
* [ZoL Site](https://zfsonlinux.org) - Linux release info & links
|
* [ZoL site](https://zfsonlinux.org) - Linux release info & links
|
||||||
* [Mailing lists](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/Mailing%20Lists.html)
|
* [Mailing lists](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/Mailing%20Lists.html)
|
||||||
* [OpenZFS site](https://openzfs.org/) - for conference videos and info on other platforms (illumos, OSX, Windows, etc)
|
* [OpenZFS site](https://openzfs.org/) - for conference videos and info on other platforms (illumos, OSX, Windows, etc)
|
||||||
|
|
||||||
|
|||||||
61
autogen.sh
61
autogen.sh
@ -1,62 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ "${0%/*}" = "$0" ] || cd "${0%/*}" || exit
|
|
||||||
|
|
||||||
# %reldir%/%canon_reldir% (%D%/%C%) only appeared in automake 1.14, but RHEL/CentOS 7 has 1.13.4
|
autoreconf -fiv "$(dirname "$0")" && rm -rf "$(dirname "$0")"/autom4te.cache
|
||||||
# This is an (overly) simplistic preprocessor that papers around this for the duration of the generation step,
|
|
||||||
# and can be removed once support for CentOS 7 is dropped
|
|
||||||
automake --version | awk '{print $NF; exit}' | (
|
|
||||||
IFS=. read -r AM_MAJ AM_MIN _
|
|
||||||
[ "$AM_MAJ" -gt 1 ] || [ "$AM_MIN" -ge 14 ]
|
|
||||||
) || {
|
|
||||||
process_root() {
|
|
||||||
root="$1"; shift
|
|
||||||
|
|
||||||
grep -q '%[CD]%' "$root/Makefile.am" || return
|
|
||||||
find "$root" -name Makefile.am "$@" | while read -r dir; do
|
|
||||||
dir="${dir%/Makefile.am}"
|
|
||||||
grep -q '%[CD]%' "$dir/Makefile.am" || continue
|
|
||||||
|
|
||||||
reldir="${dir#"$root"}"
|
|
||||||
reldir="${reldir#/}"
|
|
||||||
|
|
||||||
canon_reldir="$(printf '%s' "$reldir" | tr -C 'a-zA-Z0-9@_' '_')"
|
|
||||||
|
|
||||||
reldir_slash="$reldir/"
|
|
||||||
canon_reldir_slash="${canon_reldir}_"
|
|
||||||
[ -z "$reldir" ] && reldir_slash=
|
|
||||||
[ -z "$reldir" ] && canon_reldir_slash=
|
|
||||||
|
|
||||||
echo "$dir/Makefile.am" >&3
|
|
||||||
sed -i~ -e "s:%D%/:$reldir_slash:g" -e "s:%D%:$reldir:g" \
|
|
||||||
-e "s:%C%_:$canon_reldir_slash:g" -e "s:%C%:$canon_reldir:g" "$dir/Makefile.am"
|
|
||||||
done 3>>"$substituted_files"
|
|
||||||
}
|
|
||||||
|
|
||||||
rollback() {
|
|
||||||
while read -r f; do
|
|
||||||
mv "$f~" "$f"
|
|
||||||
done < "$substituted_files"
|
|
||||||
rm -f "$substituted_files"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo "Automake <1.14; papering over missing %reldir%/%canon_reldir% support" >&2
|
|
||||||
|
|
||||||
substituted_files="$(mktemp)"
|
|
||||||
trap rollback EXIT
|
|
||||||
|
|
||||||
roots="$(sed '/Makefile$/!d;/module/d;s:^\s*:./:;s:/Makefile::;/^\.$/d' configure.ac)"
|
|
||||||
|
|
||||||
IFS="
|
|
||||||
"
|
|
||||||
for root in $roots; do
|
|
||||||
root="${root#./}"
|
|
||||||
process_root "$root"
|
|
||||||
done
|
|
||||||
|
|
||||||
set -f
|
|
||||||
# shellcheck disable=SC2086,SC2046
|
|
||||||
process_root . $(printf '!\n-path\n%s/*\n' $roots)
|
|
||||||
}
|
|
||||||
|
|
||||||
autoreconf -fiv && rm -rf autom4te.cache
|
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -264,9 +264,21 @@ cmp_data(raidz_test_opts_t *opts, raidz_map_t *rm)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
init_rand(void *data, size_t size, void *private)
|
init_rand(void *data, size_t size, void *private)
|
||||||
|
{
|
||||||
|
size_t *offsetp = (size_t *)private;
|
||||||
|
size_t offset = *offsetp;
|
||||||
|
|
||||||
|
VERIFY3U(offset + size, <=, SPA_MAXBLOCKSIZE);
|
||||||
|
memcpy(data, (char *)rand_data + offset, size);
|
||||||
|
*offsetp = offset + size;
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
corrupt_rand_fill(void *data, size_t size, void *private)
|
||||||
{
|
{
|
||||||
(void) private;
|
(void) private;
|
||||||
memcpy(data, rand_data, size);
|
memset(data, 0xAA, size);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +290,7 @@ corrupt_colums(raidz_map_t *rm, const int *tgts, const int cnt)
|
|||||||
for (int i = 0; i < cnt; i++) {
|
for (int i = 0; i < cnt; i++) {
|
||||||
raidz_col_t *col = &rr->rr_col[tgts[i]];
|
raidz_col_t *col = &rr->rr_col[tgts[i]];
|
||||||
abd_iterate_func(col->rc_abd, 0, col->rc_size,
|
abd_iterate_func(col->rc_abd, 0, col->rc_size,
|
||||||
init_rand, NULL);
|
corrupt_rand_fill, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,7 +298,8 @@ corrupt_colums(raidz_map_t *rm, const int *tgts, const int cnt)
|
|||||||
void
|
void
|
||||||
init_zio_abd(zio_t *zio)
|
init_zio_abd(zio_t *zio)
|
||||||
{
|
{
|
||||||
abd_iterate_func(zio->io_abd, 0, zio->io_size, init_rand, NULL);
|
size_t offset = 0;
|
||||||
|
abd_iterate_func(zio->io_abd, 0, zio->io_size, init_rand, &offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -373,7 +386,7 @@ init_raidz_map(raidz_test_opts_t *opts, zio_t **zio, const int parity)
|
|||||||
|
|
||||||
*zio = umem_zalloc(sizeof (zio_t), UMEM_NOFAIL);
|
*zio = umem_zalloc(sizeof (zio_t), UMEM_NOFAIL);
|
||||||
|
|
||||||
(*zio)->io_offset = 0;
|
(*zio)->io_offset = opts->rto_offset;
|
||||||
(*zio)->io_size = alloc_dsize;
|
(*zio)->io_size = alloc_dsize;
|
||||||
(*zio)->io_abd = raidz_alloc(alloc_dsize);
|
(*zio)->io_abd = raidz_alloc(alloc_dsize);
|
||||||
init_zio_abd(*zio);
|
init_zio_abd(*zio);
|
||||||
@ -834,6 +847,8 @@ main(int argc, char **argv)
|
|||||||
err = run_test(NULL);
|
err = run_test(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mprotect(rand_data, SPA_MAXBLOCKSIZE, PROT_READ | PROT_WRITE);
|
||||||
|
|
||||||
umem_free(rand_data, SPA_MAXBLOCKSIZE);
|
umem_free(rand_data, SPA_MAXBLOCKSIZE);
|
||||||
kernel_fini();
|
kernel_fini();
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,7 @@ typedef struct raidz_test_opts {
|
|||||||
|
|
||||||
static const raidz_test_opts_t rto_opts_defaults = {
|
static const raidz_test_opts_t rto_opts_defaults = {
|
||||||
.rto_ashift = 9,
|
.rto_ashift = 9,
|
||||||
.rto_offset = 1ULL << 0,
|
.rto_offset = 0,
|
||||||
.rto_dcols = 8,
|
.rto_dcols = 8,
|
||||||
.rto_dsize = 1<<19,
|
.rto_dsize = 1<<19,
|
||||||
.rto_v = D_ALL,
|
.rto_v = D_ALL,
|
||||||
|
|||||||
@ -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)
|
||||||
271
cmd/zdb/zdb.c
271
cmd/zdb/zdb.c
@ -106,8 +106,14 @@ extern boolean_t spa_mode_readable_spacemaps;
|
|||||||
extern uint_t zfs_reconstruct_indirect_combinations_max;
|
extern uint_t zfs_reconstruct_indirect_combinations_max;
|
||||||
extern uint_t zfs_btree_verify_intensity;
|
extern uint_t zfs_btree_verify_intensity;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
ARG_ALLOCATED = 256,
|
||||||
|
ARG_BLOCK_BIN_MODE,
|
||||||
|
ARG_BLOCK_CLASSES,
|
||||||
|
};
|
||||||
|
|
||||||
static const char cmdname[] = "zdb";
|
static const char cmdname[] = "zdb";
|
||||||
uint8_t dump_opt[256];
|
uint8_t dump_opt[512];
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
@ -129,6 +135,20 @@ static objset_t *os;
|
|||||||
static boolean_t kernel_init_done;
|
static boolean_t kernel_init_done;
|
||||||
static boolean_t corruption_found = B_FALSE;
|
static boolean_t corruption_found = B_FALSE;
|
||||||
|
|
||||||
|
static enum {
|
||||||
|
BIN_AUTO = 0,
|
||||||
|
BIN_PSIZE,
|
||||||
|
BIN_LSIZE,
|
||||||
|
BIN_ASIZE,
|
||||||
|
} block_bin_mode = BIN_AUTO;
|
||||||
|
|
||||||
|
static enum {
|
||||||
|
CLASS_NORMAL = 1 << 1,
|
||||||
|
CLASS_SPECIAL = 1 << 2,
|
||||||
|
CLASS_DEDUP = 1 << 3,
|
||||||
|
CLASS_OTHER = 1 << 4,
|
||||||
|
} block_classes = 0;
|
||||||
|
|
||||||
static void snprintf_blkptr_compact(char *, size_t, const blkptr_t *,
|
static void snprintf_blkptr_compact(char *, size_t, const blkptr_t *,
|
||||||
boolean_t);
|
boolean_t);
|
||||||
static void mos_obj_refd(uint64_t);
|
static void mos_obj_refd(uint64_t);
|
||||||
@ -383,7 +403,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;
|
||||||
|
|
||||||
@ -718,13 +738,14 @@ usage(void)
|
|||||||
"[-U <cache>]\n\t\t<poolname> [<vdev> [<metaslab> ...]]\n"
|
"[-U <cache>]\n\t\t<poolname> [<vdev> [<metaslab> ...]]\n"
|
||||||
"\t%s -O [-K <key>] <dataset> <path>\n"
|
"\t%s -O [-K <key>] <dataset> <path>\n"
|
||||||
"\t%s -r [-K <key>] <dataset> <path> <destination>\n"
|
"\t%s -r [-K <key>] <dataset> <path> <destination>\n"
|
||||||
|
"\t%s -r [-K <key>] -O <dataset> <object-id> <destination>\n"
|
||||||
"\t%s -R [-A] [-e [-V] [-p <path> ...]] [-U <cache>]\n"
|
"\t%s -R [-A] [-e [-V] [-p <path> ...]] [-U <cache>]\n"
|
||||||
"\t\t<poolname> <vdev>:<offset>:<size>[:<flags>]\n"
|
"\t\t<poolname> <vdev>:<offset>:<size>[:<flags>]\n"
|
||||||
"\t%s -E [-A] word0:word1:...:word15\n"
|
"\t%s -E [-A] word0:word1:...:word15\n"
|
||||||
"\t%s -S [-AP] [-e [-V] [-p <path> ...]] [-U <cache>] "
|
"\t%s -S [-AP] [-e [-V] [-p <path> ...]] [-U <cache>] "
|
||||||
"<poolname>\n\n",
|
"<poolname>\n\n",
|
||||||
cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname,
|
cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname,
|
||||||
cmdname, cmdname, cmdname, cmdname, cmdname);
|
cmdname, cmdname, cmdname, cmdname, cmdname, cmdname);
|
||||||
|
|
||||||
(void) fprintf(stderr, " Dataset name must include at least one "
|
(void) fprintf(stderr, " Dataset name must include at least one "
|
||||||
"separator character '/' or '@'\n");
|
"separator character '/' or '@'\n");
|
||||||
@ -747,6 +768,12 @@ usage(void)
|
|||||||
(void) fprintf(stderr, " Options to control amount of output:\n");
|
(void) fprintf(stderr, " Options to control amount of output:\n");
|
||||||
(void) fprintf(stderr, " -b --block-stats "
|
(void) fprintf(stderr, " -b --block-stats "
|
||||||
"block statistics\n");
|
"block statistics\n");
|
||||||
|
(void) fprintf(stderr, " --bin=(lsize|psize|asize) "
|
||||||
|
"bin blocks based on this size in all three columns\n");
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
" --class=(normal|special|dedup|other)[,...]\n"
|
||||||
|
" only consider blocks from "
|
||||||
|
"these allocation classes\n");
|
||||||
(void) fprintf(stderr, " -B --backup "
|
(void) fprintf(stderr, " -B --backup "
|
||||||
"backup stream\n");
|
"backup stream\n");
|
||||||
(void) fprintf(stderr, " -c --checksum "
|
(void) fprintf(stderr, " -c --checksum "
|
||||||
@ -1666,6 +1693,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 +1719,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[ARG_ALLOCATED] ||
|
||||||
|
(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[ARG_ALLOCATED]) {
|
||||||
|
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 +1751,12 @@ dump_metaslab(metaslab_t *msp)
|
|||||||
SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift);
|
SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dump_opt[ARG_ALLOCATED] ||
|
||||||
|
(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 +1793,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 +2689,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 +2743,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 +3326,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 +3359,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);
|
||||||
@ -5764,6 +5839,34 @@ dump_size_histograms(zdb_cb_t *zcb)
|
|||||||
|
|
||||||
|
|
||||||
(void) printf("\nBlock Size Histogram\n");
|
(void) printf("\nBlock Size Histogram\n");
|
||||||
|
switch (block_bin_mode) {
|
||||||
|
case BIN_PSIZE:
|
||||||
|
printf("(note: all categories are binned by %s)\n", "psize");
|
||||||
|
break;
|
||||||
|
case BIN_LSIZE:
|
||||||
|
printf("(note: all categories are binned by %s)\n", "lsize");
|
||||||
|
break;
|
||||||
|
case BIN_ASIZE:
|
||||||
|
printf("(note: all categories are binned by %s)\n", "asize");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printf("(note: all categories are binned separately)\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (block_classes != 0) {
|
||||||
|
char buf[256] = "";
|
||||||
|
if (block_classes & CLASS_NORMAL)
|
||||||
|
strlcat(buf, "\"normal\", ", sizeof (buf));
|
||||||
|
if (block_classes & CLASS_SPECIAL)
|
||||||
|
strlcat(buf, "\"special\", ", sizeof (buf));
|
||||||
|
if (block_classes & CLASS_DEDUP)
|
||||||
|
strlcat(buf, "\"dedup\", ", sizeof (buf));
|
||||||
|
if (block_classes & CLASS_OTHER)
|
||||||
|
strlcat(buf, "\"other\", ", sizeof (buf));
|
||||||
|
buf[strlen(buf)-2] = '\0';
|
||||||
|
printf("(note: only blocks in these classes are counted: %s)\n",
|
||||||
|
buf);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Print the first line titles
|
* Print the first line titles
|
||||||
*/
|
*/
|
||||||
@ -6112,29 +6215,85 @@ skipped:
|
|||||||
[BPE_GET_PSIZE(bp)]++;
|
[BPE_GET_PSIZE(bp)]++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (block_classes != 0) {
|
||||||
|
spa_config_enter(zcb->zcb_spa, SCL_CONFIG, FTAG, RW_READER);
|
||||||
|
|
||||||
|
uint64_t vdev = DVA_GET_VDEV(&bp->blk_dva[0]);
|
||||||
|
uint64_t offset = DVA_GET_OFFSET(&bp->blk_dva[0]);
|
||||||
|
vdev_t *vd = vdev_lookup_top(zcb->zcb_spa, vdev);
|
||||||
|
ASSERT(vd != NULL);
|
||||||
|
metaslab_t *ms = vd->vdev_ms[offset >> vd->vdev_ms_shift];
|
||||||
|
ASSERT(ms != NULL);
|
||||||
|
metaslab_group_t *mg = ms->ms_group;
|
||||||
|
ASSERT(mg != NULL);
|
||||||
|
metaslab_class_t *mc = mg->mg_class;
|
||||||
|
ASSERT(mc != NULL);
|
||||||
|
|
||||||
|
spa_config_exit(zcb->zcb_spa, SCL_CONFIG, FTAG);
|
||||||
|
|
||||||
|
int class;
|
||||||
|
if (mc == spa_normal_class(zcb->zcb_spa)) {
|
||||||
|
class = CLASS_NORMAL;
|
||||||
|
} else if (mc == spa_special_class(zcb->zcb_spa)) {
|
||||||
|
class = CLASS_SPECIAL;
|
||||||
|
} else if (mc == spa_dedup_class(zcb->zcb_spa)) {
|
||||||
|
class = CLASS_DEDUP;
|
||||||
|
} else {
|
||||||
|
class = CLASS_OTHER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(block_classes & class)) {
|
||||||
|
goto hist_skipped;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The binning histogram bins by powers of two up to
|
* The binning histogram bins by powers of two up to
|
||||||
* SPA_MAXBLOCKSIZE rather than creating bins for
|
* SPA_MAXBLOCKSIZE rather than creating bins for
|
||||||
* every possible blocksize found in the pool.
|
* every possible blocksize found in the pool.
|
||||||
*/
|
*/
|
||||||
int bin = highbit64(BP_GET_PSIZE(bp)) - 1;
|
int bin;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Binning strategy: each bin includes blocks up to and including
|
||||||
|
* the given size (excluding blocks that fit into the previous bin).
|
||||||
|
* This way, the "4K" bin includes blocks within the (2K; 4K] range.
|
||||||
|
*/
|
||||||
|
#define BIN(size) (highbit64((size) - 1))
|
||||||
|
|
||||||
|
switch (block_bin_mode) {
|
||||||
|
case BIN_PSIZE: bin = BIN(BP_GET_PSIZE(bp)); break;
|
||||||
|
case BIN_LSIZE: bin = BIN(BP_GET_LSIZE(bp)); break;
|
||||||
|
case BIN_ASIZE: bin = BIN(BP_GET_ASIZE(bp)); break;
|
||||||
|
case BIN_AUTO: break;
|
||||||
|
default: PANIC("bad block_bin_mode"); abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block_bin_mode == BIN_AUTO)
|
||||||
|
bin = BIN(BP_GET_PSIZE(bp));
|
||||||
|
|
||||||
zcb->zcb_psize_count[bin]++;
|
zcb->zcb_psize_count[bin]++;
|
||||||
zcb->zcb_psize_len[bin] += BP_GET_PSIZE(bp);
|
zcb->zcb_psize_len[bin] += BP_GET_PSIZE(bp);
|
||||||
zcb->zcb_psize_total += BP_GET_PSIZE(bp);
|
zcb->zcb_psize_total += BP_GET_PSIZE(bp);
|
||||||
|
|
||||||
bin = highbit64(BP_GET_LSIZE(bp)) - 1;
|
if (block_bin_mode == BIN_AUTO)
|
||||||
|
bin = BIN(BP_GET_LSIZE(bp));
|
||||||
|
|
||||||
zcb->zcb_lsize_count[bin]++;
|
zcb->zcb_lsize_count[bin]++;
|
||||||
zcb->zcb_lsize_len[bin] += BP_GET_LSIZE(bp);
|
zcb->zcb_lsize_len[bin] += BP_GET_LSIZE(bp);
|
||||||
zcb->zcb_lsize_total += BP_GET_LSIZE(bp);
|
zcb->zcb_lsize_total += BP_GET_LSIZE(bp);
|
||||||
|
|
||||||
bin = highbit64(BP_GET_ASIZE(bp)) - 1;
|
if (block_bin_mode == BIN_AUTO)
|
||||||
|
bin = BIN(BP_GET_ASIZE(bp));
|
||||||
|
|
||||||
zcb->zcb_asize_count[bin]++;
|
zcb->zcb_asize_count[bin]++;
|
||||||
zcb->zcb_asize_len[bin] += BP_GET_ASIZE(bp);
|
zcb->zcb_asize_len[bin] += BP_GET_ASIZE(bp);
|
||||||
zcb->zcb_asize_total += BP_GET_ASIZE(bp);
|
zcb->zcb_asize_total += BP_GET_ASIZE(bp);
|
||||||
|
|
||||||
|
#undef BIN
|
||||||
|
|
||||||
|
hist_skipped:
|
||||||
if (!do_claim)
|
if (!do_claim)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -7741,11 +7900,11 @@ zdb_set_skip_mmp(char *target)
|
|||||||
* Disable the activity check to allow examination of
|
* Disable the activity check to allow examination of
|
||||||
* active pools.
|
* active pools.
|
||||||
*/
|
*/
|
||||||
mutex_enter(&spa_namespace_lock);
|
spa_namespace_enter(FTAG);
|
||||||
if ((spa = spa_lookup(target)) != NULL) {
|
if ((spa = spa_lookup(target)) != NULL) {
|
||||||
spa->spa_import_flags |= ZFS_IMPORT_SKIP_MMP;
|
spa->spa_import_flags |= ZFS_IMPORT_SKIP_MMP;
|
||||||
}
|
}
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BOGUS_SUFFIX "_CHECKPOINTED_UNIVERSE"
|
#define BOGUS_SUFFIX "_CHECKPOINTED_UNIVERSE"
|
||||||
@ -9375,6 +9534,12 @@ 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,
|
||||||
|
ARG_ALLOCATED},
|
||||||
|
{"bin", required_argument, NULL,
|
||||||
|
ARG_BLOCK_BIN_MODE},
|
||||||
|
{"class", required_argument, NULL,
|
||||||
|
ARG_BLOCK_CLASSES},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -9405,6 +9570,7 @@ main(int argc, char **argv)
|
|||||||
case 'u':
|
case 'u':
|
||||||
case 'y':
|
case 'y':
|
||||||
case 'Z':
|
case 'Z':
|
||||||
|
case ARG_ALLOCATED:
|
||||||
dump_opt[c]++;
|
dump_opt[c]++;
|
||||||
dump_all = 0;
|
dump_all = 0;
|
||||||
break;
|
break;
|
||||||
@ -9487,6 +9653,59 @@ main(int argc, char **argv)
|
|||||||
case 'x':
|
case 'x':
|
||||||
vn_dumpdir = optarg;
|
vn_dumpdir = optarg;
|
||||||
break;
|
break;
|
||||||
|
case ARG_BLOCK_BIN_MODE:
|
||||||
|
if (strcmp(optarg, "lsize") == 0) {
|
||||||
|
block_bin_mode = BIN_LSIZE;
|
||||||
|
} else if (strcmp(optarg, "psize") == 0) {
|
||||||
|
block_bin_mode = BIN_PSIZE;
|
||||||
|
} else if (strcmp(optarg, "asize") == 0) {
|
||||||
|
block_bin_mode = BIN_ASIZE;
|
||||||
|
} else {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"--bin=\"%s\" must be one of \"lsize\", "
|
||||||
|
"\"psize\" or \"asize\"\n", optarg);
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ARG_BLOCK_CLASSES: {
|
||||||
|
char *buf = strdup(optarg), *tok = buf, *next,
|
||||||
|
*save = NULL;
|
||||||
|
|
||||||
|
while ((next = strtok_r(tok, ",", &save)) != NULL) {
|
||||||
|
tok = NULL;
|
||||||
|
|
||||||
|
if (strcmp(next, "normal") == 0) {
|
||||||
|
block_classes |= CLASS_NORMAL;
|
||||||
|
} else if (strcmp(next, "special") == 0) {
|
||||||
|
block_classes |= CLASS_SPECIAL;
|
||||||
|
} else if (strcmp(next, "dedup") == 0) {
|
||||||
|
block_classes |= CLASS_DEDUP;
|
||||||
|
} else if (strcmp(next, "other") == 0) {
|
||||||
|
block_classes |= CLASS_OTHER;
|
||||||
|
} else {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"--class=\"%s\" must be a "
|
||||||
|
"comma-separated list of either "
|
||||||
|
"\"normal\", \"special\", "
|
||||||
|
"\"asize\" or \"other\"; "
|
||||||
|
"got \"%s\"\n",
|
||||||
|
optarg, next);
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block_classes == 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"--class= must be a comma-separated "
|
||||||
|
"list of either \"normal\", \"special\", "
|
||||||
|
"\"asize\" or \"other\"; got empty\n");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buf);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
@ -9529,6 +9748,9 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
spa_mode_readable_spacemaps = B_TRUE;
|
spa_mode_readable_spacemaps = B_TRUE;
|
||||||
|
|
||||||
|
libspl_set_assert_ok((dump_opt['A'] == 1) || (dump_opt['A'] > 2));
|
||||||
|
zfs_recover = (dump_opt['A'] > 1);
|
||||||
|
|
||||||
if (dump_all)
|
if (dump_all)
|
||||||
verbose = MAX(verbose, 1);
|
verbose = MAX(verbose, 1);
|
||||||
|
|
||||||
@ -9539,9 +9761,6 @@ main(int argc, char **argv)
|
|||||||
dump_opt[c] += verbose;
|
dump_opt[c] += verbose;
|
||||||
}
|
}
|
||||||
|
|
||||||
libspl_set_assert_ok((dump_opt['A'] == 1) || (dump_opt['A'] > 2));
|
|
||||||
zfs_recover = (dump_opt['A'] > 1);
|
|
||||||
|
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
if (argc < 2 && dump_opt['R'])
|
if (argc < 2 && dump_opt['R'])
|
||||||
@ -9737,7 +9956,7 @@ main(int argc, char **argv)
|
|||||||
* which imports the pool to the namespace if it's
|
* which imports the pool to the namespace if it's
|
||||||
* not in the cachefile.
|
* not in the cachefile.
|
||||||
*/
|
*/
|
||||||
if (dump_opt['O']) {
|
if (dump_opt['O'] && !dump_opt['r']) {
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
usage();
|
usage();
|
||||||
dump_opt['v'] = verbose + 3;
|
dump_opt['v'] = verbose + 3;
|
||||||
@ -9750,7 +9969,11 @@ main(int argc, char **argv)
|
|||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
usage();
|
usage();
|
||||||
dump_opt['v'] = verbose;
|
dump_opt['v'] = verbose;
|
||||||
error = dump_path(argv[0], argv[1], &object);
|
if (dump_opt['O']) {
|
||||||
|
object = strtoull(argv[1], NULL, 0);
|
||||||
|
} else {
|
||||||
|
error = dump_path(argv[0], argv[1], &object);
|
||||||
|
}
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
fatal("internal error: %s", strerror(error));
|
fatal("internal error: %s", strerror(error));
|
||||||
}
|
}
|
||||||
@ -9804,13 +10027,13 @@ main(int argc, char **argv)
|
|||||||
* try opening the pool after clearing the
|
* try opening the pool after clearing the
|
||||||
* log state.
|
* log state.
|
||||||
*/
|
*/
|
||||||
mutex_enter(&spa_namespace_lock);
|
spa_namespace_enter(FTAG);
|
||||||
if ((spa = spa_lookup(target)) != NULL &&
|
if ((spa = spa_lookup(target)) != NULL &&
|
||||||
spa->spa_log_state == SPA_LOG_MISSING) {
|
spa->spa_log_state == SPA_LOG_MISSING) {
|
||||||
spa->spa_log_state = SPA_LOG_CLEAR;
|
spa->spa_log_state = SPA_LOG_CLEAR;
|
||||||
error = 0;
|
error = 0;
|
||||||
}
|
}
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
error = spa_open_rewind(target, &spa,
|
error = spa_open_rewind(target, &spa,
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ zed_check_cmd "${ZFS}" sort diff
|
|||||||
|
|
||||||
# We lock the output file to avoid simultaneous writes.
|
# We lock the output file to avoid simultaneous writes.
|
||||||
# If we run into trouble, log and drop the lock
|
# If we run into trouble, log and drop the lock
|
||||||
|
# shellcheck disable=SC2329
|
||||||
abort_alter() {
|
abort_alter() {
|
||||||
zed_log_msg "Error updating zfs-list.cache for ${ZEVENT_POOL}!"
|
zed_log_msg "Error updating zfs-list.cache for ${ZEVENT_POOL}!"
|
||||||
zed_unlock "${FSLIST}"
|
zed_unlock "${FSLIST}"
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -293,7 +293,7 @@ get_usage(zfs_help_t idx)
|
|||||||
{
|
{
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
case HELP_CLONE:
|
case HELP_CLONE:
|
||||||
return (gettext("\tclone [-p] [-o property=value] ... "
|
return (gettext("\tclone [-pu] [-o property=value] ... "
|
||||||
"<snapshot> <filesystem|volume>\n"));
|
"<snapshot> <filesystem|volume>\n"));
|
||||||
case HELP_CREATE:
|
case HELP_CREATE:
|
||||||
return (gettext("\tcreate [-Pnpuv] [-o property=value] ... "
|
return (gettext("\tcreate [-Pnpuv] [-o property=value] ... "
|
||||||
@ -819,7 +819,7 @@ zfs_mount_and_share(libzfs_handle_t *hdl, const char *dataset, zfs_type_t type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zfs clone [-p] [-o prop=value] ... <snap> <fs | vol>
|
* zfs clone [-pu] [-o prop=value] ... <snap> <fs | vol>
|
||||||
*
|
*
|
||||||
* Given an existing dataset, create a writable copy whose initial contents
|
* Given an existing dataset, create a writable copy whose initial contents
|
||||||
* are the same as the source. The newly created dataset maintains a
|
* are the same as the source. The newly created dataset maintains a
|
||||||
@ -827,21 +827,24 @@ zfs_mount_and_share(libzfs_handle_t *hdl, const char *dataset, zfs_type_t type)
|
|||||||
* the clone exists.
|
* the clone exists.
|
||||||
*
|
*
|
||||||
* The '-p' flag creates all the non-existing ancestors of the target first.
|
* The '-p' flag creates all the non-existing ancestors of the target first.
|
||||||
|
*
|
||||||
|
* The '-u' flag prevents the newly created file system from being mounted.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
zfs_do_clone(int argc, char **argv)
|
zfs_do_clone(int argc, char **argv)
|
||||||
{
|
{
|
||||||
zfs_handle_t *zhp = NULL;
|
zfs_handle_t *zhp = NULL;
|
||||||
boolean_t parents = B_FALSE;
|
boolean_t parents = B_FALSE;
|
||||||
|
boolean_t nomount = B_FALSE;
|
||||||
nvlist_t *props;
|
nvlist_t *props;
|
||||||
int ret = 0;
|
int ret = 1;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
|
if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
|
||||||
nomem();
|
nomem();
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, "o:p")) != -1) {
|
while ((c = getopt(argc, argv, "o:pu")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'o':
|
case 'o':
|
||||||
if (!parseprop(props, optarg)) {
|
if (!parseprop(props, optarg)) {
|
||||||
@ -852,6 +855,9 @@ zfs_do_clone(int argc, char **argv)
|
|||||||
case 'p':
|
case 'p':
|
||||||
parents = B_TRUE;
|
parents = B_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'u':
|
||||||
|
nomount = B_TRUE;
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||||
optopt);
|
optopt);
|
||||||
@ -880,8 +886,7 @@ zfs_do_clone(int argc, char **argv)
|
|||||||
|
|
||||||
/* open the source dataset */
|
/* open the source dataset */
|
||||||
if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_SNAPSHOT)) == NULL) {
|
if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_SNAPSHOT)) == NULL) {
|
||||||
nvlist_free(props);
|
goto error_open;
|
||||||
return (1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parents && zfs_name_valid(argv[1], ZFS_TYPE_FILESYSTEM |
|
if (parents && zfs_name_valid(argv[1], ZFS_TYPE_FILESYSTEM |
|
||||||
@ -893,33 +898,39 @@ zfs_do_clone(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
if (zfs_dataset_exists(g_zfs, argv[1], ZFS_TYPE_FILESYSTEM |
|
if (zfs_dataset_exists(g_zfs, argv[1], ZFS_TYPE_FILESYSTEM |
|
||||||
ZFS_TYPE_VOLUME)) {
|
ZFS_TYPE_VOLUME)) {
|
||||||
zfs_close(zhp);
|
ret = 0;
|
||||||
nvlist_free(props);
|
goto error;
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
if (zfs_create_ancestors(g_zfs, argv[1]) != 0) {
|
if (zfs_create_ancestors(g_zfs, argv[1]) != 0) {
|
||||||
zfs_close(zhp);
|
goto error;
|
||||||
nvlist_free(props);
|
|
||||||
return (1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pass to libzfs */
|
/* pass to libzfs */
|
||||||
ret = zfs_clone(zhp, argv[1], props);
|
ret = zfs_clone(zhp, argv[1], props);
|
||||||
|
|
||||||
/* create the mountpoint if necessary */
|
if (ret != 0)
|
||||||
if (ret == 0) {
|
goto error;
|
||||||
if (log_history) {
|
|
||||||
(void) zpool_log_history(g_zfs, history_str);
|
|
||||||
log_history = B_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = zfs_mount_and_share(g_zfs, argv[1], ZFS_TYPE_DATASET);
|
/* create the mountpoint if necessary */
|
||||||
|
if (log_history) {
|
||||||
|
(void) zpool_log_history(g_zfs, history_str);
|
||||||
|
log_history = B_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
zfs_close(zhp);
|
if (nomount)
|
||||||
nvlist_free(props);
|
goto error;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dataset cloned successfully, mount/share failures are
|
||||||
|
* non-fatal.
|
||||||
|
*/
|
||||||
|
(void) zfs_mount_and_share(g_zfs, argv[1], ZFS_TYPE_DATASET);
|
||||||
|
|
||||||
|
error:
|
||||||
|
zfs_close(zhp);
|
||||||
|
error_open:
|
||||||
|
nvlist_free(props);
|
||||||
return (!!ret);
|
return (!!ret);
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
@ -930,19 +941,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 +980,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.
|
||||||
@ -1031,7 +1056,7 @@ default_volblocksize(zpool_handle_t *zhp, nvlist_t *props)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zfs create [-Pnpv] [-o prop=value] ... fs
|
* zfs create [-Pnpuv] [-o prop=value] ... fs
|
||||||
* zfs create [-Pnpsv] [-b blocksize] [-o prop=value] ... -V vol size
|
* zfs create [-Pnpsv] [-b blocksize] [-o prop=value] ... -V vol size
|
||||||
*
|
*
|
||||||
* Create a new dataset. This command can be used to create filesystems
|
* Create a new dataset. This command can be used to create filesystems
|
||||||
@ -1319,7 +1344,9 @@ zfs_do_create(int argc, char **argv)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = zfs_mount_and_share(g_zfs, argv[0], ZFS_TYPE_DATASET);
|
/* Dataset created successfully, mount/share failures are non-fatal */
|
||||||
|
ret = 0;
|
||||||
|
(void) zfs_mount_and_share(g_zfs, argv[0], ZFS_TYPE_DATASET);
|
||||||
error:
|
error:
|
||||||
nvlist_free(props);
|
nvlist_free(props);
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -4051,7 +4078,7 @@ zfs_do_rename(int argc, char **argv)
|
|||||||
zfs_handle_t *zhp;
|
zfs_handle_t *zhp;
|
||||||
renameflags_t flags = { 0 };
|
renameflags_t flags = { 0 };
|
||||||
int c;
|
int c;
|
||||||
int ret = 0;
|
int ret = 1;
|
||||||
int types;
|
int types;
|
||||||
boolean_t parents = B_FALSE;
|
boolean_t parents = B_FALSE;
|
||||||
|
|
||||||
@ -4123,18 +4150,19 @@ zfs_do_rename(int argc, char **argv)
|
|||||||
types = ZFS_TYPE_DATASET;
|
types = ZFS_TYPE_DATASET;
|
||||||
|
|
||||||
if ((zhp = zfs_open(g_zfs, argv[0], types)) == NULL)
|
if ((zhp = zfs_open(g_zfs, argv[0], types)) == NULL)
|
||||||
return (1);
|
goto error_open;
|
||||||
|
|
||||||
/* If we were asked and the name looks good, try to create ancestors. */
|
/* If we were asked and the name looks good, try to create ancestors. */
|
||||||
if (parents && zfs_name_valid(argv[1], zfs_get_type(zhp)) &&
|
if (parents && zfs_name_valid(argv[1], zfs_get_type(zhp)) &&
|
||||||
zfs_create_ancestors(g_zfs, argv[1]) != 0) {
|
zfs_create_ancestors(g_zfs, argv[1]) != 0) {
|
||||||
zfs_close(zhp);
|
goto error;
|
||||||
return (1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (zfs_rename(zhp, argv[1], flags) != 0);
|
ret = (zfs_rename(zhp, argv[1], flags) != 0);
|
||||||
|
|
||||||
|
error:
|
||||||
zfs_close(zhp);
|
zfs_close(zhp);
|
||||||
|
error_open:
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5303,6 +5331,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 +5374,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 +5959,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 +6892,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,
|
||||||
@ -9376,7 +9410,7 @@ zfs_do_help(int argc, char **argv)
|
|||||||
|
|
||||||
execlp("man", "man", page, NULL);
|
execlp("man", "man", page, NULL);
|
||||||
|
|
||||||
fprintf(stderr, "couldn't run man program: %s", strerror(errno));
|
fprintf(stderr, "couldn't run man program: %s\n", strerror(errno));
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -145,11 +145,11 @@ zfs_project_handle_one(const char *name, zfs_project_control_t *zpc)
|
|||||||
switch (zpc->zpc_op) {
|
switch (zpc->zpc_op) {
|
||||||
case ZFS_PROJECT_OP_LIST:
|
case ZFS_PROJECT_OP_LIST:
|
||||||
(void) printf("%5u %c %s\n", fsx.fsx_projid,
|
(void) printf("%5u %c %s\n", fsx.fsx_projid,
|
||||||
(fsx.fsx_xflags & ZFS_PROJINHERIT_FL) ? 'P' : '-', name);
|
(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT) ? 'P' : '-', name);
|
||||||
goto out;
|
goto out;
|
||||||
case ZFS_PROJECT_OP_CHECK:
|
case ZFS_PROJECT_OP_CHECK:
|
||||||
if (fsx.fsx_projid == zpc->zpc_expected_projid &&
|
if (fsx.fsx_projid == zpc->zpc_expected_projid &&
|
||||||
fsx.fsx_xflags & ZFS_PROJINHERIT_FL)
|
fsx.fsx_xflags & FS_XFLAG_PROJINHERIT)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!zpc->zpc_newline) {
|
if (!zpc->zpc_newline) {
|
||||||
@ -164,29 +164,30 @@ zfs_project_handle_one(const char *name, zfs_project_control_t *zpc)
|
|||||||
"(%u/%u)\n", name, fsx.fsx_projid,
|
"(%u/%u)\n", name, fsx.fsx_projid,
|
||||||
(uint32_t)zpc->zpc_expected_projid);
|
(uint32_t)zpc->zpc_expected_projid);
|
||||||
|
|
||||||
if (!(fsx.fsx_xflags & ZFS_PROJINHERIT_FL))
|
if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT))
|
||||||
(void) printf("%s - project inherit flag is not set\n",
|
(void) printf("%s - project inherit flag is not set\n",
|
||||||
name);
|
name);
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
case ZFS_PROJECT_OP_CLEAR:
|
case ZFS_PROJECT_OP_CLEAR:
|
||||||
if (!(fsx.fsx_xflags & ZFS_PROJINHERIT_FL) &&
|
if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT) &&
|
||||||
(zpc->zpc_keep_projid ||
|
(zpc->zpc_keep_projid ||
|
||||||
fsx.fsx_projid == ZFS_DEFAULT_PROJID))
|
fsx.fsx_projid == ZFS_DEFAULT_PROJID))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
fsx.fsx_xflags &= ~ZFS_PROJINHERIT_FL;
|
fsx.fsx_xflags &= ~FS_XFLAG_PROJINHERIT;
|
||||||
if (!zpc->zpc_keep_projid)
|
if (!zpc->zpc_keep_projid)
|
||||||
fsx.fsx_projid = ZFS_DEFAULT_PROJID;
|
fsx.fsx_projid = ZFS_DEFAULT_PROJID;
|
||||||
break;
|
break;
|
||||||
case ZFS_PROJECT_OP_SET:
|
case ZFS_PROJECT_OP_SET:
|
||||||
if (fsx.fsx_projid == zpc->zpc_expected_projid &&
|
if (fsx.fsx_projid == zpc->zpc_expected_projid &&
|
||||||
(!zpc->zpc_set_flag || fsx.fsx_xflags & ZFS_PROJINHERIT_FL))
|
(!zpc->zpc_set_flag ||
|
||||||
|
fsx.fsx_xflags & FS_XFLAG_PROJINHERIT))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
fsx.fsx_projid = zpc->zpc_expected_projid;
|
fsx.fsx_projid = zpc->zpc_expected_projid;
|
||||||
if (zpc->zpc_set_flag)
|
if (zpc->zpc_set_flag)
|
||||||
fsx.fsx_xflags |= ZFS_PROJINHERIT_FL;
|
fsx.fsx_xflags |= FS_XFLAG_PROJINHERIT;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
@ -194,11 +195,30 @@ zfs_project_handle_one(const char *name, zfs_project_control_t *zpc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = ioctl(fd, ZFS_IOC_FSSETXATTR, &fsx);
|
ret = ioctl(fd, ZFS_IOC_FSSETXATTR, &fsx);
|
||||||
if (ret)
|
if (ret) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
gettext("failed to set xattr for %s: %s\n"),
|
gettext("failed to set xattr for %s: %s\n"),
|
||||||
name, strerror(errno));
|
name, strerror(errno));
|
||||||
|
|
||||||
|
if (errno == ENOTSUP) {
|
||||||
|
char *kver = zfs_version_kernel();
|
||||||
|
/*
|
||||||
|
* Special case: a module/userspace version mismatch can
|
||||||
|
* return ENOTSUP due to us fixing the XFLAGs bits in
|
||||||
|
* #17884. In that case give a hint to the user that
|
||||||
|
* they should take action to make the versions match.
|
||||||
|
*/
|
||||||
|
if (strcmp(kver, ZFS_META_ALIAS) != 0) {
|
||||||
|
fprintf(stderr,
|
||||||
|
gettext("Warning: The zfs module version "
|
||||||
|
"(%s) and userspace\nversion (%s) do not "
|
||||||
|
"match up. This may be the\ncause of the "
|
||||||
|
"\"Operation not supported\" error.\n"),
|
||||||
|
kver, ZFS_META_ALIAS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
close(fd);
|
close(fd);
|
||||||
return (ret);
|
return (ret);
|
||||||
|
|||||||
488
cmd/zhack.c
488
cmd/zhack.c
@ -52,12 +52,15 @@
|
|||||||
#include <sys/zio_compress.h>
|
#include <sys/zio_compress.h>
|
||||||
#include <sys/zfeature.h>
|
#include <sys/zfeature.h>
|
||||||
#include <sys/dmu_tx.h>
|
#include <sys/dmu_tx.h>
|
||||||
|
#include <sys/backtrace.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;
|
||||||
static boolean_t g_readonly;
|
static boolean_t g_readonly;
|
||||||
|
static boolean_t g_dump_dbgmsg;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ZHACK_REPAIR_OP_UNKNOWN = 0,
|
ZHACK_REPAIR_OP_UNKNOWN = 0,
|
||||||
@ -69,11 +72,23 @@ 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] [-G] "
|
||||||
"where <subcommand> <args> is one of the following:\n"
|
"<subcommand> <args> ...\n"
|
||||||
|
" where <subcommand> <args> is one of the following:\n"
|
||||||
"\n");
|
"\n");
|
||||||
|
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
|
" global options:\n"
|
||||||
|
" -c <cachefile> reads config from the given cachefile\n"
|
||||||
|
" -d <dir> directory with vdevs for import\n"
|
||||||
|
" -o var=value... set global variable to an unsigned "
|
||||||
|
"32-bit integer\n"
|
||||||
|
" -G dump zfs_dbgmsg buffer before exiting\n"
|
||||||
|
"\n"
|
||||||
|
" action idle <pool> [-f] [-t seconds]\n"
|
||||||
|
" import the pool for a set time then export it\n"
|
||||||
|
" -t <seconds> sets the time the pool is imported\n"
|
||||||
|
"\n"
|
||||||
" feature stat <pool>\n"
|
" feature stat <pool>\n"
|
||||||
" print information about enabled features\n"
|
" print information about enabled features\n"
|
||||||
" feature enable [-r] [-d desc] <pool> <feature>\n"
|
" feature enable [-r] [-d desc] <pool> <feature>\n"
|
||||||
@ -93,10 +108,46 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dump_debug_buffer(void)
|
||||||
|
{
|
||||||
|
ssize_t ret __attribute__((unused));
|
||||||
|
|
||||||
|
if (!g_dump_dbgmsg)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We use write() instead of printf() so that this function
|
||||||
|
* is safe to call from a signal handler.
|
||||||
|
*/
|
||||||
|
ret = write(STDERR_FILENO, "\n", 1);
|
||||||
|
zfs_dbgmsg_print(STDERR_FILENO, "zhack");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sig_handler(int signo)
|
||||||
|
{
|
||||||
|
struct sigaction action;
|
||||||
|
|
||||||
|
libspl_backtrace(STDERR_FILENO);
|
||||||
|
dump_debug_buffer();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Restore default action and re-raise signal so SIGSEGV and
|
||||||
|
* SIGABRT can trigger a core dump.
|
||||||
|
*/
|
||||||
|
action.sa_handler = SIG_DFL;
|
||||||
|
sigemptyset(&action.sa_mask);
|
||||||
|
action.sa_flags = 0;
|
||||||
|
(void) sigaction(signo, &action, NULL);
|
||||||
|
raise(signo);
|
||||||
|
}
|
||||||
|
|
||||||
static __attribute__((format(printf, 3, 4))) __attribute__((noreturn)) void
|
static __attribute__((format(printf, 3, 4))) __attribute__((noreturn)) void
|
||||||
fatal(spa_t *spa, const void *tag, const char *fmt, ...)
|
fatal(spa_t *spa, const void *tag, const char *fmt, ...)
|
||||||
@ -114,6 +165,8 @@ fatal(spa_t *spa, const void *tag, const char *fmt, ...)
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
(void) fputc('\n', stderr);
|
(void) fputc('\n', stderr);
|
||||||
|
|
||||||
|
dump_debug_buffer();
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +222,7 @@ zhack_import(char *target, boolean_t readonly)
|
|||||||
|
|
||||||
zfeature_checks_disable = B_TRUE;
|
zfeature_checks_disable = B_TRUE;
|
||||||
error = spa_import(target, config, props,
|
error = spa_import(target, config, props,
|
||||||
(readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL));
|
(readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL));
|
||||||
fnvlist_free(config);
|
fnvlist_free(config);
|
||||||
zfeature_checks_disable = B_FALSE;
|
zfeature_checks_disable = B_FALSE;
|
||||||
if (error == EEXIST)
|
if (error == EEXIST)
|
||||||
@ -363,10 +416,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 +431,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 +553,259 @@ zhack_do_feature(int argc, char **argv)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
zhack_do_action_idle(int argc, char **argv)
|
||||||
|
{
|
||||||
|
spa_t *spa;
|
||||||
|
char *target, *tmp;
|
||||||
|
int idle_time = 0;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
optind = 1;
|
||||||
|
while ((c = getopt(argc, argv, "+t:")) != -1) {
|
||||||
|
switch (c) {
|
||||||
|
case 't':
|
||||||
|
idle_time = strtol(optarg, &tmp, 0);
|
||||||
|
if (*tmp) {
|
||||||
|
(void) fprintf(stderr, "error: time must "
|
||||||
|
"be an integer in seconds: %s\n", tmp);
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
if (idle_time < 0) {
|
||||||
|
(void) fprintf(stderr, "error: time must "
|
||||||
|
"not be negative: %d\n", idle_time);
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
|
||||||
|
fprintf(stdout, "Imported pool %s, idle for %d seconds\n",
|
||||||
|
target, idle_time);
|
||||||
|
sleep(idle_time);
|
||||||
|
|
||||||
|
spa_close(spa, FTAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zhack_do_action(int argc, char **argv)
|
||||||
|
{
|
||||||
|
char *subcommand;
|
||||||
|
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
if (argc == 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"error: no import operation specified\n");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
subcommand = argv[0];
|
||||||
|
if (strcmp(subcommand, "idle") == 0) {
|
||||||
|
zhack_do_action_idle(argc, argv);
|
||||||
|
} else {
|
||||||
|
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||||
|
subcommand);
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
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 +835,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 +878,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 +905,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 +920,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 +1042,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 +1064,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 +1107,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 +1115,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 +1133,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 +1141,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;
|
||||||
@ -971,17 +1303,35 @@ zhack_do_label(int argc, char **argv)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
struct sigaction action;
|
||||||
char *path[MAX_NUM_PATHS];
|
char *path[MAX_NUM_PATHS];
|
||||||
const char *subcommand;
|
const char *subcommand;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set up signal handlers, so if we crash due to bad on-disk data we
|
||||||
|
* can get more info. Unlike ztest, we don't bail out if we can't set
|
||||||
|
* up signal handlers, because zhack is very useful without them.
|
||||||
|
*/
|
||||||
|
action.sa_handler = sig_handler;
|
||||||
|
sigemptyset(&action.sa_mask);
|
||||||
|
action.sa_flags = 0;
|
||||||
|
if (sigaction(SIGSEGV, &action, NULL) < 0) {
|
||||||
|
(void) fprintf(stderr, "zhack: cannot catch SIGSEGV: %s\n",
|
||||||
|
strerror(errno));
|
||||||
|
}
|
||||||
|
if (sigaction(SIGABRT, &action, NULL) < 0) {
|
||||||
|
(void) fprintf(stderr, "zhack: cannot catch SIGABRT: %s\n",
|
||||||
|
strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
g_importargs.path = path;
|
g_importargs.path = path;
|
||||||
|
|
||||||
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:Go:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
g_importargs.cachefile = optarg;
|
g_importargs.cachefile = optarg;
|
||||||
@ -990,6 +1340,13 @@ 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 'G':
|
||||||
|
g_dump_dbgmsg = B_TRUE;
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
if (handle_tunable_option(optarg, B_FALSE) != 0)
|
||||||
|
exit(1);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
@ -1007,10 +1364,14 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
subcommand = argv[0];
|
subcommand = argv[0];
|
||||||
|
|
||||||
if (strcmp(subcommand, "feature") == 0) {
|
if (strcmp(subcommand, "action") == 0) {
|
||||||
|
rv = zhack_do_action(argc, argv);
|
||||||
|
} else if (strcmp(subcommand, "feature") == 0) {
|
||||||
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);
|
||||||
@ -1022,6 +1383,9 @@ main(int argc, char **argv)
|
|||||||
"changes may not be committed to disk\n");
|
"changes may not be committed to disk\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_dump_dbgmsg)
|
||||||
|
dump_debug_buffer();
|
||||||
|
|
||||||
kernel_fini();
|
kernel_fini();
|
||||||
|
|
||||||
return (rv);
|
return (rv);
|
||||||
|
|||||||
@ -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,48 @@ 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 {
|
||||||
|
zpool_refresh_stats_from_handle(node->zn_handle, zhp);
|
||||||
|
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 +153,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 +178,61 @@ 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. */
|
||||||
|
(void) zpool_iter(g_zfs, add_pool_cb, zlp);
|
||||||
|
|
||||||
|
/* Walk the list of existing pools, and update or remove them. */
|
||||||
|
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 were added
|
||||||
|
* by zpool_iter() and are already up to date.
|
||||||
|
*/
|
||||||
|
if (node->zn_last_refresh == zlp->zl_last_refresh &&
|
||||||
|
zpool_get_state(node->zn_handle) != POOL_STATE_UNAVAIL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Refresh and remove if necessary. */
|
||||||
|
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 +255,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.
|
||||||
*/
|
*/
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -195,7 +195,7 @@ is_shorthand_path(const char *arg, char *path, size_t path_size,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(path, arg, path_size);
|
(void) strlcpy(path, arg, path_size);
|
||||||
memset(statbuf, 0, sizeof (*statbuf));
|
memset(statbuf, 0, sizeof (*statbuf));
|
||||||
*wholedisk = B_FALSE;
|
*wholedisk = B_FALSE;
|
||||||
|
|
||||||
@ -270,14 +270,13 @@ is_spare(nvlist_t *config, const char *path)
|
|||||||
* draid* Virtual dRAID spare
|
* draid* Virtual dRAID spare
|
||||||
*/
|
*/
|
||||||
static nvlist_t *
|
static nvlist_t *
|
||||||
make_leaf_vdev(nvlist_t *props, const char *arg, boolean_t is_primary)
|
make_leaf_vdev(const char *arg, boolean_t is_primary, uint64_t ashift)
|
||||||
{
|
{
|
||||||
char path[MAXPATHLEN];
|
char path[MAXPATHLEN];
|
||||||
struct stat64 statbuf;
|
struct stat64 statbuf;
|
||||||
nvlist_t *vdev = NULL;
|
nvlist_t *vdev = NULL;
|
||||||
const char *type = NULL;
|
const char *type = NULL;
|
||||||
boolean_t wholedisk = B_FALSE;
|
boolean_t wholedisk = B_FALSE;
|
||||||
uint64_t ashift = 0;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -309,7 +308,7 @@ make_leaf_vdev(nvlist_t *props, const char *arg, boolean_t is_primary)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* After whole disk check restore original passed path */
|
/* After whole disk check restore original passed path */
|
||||||
strlcpy(path, arg, sizeof (path));
|
(void) strlcpy(path, arg, sizeof (path));
|
||||||
} else if (zpool_is_draid_spare(arg)) {
|
} else if (zpool_is_draid_spare(arg)) {
|
||||||
if (!is_primary) {
|
if (!is_primary) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
@ -319,7 +318,7 @@ make_leaf_vdev(nvlist_t *props, const char *arg, boolean_t is_primary)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wholedisk = B_TRUE;
|
wholedisk = B_TRUE;
|
||||||
strlcpy(path, arg, sizeof (path));
|
(void) strlcpy(path, arg, sizeof (path));
|
||||||
type = VDEV_TYPE_DRAID_SPARE;
|
type = VDEV_TYPE_DRAID_SPARE;
|
||||||
} else {
|
} else {
|
||||||
err = is_shorthand_path(arg, path, sizeof (path),
|
err = is_shorthand_path(arg, path, sizeof (path),
|
||||||
@ -381,31 +380,6 @@ make_leaf_vdev(nvlist_t *props, const char *arg, boolean_t is_primary)
|
|||||||
verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK,
|
verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK,
|
||||||
(uint64_t)wholedisk) == 0);
|
(uint64_t)wholedisk) == 0);
|
||||||
|
|
||||||
/*
|
|
||||||
* Override defaults if custom properties are provided.
|
|
||||||
*/
|
|
||||||
if (props != NULL) {
|
|
||||||
const char *value = NULL;
|
|
||||||
|
|
||||||
if (nvlist_lookup_string(props,
|
|
||||||
zpool_prop_to_name(ZPOOL_PROP_ASHIFT), &value) == 0) {
|
|
||||||
if (zfs_nicestrtonum(NULL, value, &ashift) != 0) {
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
gettext("ashift must be a number.\n"));
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
if (ashift != 0 &&
|
|
||||||
(ashift < ASHIFT_MIN || ashift > ASHIFT_MAX)) {
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
gettext("invalid 'ashift=%" PRIu64 "' "
|
|
||||||
"property: only values between %" PRId32 " "
|
|
||||||
"and %" PRId32 " are allowed.\n"),
|
|
||||||
ashift, ASHIFT_MIN, ASHIFT_MAX);
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the device is known to incorrectly report its physical sector
|
* If the device is known to incorrectly report its physical sector
|
||||||
* size explicitly provide the known correct value.
|
* size explicitly provide the known correct value.
|
||||||
@ -609,22 +583,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1030,7 +1010,7 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv, boolean_t replacing)
|
|||||||
* window between when udev deletes and recreates the link
|
* window between when udev deletes and recreates the link
|
||||||
* during which access attempts will fail with ENOENT.
|
* during which access attempts will fail with ENOENT.
|
||||||
*/
|
*/
|
||||||
strlcpy(udevpath, path, MAXPATHLEN);
|
(void) strlcpy(udevpath, path, MAXPATHLEN);
|
||||||
(void) zfs_append_partition(udevpath, MAXPATHLEN);
|
(void) zfs_append_partition(udevpath, MAXPATHLEN);
|
||||||
|
|
||||||
fd = open(devpath, O_RDWR|O_EXCL);
|
fd = open(devpath, O_RDWR|O_EXCL);
|
||||||
@ -1507,6 +1487,29 @@ construct_spec(nvlist_t *props, int argc, char **argv)
|
|||||||
const char *type, *fulltype;
|
const char *type, *fulltype;
|
||||||
boolean_t is_log, is_special, is_dedup, is_spare;
|
boolean_t is_log, is_special, is_dedup, is_spare;
|
||||||
boolean_t seen_logs;
|
boolean_t seen_logs;
|
||||||
|
uint64_t ashift = 0;
|
||||||
|
|
||||||
|
if (props != NULL) {
|
||||||
|
const char *value = NULL;
|
||||||
|
|
||||||
|
if (nvlist_lookup_string(props,
|
||||||
|
zpool_prop_to_name(ZPOOL_PROP_ASHIFT), &value) == 0) {
|
||||||
|
if (zfs_nicestrtonum(NULL, value, &ashift) != 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("ashift must be a number.\n"));
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
if (ashift != 0 &&
|
||||||
|
(ashift < ASHIFT_MIN || ashift > ASHIFT_MAX)) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("invalid 'ashift=%" PRIu64 "' "
|
||||||
|
"property: only values between %" PRId32 " "
|
||||||
|
"and %" PRId32 " are allowed.\n"),
|
||||||
|
ashift, ASHIFT_MIN, ASHIFT_MAX);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
top = NULL;
|
top = NULL;
|
||||||
toplevels = 0;
|
toplevels = 0;
|
||||||
@ -1612,9 +1615,9 @@ construct_spec(nvlist_t *props, int argc, char **argv)
|
|||||||
children * sizeof (nvlist_t *));
|
children * sizeof (nvlist_t *));
|
||||||
if (child == NULL)
|
if (child == NULL)
|
||||||
zpool_no_memory();
|
zpool_no_memory();
|
||||||
if ((nv = make_leaf_vdev(props, argv[c],
|
if ((nv = make_leaf_vdev(argv[c],
|
||||||
!(is_log || is_special || is_dedup ||
|
!(is_log || is_special || is_dedup ||
|
||||||
is_spare))) == NULL) {
|
is_spare), ashift)) == NULL) {
|
||||||
for (c = 0; c < children - 1; c++)
|
for (c = 0; c < children - 1; c++)
|
||||||
nvlist_free(child[c]);
|
nvlist_free(child[c]);
|
||||||
free(child);
|
free(child);
|
||||||
@ -1678,6 +1681,10 @@ construct_spec(nvlist_t *props, int argc, char **argv)
|
|||||||
ZPOOL_CONFIG_ALLOCATION_BIAS,
|
ZPOOL_CONFIG_ALLOCATION_BIAS,
|
||||||
VDEV_ALLOC_BIAS_DEDUP) == 0);
|
VDEV_ALLOC_BIAS_DEDUP) == 0);
|
||||||
}
|
}
|
||||||
|
if (ashift > 0) {
|
||||||
|
fnvlist_add_uint64(nv,
|
||||||
|
ZPOOL_CONFIG_ASHIFT, ashift);
|
||||||
|
}
|
||||||
if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) {
|
if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) {
|
||||||
verify(nvlist_add_uint64(nv,
|
verify(nvlist_add_uint64(nv,
|
||||||
ZPOOL_CONFIG_NPARITY,
|
ZPOOL_CONFIG_NPARITY,
|
||||||
@ -1705,8 +1712,9 @@ construct_spec(nvlist_t *props, int argc, char **argv)
|
|||||||
* We have a device. Pass off to make_leaf_vdev() to
|
* We have a device. Pass off to make_leaf_vdev() to
|
||||||
* construct the appropriate nvlist describing the vdev.
|
* construct the appropriate nvlist describing the vdev.
|
||||||
*/
|
*/
|
||||||
if ((nv = make_leaf_vdev(props, argv[0], !(is_log ||
|
if ((nv = make_leaf_vdev(argv[0], !(is_log ||
|
||||||
is_special || is_dedup || is_spare))) == NULL)
|
is_special || is_dedup || is_spare),
|
||||||
|
ashift)) == NULL)
|
||||||
goto spec_out;
|
goto spec_out;
|
||||||
|
|
||||||
verify(nvlist_add_uint64(nv,
|
verify(nvlist_add_uint64(nv,
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
46
cmd/ztest.c
46
cmd/ztest.c
@ -1228,10 +1228,10 @@ ztest_kill(ztest_shared_t *zs)
|
|||||||
* See comment above spa_write_cachefile().
|
* See comment above spa_write_cachefile().
|
||||||
*/
|
*/
|
||||||
if (raidz_expand_pause_point != RAIDZ_EXPAND_PAUSE_NONE) {
|
if (raidz_expand_pause_point != RAIDZ_EXPAND_PAUSE_NONE) {
|
||||||
if (mutex_tryenter(&spa_namespace_lock)) {
|
if (spa_namespace_tryenter(FTAG)) {
|
||||||
spa_write_cachefile(ztest_spa, B_FALSE, B_FALSE,
|
spa_write_cachefile(ztest_spa, B_FALSE, B_FALSE,
|
||||||
B_FALSE);
|
B_FALSE);
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
|
|
||||||
ztest_scratch_state->zs_raidz_scratch_verify_pause =
|
ztest_scratch_state->zs_raidz_scratch_verify_pause =
|
||||||
raidz_expand_pause_point;
|
raidz_expand_pause_point;
|
||||||
@ -1246,9 +1246,9 @@ ztest_kill(ztest_shared_t *zs)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mutex_enter(&spa_namespace_lock);
|
spa_namespace_enter(FTAG);
|
||||||
spa_write_cachefile(ztest_spa, B_FALSE, B_FALSE, B_FALSE);
|
spa_write_cachefile(ztest_spa, B_FALSE, B_FALSE, B_FALSE);
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) raise(SIGKILL);
|
(void) raise(SIGKILL);
|
||||||
@ -2306,7 +2306,8 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t byteswap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (abuf == NULL) {
|
if (abuf == NULL) {
|
||||||
dmu_write(os, lr->lr_foid, offset, length, data, tx);
|
dmu_write(os, lr->lr_foid, offset, length, data, tx,
|
||||||
|
DMU_READ_PREFETCH);
|
||||||
} else {
|
} else {
|
||||||
memcpy(abuf->b_data, data, length);
|
memcpy(abuf->b_data, data, length);
|
||||||
VERIFY0(dmu_assign_arcbuf_by_dbuf(db, offset, abuf, tx, 0));
|
VERIFY0(dmu_assign_arcbuf_by_dbuf(db, offset, abuf, tx, 0));
|
||||||
@ -3688,10 +3689,10 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id)
|
|||||||
|
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
(void) printf("successful split - results:\n");
|
(void) printf("successful split - results:\n");
|
||||||
mutex_enter(&spa_namespace_lock);
|
spa_namespace_enter(FTAG);
|
||||||
show_pool_stats(spa);
|
show_pool_stats(spa);
|
||||||
show_pool_stats(spa_lookup("splitp"));
|
show_pool_stats(spa_lookup("splitp"));
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
++zs->zs_splits;
|
++zs->zs_splits;
|
||||||
--zs->zs_mirrors;
|
--zs->zs_mirrors;
|
||||||
}
|
}
|
||||||
@ -3975,11 +3976,11 @@ raidz_scratch_verify(void)
|
|||||||
|
|
||||||
kernel_init(SPA_MODE_READ);
|
kernel_init(SPA_MODE_READ);
|
||||||
|
|
||||||
mutex_enter(&spa_namespace_lock);
|
spa_namespace_enter(FTAG);
|
||||||
spa = spa_lookup(ztest_opts.zo_pool);
|
spa = spa_lookup(ztest_opts.zo_pool);
|
||||||
ASSERT(spa);
|
ASSERT(spa);
|
||||||
spa->spa_import_flags |= ZFS_IMPORT_SKIP_MMP;
|
spa->spa_import_flags |= ZFS_IMPORT_SKIP_MMP;
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
|
|
||||||
VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
|
VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
|
||||||
|
|
||||||
@ -5243,7 +5244,8 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
|||||||
* We've verified all the old bufwads, and made new ones.
|
* We've verified all the old bufwads, and made new ones.
|
||||||
* Now write them out.
|
* Now write them out.
|
||||||
*/
|
*/
|
||||||
dmu_write(os, packobj, packoff, packsize, packbuf, tx);
|
dmu_write(os, packobj, packoff, packsize, packbuf, tx,
|
||||||
|
DMU_READ_PREFETCH);
|
||||||
|
|
||||||
if (freeit) {
|
if (freeit) {
|
||||||
if (ztest_opts.zo_verbose >= 7) {
|
if (ztest_opts.zo_verbose >= 7) {
|
||||||
@ -5258,7 +5260,8 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
|||||||
" txg %"PRIx64"\n",
|
" txg %"PRIx64"\n",
|
||||||
bigoff, bigsize, txg);
|
bigoff, bigsize, txg);
|
||||||
}
|
}
|
||||||
dmu_write(os, bigobj, bigoff, bigsize, bigbuf, tx);
|
dmu_write(os, bigobj, bigoff, bigsize, bigbuf, tx,
|
||||||
|
DMU_READ_PREFETCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
dmu_tx_commit(tx);
|
dmu_tx_commit(tx);
|
||||||
@ -5513,7 +5516,8 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
|||||||
* We've verified all the old bufwads, and made new ones.
|
* We've verified all the old bufwads, and made new ones.
|
||||||
* Now write them out.
|
* Now write them out.
|
||||||
*/
|
*/
|
||||||
dmu_write(os, packobj, packoff, packsize, packbuf, tx);
|
dmu_write(os, packobj, packoff, packsize, packbuf, tx,
|
||||||
|
DMU_READ_PREFETCH);
|
||||||
if (ztest_opts.zo_verbose >= 7) {
|
if (ztest_opts.zo_verbose >= 7) {
|
||||||
(void) printf("writing offset %"PRIx64" size %"PRIx64""
|
(void) printf("writing offset %"PRIx64" size %"PRIx64""
|
||||||
" txg %"PRIx64"\n",
|
" txg %"PRIx64"\n",
|
||||||
@ -6119,7 +6123,8 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
|
|||||||
"future leak: got %"PRIu64", open txg is %"PRIu64"",
|
"future leak: got %"PRIu64", open txg is %"PRIu64"",
|
||||||
old_txg, txg);
|
old_txg, txg);
|
||||||
|
|
||||||
dmu_write(os, od->od_object, 0, sizeof (uint64_t), &txg, tx);
|
dmu_write(os, od->od_object, 0, sizeof (uint64_t), &txg, tx,
|
||||||
|
DMU_READ_PREFETCH);
|
||||||
|
|
||||||
(void) mutex_enter(&zcl.zcl_callbacks_lock);
|
(void) mutex_enter(&zcl.zcl_callbacks_lock);
|
||||||
|
|
||||||
@ -7141,6 +7146,7 @@ static void
|
|||||||
ztest_get_zdb_bin(char *bin, int len)
|
ztest_get_zdb_bin(char *bin, int len)
|
||||||
{
|
{
|
||||||
char *zdb_path;
|
char *zdb_path;
|
||||||
|
char *resolved;
|
||||||
/*
|
/*
|
||||||
* Try to use $ZDB and in-tree zdb path. If not successful, just
|
* Try to use $ZDB and in-tree zdb path. If not successful, just
|
||||||
* let popen to search through PATH.
|
* let popen to search through PATH.
|
||||||
@ -7154,7 +7160,11 @@ ztest_get_zdb_bin(char *bin, int len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY3P(realpath(getexecname(), bin), !=, NULL);
|
resolved = realpath(getexecname(), NULL);
|
||||||
|
VERIFY3P(resolved, !=, NULL);
|
||||||
|
strlcpy(bin, resolved, len);
|
||||||
|
free(resolved);
|
||||||
|
|
||||||
if (strstr(bin, ".libs/ztest")) {
|
if (strstr(bin, ".libs/ztest")) {
|
||||||
strstr(bin, ".libs/ztest")[0] = '\0'; /* In-tree */
|
strstr(bin, ".libs/ztest")[0] = '\0'; /* In-tree */
|
||||||
strcat(bin, "zdb");
|
strcat(bin, "zdb");
|
||||||
@ -7422,11 +7432,11 @@ ztest_walk_pool_directory(const char *header)
|
|||||||
if (ztest_opts.zo_verbose >= 6)
|
if (ztest_opts.zo_verbose >= 6)
|
||||||
(void) puts(header);
|
(void) puts(header);
|
||||||
|
|
||||||
mutex_enter(&spa_namespace_lock);
|
spa_namespace_enter(FTAG);
|
||||||
while ((spa = spa_next(spa)) != NULL)
|
while ((spa = spa_next(spa)) != NULL)
|
||||||
if (ztest_opts.zo_verbose >= 6)
|
if (ztest_opts.zo_verbose >= 6)
|
||||||
(void) printf("\t%s\n", spa_name(spa));
|
(void) printf("\t%s\n", spa_name(spa));
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -8541,11 +8551,11 @@ ztest_run(ztest_shared_t *zs)
|
|||||||
/*
|
/*
|
||||||
* Verify that we can loop over all pools.
|
* Verify that we can loop over all pools.
|
||||||
*/
|
*/
|
||||||
mutex_enter(&spa_namespace_lock);
|
spa_namespace_enter(FTAG);
|
||||||
for (spa = spa_next(NULL); spa != NULL; spa = spa_next(spa))
|
for (spa = spa_next(NULL); spa != NULL; spa = spa_next(spa))
|
||||||
if (ztest_opts.zo_verbose > 3)
|
if (ztest_opts.zo_verbose > 3)
|
||||||
(void) printf("spa_next: found %s\n", spa_name(spa));
|
(void) printf("spa_next: found %s\n", spa_name(spa));
|
||||||
mutex_exit(&spa_namespace_lock);
|
spa_namespace_exit(FTAG);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Verify that we can export the pool and reimport it under a
|
* Verify that we can export the pool and reimport it under a
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -58,9 +58,9 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
||||||
pkg2=libnvpair3-$${version}.$${arch}.rpm; \
|
pkg2=libnvpair3-$${version}.$${arch}.rpm; \
|
||||||
pkg3=libuutil3-$${version}.$${arch}.rpm; \
|
pkg3=libuutil3-$${version}.$${arch}.rpm; \
|
||||||
pkg4=libzfs6-$${version}.$${arch}.rpm; \
|
pkg4=libzfs7-$${version}.$${arch}.rpm; \
|
||||||
pkg5=libzpool6-$${version}.$${arch}.rpm; \
|
pkg5=libzpool7-$${version}.$${arch}.rpm; \
|
||||||
pkg6=libzfs6-devel-$${version}.$${arch}.rpm; \
|
pkg6=libzfs7-devel-$${version}.$${arch}.rpm; \
|
||||||
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
||||||
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
||||||
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
||||||
@ -72,7 +72,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
||||||
echo "#!$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
echo "#!$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
||||||
echo "`which dh_shlibdeps` -- \
|
echo "`which dh_shlibdeps` -- \
|
||||||
-xlibuutil3linux -xlibnvpair3linux -xlibzfs6linux -xlibzpool6linux" \
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs7linux -xlibzpool7linux" \
|
||||||
>> $${path_prepend}/dh_shlibdeps; \
|
>> $${path_prepend}/dh_shlibdeps; \
|
||||||
## These -x arguments are passed to dpkg-shlibdeps, which exclude the
|
## These -x arguments are passed to dpkg-shlibdeps, which exclude the
|
||||||
## Debianized packages from the auto-generated dependencies of the new debs,
|
## Debianized packages from the auto-generated dependencies of the new debs,
|
||||||
|
|||||||
@ -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);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@ -119,15 +119,49 @@ AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 6.18 API change
|
||||||
|
dnl # block_device_operation->getgeo takes struct gendisk* as first arg
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_GETGEO_GENDISK], [
|
||||||
|
ZFS_LINUX_TEST_SRC([block_device_operations_getgeo_gendisk], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
|
||||||
|
static int blk_getgeo(struct gendisk *disk, struct hd_geometry *geo)
|
||||||
|
{
|
||||||
|
(void) disk, (void) geo;
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct block_device_operations
|
||||||
|
bops __attribute__ ((unused)) = {
|
||||||
|
.getgeo = blk_getgeo,
|
||||||
|
};
|
||||||
|
], [], [])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_GETGEO_GENDISK], [
|
||||||
|
AC_MSG_CHECKING([whether bops->getgeo() takes gendisk as first arg])
|
||||||
|
ZFS_LINUX_TEST_RESULT([block_device_operations_getgeo_gendisk], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE([HAVE_BLOCK_DEVICE_OPERATIONS_GETGEO_GENDISK], [1],
|
||||||
|
[Define if getgeo() in block_device_operations takes struct gendisk * as its first arg])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
|
||||||
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
||||||
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
||||||
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG
|
||||||
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
|
||||||
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_GETGEO_GENDISK
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
|
||||||
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
||||||
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
||||||
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
|
||||||
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_GETGEO_GENDISK
|
||||||
])
|
])
|
||||||
|
|||||||
@ -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
|
||||||
])
|
])
|
||||||
|
|||||||
24
config/kernel-drop-inode.m4
Normal file
24
config/kernel-drop-inode.m4
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 6.18 API change
|
||||||
|
dnl # - generic_drop_inode() renamed to inode_generic_drop()
|
||||||
|
dnl # - generic_delete_inode() renamed to inode_just_drop()
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GENERIC_DROP], [
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_generic_drop], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
],[
|
||||||
|
struct inode *ip = NULL;
|
||||||
|
inode_generic_drop(ip);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_GENERIC_DROP], [
|
||||||
|
AC_MSG_CHECKING([whether inode_generic_drop() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_generic_drop], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_INODE_GENERIC_DROP, 1,
|
||||||
|
[inode_generic_drop() exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
23
config/kernel-inode-state.m4
Normal file
23
config/kernel-inode-state.m4
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 6.19 API change. inode->i_state no longer accessible directly; helper
|
||||||
|
dnl # functions exist.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_STATE_READ_ONCE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_state_read_once], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
], [
|
||||||
|
struct inode i = {};
|
||||||
|
inode_state_read_once(&i);
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_STATE_READ_ONCE], [
|
||||||
|
AC_MSG_CHECKING([whether inode_state_read_once() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_state_read_once], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_INODE_STATE_READ_ONCE, 1,
|
||||||
|
[inode_state_read_once() exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
23
config/kernel-kasan-enabled.m4
Normal file
23
config/kernel-kasan-enabled.m4
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 6.18: some architectures and config option causes the kasan_ inline
|
||||||
|
dnl # functions to reference the GPL-only symbol 'kasan_flag_enabled',
|
||||||
|
dnl # breaking the build. Detect this and work
|
||||||
|
dnl # around it.
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_KASAN_ENABLED], [
|
||||||
|
ZFS_LINUX_TEST_SRC([kasan_enabled], [
|
||||||
|
#include <linux/kasan.h>
|
||||||
|
], [
|
||||||
|
kasan_enabled();
|
||||||
|
], [], [ZFS_META_LICENSE])
|
||||||
|
])
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_KASAN_ENABLED], [
|
||||||
|
AC_MSG_CHECKING([whether kasan_enabled() is GPL-only])
|
||||||
|
ZFS_LINUX_TEST_RESULT([kasan_enabled_license], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_KASAN_ENABLED_GPL_ONLY, 1,
|
||||||
|
[kasan_enabled() is GPL-only])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS], [
|
|||||||
ZFS_LINUX_TEST_SRC([kmap_atomic], [
|
ZFS_LINUX_TEST_SRC([kmap_atomic], [
|
||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
],[
|
],[
|
||||||
struct page page;
|
struct page page = {};
|
||||||
kmap_atomic(&page);
|
kmap_atomic(&page);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@ -16,9 +16,36 @@ AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_FLAG_ERROR], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 6.18+ uses a struct typedef (memdesc_flags_t) instead of an
|
||||||
|
dnl # 'unsigned long' for the 'flags' field in 'struct page'.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_FLAGS_STRUCT], [
|
||||||
|
ZFS_LINUX_TEST_SRC([mm_page_flags_struct], [
|
||||||
|
#include <linux/mm.h>
|
||||||
|
|
||||||
|
static const struct page p __attribute__ ((unused)) = {
|
||||||
|
.flags = { .f = 0 }
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_FLAGS_STRUCT], [
|
||||||
|
AC_MSG_CHECKING([whether 'flags' in 'struct page' is a struct])
|
||||||
|
ZFS_LINUX_TEST_RESULT([mm_page_flags_struct], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_MM_PAGE_FLAGS_STRUCT, 1,
|
||||||
|
['flags' in 'struct page' is a struct])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_FLAGS], [
|
||||||
ZFS_AC_KERNEL_SRC_MM_PAGE_FLAG_ERROR
|
ZFS_AC_KERNEL_SRC_MM_PAGE_FLAG_ERROR
|
||||||
|
ZFS_AC_KERNEL_SRC_MM_PAGE_FLAGS_STRUCT
|
||||||
])
|
])
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_FLAGS], [
|
||||||
ZFS_AC_KERNEL_MM_PAGE_FLAG_ERROR
|
ZFS_AC_KERNEL_MM_PAGE_FLAG_ERROR
|
||||||
|
ZFS_AC_KERNEL_MM_PAGE_FLAGS_STRUCT
|
||||||
])
|
])
|
||||||
|
|||||||
31
config/kernel-namespace.m4
Normal file
31
config/kernel-namespace.m4
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 6.18 API change
|
||||||
|
dnl # ns->ops->type was moved to ns->ns.ns_type (struct ns_common)
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_NS_COMMON_TYPE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([ns_common_type], [
|
||||||
|
#include <linux/user_namespace.h>
|
||||||
|
],[
|
||||||
|
struct user_namespace ns;
|
||||||
|
ns.ns.ns_type = 0;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_NS_COMMON_TYPE], [
|
||||||
|
AC_MSG_CHECKING([whether ns_type is accessible through ns_common])
|
||||||
|
ZFS_LINUX_TEST_RESULT([ns_common_type], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE([HAVE_NS_COMMON_TYPE], 1,
|
||||||
|
[Define if ns_type is accessible through ns_common])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_NAMESPACE], [
|
||||||
|
ZFS_AC_KERNEL_SRC_NS_COMMON_TYPE
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_NAMESPACE], [
|
||||||
|
ZFS_AC_KERNEL_NS_COMMON_TYPE
|
||||||
|
])
|
||||||
@ -1,79 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 2.6.38 API change
|
|
||||||
dnl # ns_capable() was introduced
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_NS_CAPABLE], [
|
|
||||||
ZFS_LINUX_TEST_SRC([ns_capable], [
|
|
||||||
#include <linux/capability.h>
|
|
||||||
],[
|
|
||||||
ns_capable((struct user_namespace *)NULL, CAP_SYS_ADMIN);
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_NS_CAPABLE], [
|
|
||||||
AC_MSG_CHECKING([whether ns_capable exists])
|
|
||||||
ZFS_LINUX_TEST_RESULT([ns_capable], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
],[
|
|
||||||
ZFS_LINUX_TEST_ERROR([ns_capable()])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # 2.6.39 API change
|
|
||||||
dnl # struct user_namespace was added to struct cred_t as cred->user_ns member
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CRED_USER_NS], [
|
|
||||||
ZFS_LINUX_TEST_SRC([cred_user_ns], [
|
|
||||||
#include <linux/cred.h>
|
|
||||||
],[
|
|
||||||
struct cred cr;
|
|
||||||
cr.user_ns = (struct user_namespace *)NULL;
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CRED_USER_NS], [
|
|
||||||
AC_MSG_CHECKING([whether cred_t->user_ns exists])
|
|
||||||
ZFS_LINUX_TEST_RESULT([cred_user_ns], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
],[
|
|
||||||
ZFS_LINUX_TEST_ERROR([cred_t->user_ns()])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # 3.4 API change
|
|
||||||
dnl # kuid_has_mapping() and kgid_has_mapping() were added to distinguish
|
|
||||||
dnl # between internal kernel uids/gids and user namespace uids/gids.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KUID_HAS_MAPPING], [
|
|
||||||
ZFS_LINUX_TEST_SRC([kuid_has_mapping], [
|
|
||||||
#include <linux/uidgid.h>
|
|
||||||
],[
|
|
||||||
kuid_has_mapping((struct user_namespace *)NULL, KUIDT_INIT(0));
|
|
||||||
kgid_has_mapping((struct user_namespace *)NULL, KGIDT_INIT(0));
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_KUID_HAS_MAPPING], [
|
|
||||||
AC_MSG_CHECKING([whether kuid_has_mapping/kgid_has_mapping exist])
|
|
||||||
ZFS_LINUX_TEST_RESULT([kuid_has_mapping], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
],[
|
|
||||||
ZFS_LINUX_TEST_ERROR([kuid_has_mapping()])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES], [
|
|
||||||
ZFS_AC_KERNEL_SRC_NS_CAPABLE
|
|
||||||
ZFS_AC_KERNEL_SRC_HAS_CAPABILITY
|
|
||||||
ZFS_AC_KERNEL_SRC_CRED_USER_NS
|
|
||||||
ZFS_AC_KERNEL_SRC_KUID_HAS_MAPPING
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_USERNS_CAPABILITIES], [
|
|
||||||
ZFS_AC_KERNEL_NS_CAPABLE
|
|
||||||
ZFS_AC_KERNEL_HAS_CAPABILITY
|
|
||||||
ZFS_AC_KERNEL_CRED_USER_NS
|
|
||||||
ZFS_AC_KERNEL_KUID_HAS_MAPPING
|
|
||||||
])
|
|
||||||
58
config/kernel-writeback.m4
Normal file
58
config/kernel-writeback.m4
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITEPAGE_T], [
|
||||||
|
dnl #
|
||||||
|
dnl # 6.3 API change
|
||||||
|
dnl # The writepage_t function type now has its first argument as
|
||||||
|
dnl # struct folio* instead of struct page*
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([writepage_t_folio], [
|
||||||
|
#include <linux/writeback.h>
|
||||||
|
static int putpage(struct folio *folio,
|
||||||
|
struct writeback_control *wbc, void *data)
|
||||||
|
{ return 0; }
|
||||||
|
writepage_t func = putpage;
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_WRITEPAGE_T], [
|
||||||
|
AC_MSG_CHECKING([whether int (*writepage_t)() takes struct folio*])
|
||||||
|
ZFS_LINUX_TEST_RESULT([writepage_t_folio], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_WRITEPAGE_T_FOLIO, 1,
|
||||||
|
[int (*writepage_t)() takes struct folio*])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITE_CACHE_PAGES], [
|
||||||
|
dnl #
|
||||||
|
dnl # 6.18 API change
|
||||||
|
dnl # write_cache_pages() has been removed.
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([write_cache_pages], [
|
||||||
|
#include <linux/writeback.h>
|
||||||
|
], [
|
||||||
|
(void) write_cache_pages(NULL, NULL, NULL, NULL);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_WRITE_CACHE_PAGES], [
|
||||||
|
AC_MSG_CHECKING([whether write_cache_pages() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([write_cache_pages], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_WRITE_CACHE_PAGES, 1,
|
||||||
|
[write_cache_pages() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITEBACK], [
|
||||||
|
ZFS_AC_KERNEL_SRC_WRITEPAGE_T
|
||||||
|
ZFS_AC_KERNEL_SRC_WRITE_CACHE_PAGES
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_WRITEBACK], [
|
||||||
|
ZFS_AC_KERNEL_WRITEPAGE_T
|
||||||
|
ZFS_AC_KERNEL_WRITE_CACHE_PAGES
|
||||||
|
])
|
||||||
@ -1,26 +0,0 @@
|
|||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITEPAGE_T], [
|
|
||||||
dnl #
|
|
||||||
dnl # 6.3 API change
|
|
||||||
dnl # The writepage_t function type now has its first argument as
|
|
||||||
dnl # struct folio* instead of struct page*
|
|
||||||
dnl #
|
|
||||||
ZFS_LINUX_TEST_SRC([writepage_t_folio], [
|
|
||||||
#include <linux/writeback.h>
|
|
||||||
static int putpage(struct folio *folio,
|
|
||||||
struct writeback_control *wbc, void *data)
|
|
||||||
{ return 0; }
|
|
||||||
writepage_t func = putpage;
|
|
||||||
],[])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_WRITEPAGE_T], [
|
|
||||||
AC_MSG_CHECKING([whether int (*writepage_t)() takes struct folio*])
|
|
||||||
ZFS_LINUX_TEST_RESULT([writepage_t_folio], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_WRITEPAGE_T_FOLIO, 1,
|
|
||||||
[int (*writepage_t)() takes struct folio*])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
@ -59,6 +59,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_ACL
|
ZFS_AC_KERNEL_SRC_ACL
|
||||||
ZFS_AC_KERNEL_SRC_INODE_SETATTR
|
ZFS_AC_KERNEL_SRC_INODE_SETATTR
|
||||||
ZFS_AC_KERNEL_SRC_INODE_GETATTR
|
ZFS_AC_KERNEL_SRC_INODE_GETATTR
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_STATE_READ_ONCE
|
||||||
ZFS_AC_KERNEL_SRC_SHOW_OPTIONS
|
ZFS_AC_KERNEL_SRC_SHOW_OPTIONS
|
||||||
ZFS_AC_KERNEL_SRC_SHRINKER
|
ZFS_AC_KERNEL_SRC_SHRINKER
|
||||||
ZFS_AC_KERNEL_SRC_MKDIR
|
ZFS_AC_KERNEL_SRC_MKDIR
|
||||||
@ -70,6 +71,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
|
||||||
@ -120,7 +122,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_IDMAP_MNT_API
|
ZFS_AC_KERNEL_SRC_IDMAP_MNT_API
|
||||||
ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS
|
ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS
|
||||||
ZFS_AC_KERNEL_SRC_IATTR_VFSID
|
ZFS_AC_KERNEL_SRC_IATTR_VFSID
|
||||||
ZFS_AC_KERNEL_SRC_WRITEPAGE_T
|
ZFS_AC_KERNEL_SRC_WRITEBACK
|
||||||
ZFS_AC_KERNEL_SRC_RECLAIMED
|
ZFS_AC_KERNEL_SRC_RECLAIMED
|
||||||
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE
|
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE
|
||||||
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ
|
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ
|
||||||
@ -135,6 +137,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_TIMER
|
ZFS_AC_KERNEL_SRC_TIMER
|
||||||
ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR
|
ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR
|
||||||
ZFS_AC_KERNEL_SRC_SOPS_FREE_INODE
|
ZFS_AC_KERNEL_SRC_SOPS_FREE_INODE
|
||||||
|
ZFS_AC_KERNEL_SRC_NAMESPACE
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_GENERIC_DROP
|
||||||
|
ZFS_AC_KERNEL_SRC_KASAN_ENABLED
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
powerpc*)
|
powerpc*)
|
||||||
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
||||||
@ -177,6 +182,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_ACL
|
ZFS_AC_KERNEL_ACL
|
||||||
ZFS_AC_KERNEL_INODE_SETATTR
|
ZFS_AC_KERNEL_INODE_SETATTR
|
||||||
ZFS_AC_KERNEL_INODE_GETATTR
|
ZFS_AC_KERNEL_INODE_GETATTR
|
||||||
|
ZFS_AC_KERNEL_INODE_STATE_READ_ONCE
|
||||||
ZFS_AC_KERNEL_SHOW_OPTIONS
|
ZFS_AC_KERNEL_SHOW_OPTIONS
|
||||||
ZFS_AC_KERNEL_SHRINKER
|
ZFS_AC_KERNEL_SHRINKER
|
||||||
ZFS_AC_KERNEL_MKDIR
|
ZFS_AC_KERNEL_MKDIR
|
||||||
@ -188,6 +194,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
|
||||||
@ -238,7 +245,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_IDMAP_MNT_API
|
ZFS_AC_KERNEL_IDMAP_MNT_API
|
||||||
ZFS_AC_KERNEL_IDMAP_NO_USERNS
|
ZFS_AC_KERNEL_IDMAP_NO_USERNS
|
||||||
ZFS_AC_KERNEL_IATTR_VFSID
|
ZFS_AC_KERNEL_IATTR_VFSID
|
||||||
ZFS_AC_KERNEL_WRITEPAGE_T
|
ZFS_AC_KERNEL_WRITEBACK
|
||||||
ZFS_AC_KERNEL_RECLAIMED
|
ZFS_AC_KERNEL_RECLAIMED
|
||||||
ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE
|
ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE
|
||||||
ZFS_AC_KERNEL_REGISTER_SYSCTL_SZ
|
ZFS_AC_KERNEL_REGISTER_SYSCTL_SZ
|
||||||
@ -254,6 +261,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_TIMER
|
ZFS_AC_KERNEL_TIMER
|
||||||
ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR
|
ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR
|
||||||
ZFS_AC_KERNEL_SOPS_FREE_INODE
|
ZFS_AC_KERNEL_SOPS_FREE_INODE
|
||||||
|
ZFS_AC_KERNEL_NAMESPACE
|
||||||
|
ZFS_AC_KERNEL_INODE_GENERIC_DROP
|
||||||
|
ZFS_AC_KERNEL_KASAN_ENABLED
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
powerpc*)
|
powerpc*)
|
||||||
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -12,14 +12,14 @@ dist_noinst_DATA += %D%/openzfs-libpam-zfs.postinst
|
|||||||
dist_noinst_DATA += %D%/openzfs-libpam-zfs.prerm
|
dist_noinst_DATA += %D%/openzfs-libpam-zfs.prerm
|
||||||
dist_noinst_DATA += %D%/openzfs-libuutil3.docs
|
dist_noinst_DATA += %D%/openzfs-libuutil3.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libuutil3.install.in
|
dist_noinst_DATA += %D%/openzfs-libuutil3.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs6.docs
|
dist_noinst_DATA += %D%/openzfs-libzfs7.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs6.install.in
|
dist_noinst_DATA += %D%/openzfs-libzfs7.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.docs
|
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.install.in
|
dist_noinst_DATA += %D%/openzfs-libzfsbootenv1.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs-dev.docs
|
dist_noinst_DATA += %D%/openzfs-libzfs-dev.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzfs-dev.install.in
|
dist_noinst_DATA += %D%/openzfs-libzfs-dev.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-libzpool6.docs
|
dist_noinst_DATA += %D%/openzfs-libzpool7.docs
|
||||||
dist_noinst_DATA += %D%/openzfs-libzpool6.install.in
|
dist_noinst_DATA += %D%/openzfs-libzpool7.install.in
|
||||||
dist_noinst_DATA += %D%/openzfs-python3-pyzfs.install
|
dist_noinst_DATA += %D%/openzfs-python3-pyzfs.install
|
||||||
dist_noinst_DATA += %D%/openzfs-zfs-dkms.config
|
dist_noinst_DATA += %D%/openzfs-zfs-dkms.config
|
||||||
dist_noinst_DATA += %D%/openzfs-zfs-dkms.dkms
|
dist_noinst_DATA += %D%/openzfs-zfs-dkms.dkms
|
||||||
|
|||||||
@ -6,6 +6,6 @@ contrib/pyzfs/libzfs_core/bindings/__pycache__/
|
|||||||
contrib/pyzfs/pyzfs.egg-info/
|
contrib/pyzfs/pyzfs.egg-info/
|
||||||
debian/openzfs-libnvpair3.install
|
debian/openzfs-libnvpair3.install
|
||||||
debian/openzfs-libuutil3.install
|
debian/openzfs-libuutil3.install
|
||||||
debian/openzfs-libzfs6.install
|
debian/openzfs-libzfs7.install
|
||||||
debian/openzfs-libzfs-dev.install
|
debian/openzfs-libzfs-dev.install
|
||||||
debian/openzfs-libzpool6.install
|
debian/openzfs-libzpool7.install
|
||||||
|
|||||||
@ -79,9 +79,9 @@ Architecture: linux-any
|
|||||||
Depends: libssl-dev | libssl1.0-dev,
|
Depends: libssl-dev | libssl1.0-dev,
|
||||||
openzfs-libnvpair3 (= ${binary:Version}),
|
openzfs-libnvpair3 (= ${binary:Version}),
|
||||||
openzfs-libuutil3 (= ${binary:Version}),
|
openzfs-libuutil3 (= ${binary:Version}),
|
||||||
openzfs-libzfs6 (= ${binary:Version}),
|
openzfs-libzfs7 (= ${binary:Version}),
|
||||||
openzfs-libzfsbootenv1 (= ${binary:Version}),
|
openzfs-libzfsbootenv1 (= ${binary:Version}),
|
||||||
openzfs-libzpool6 (= ${binary:Version}),
|
openzfs-libzpool7 (= ${binary:Version}),
|
||||||
${misc:Depends}
|
${misc:Depends}
|
||||||
Replaces: libzfslinux-dev
|
Replaces: libzfslinux-dev
|
||||||
Conflicts: libzfslinux-dev
|
Conflicts: libzfslinux-dev
|
||||||
@ -91,18 +91,18 @@ Description: OpenZFS filesystem development files for Linux
|
|||||||
libraries of OpenZFS filesystem.
|
libraries of OpenZFS filesystem.
|
||||||
.
|
.
|
||||||
This package includes the development files of libnvpair3, libuutil3,
|
This package includes the development files of libnvpair3, libuutil3,
|
||||||
libzpool6 and libzfs6.
|
libzpool7 and libzfs7.
|
||||||
|
|
||||||
Package: openzfs-libzfs6
|
Package: openzfs-libzfs7
|
||||||
Section: contrib/libs
|
Section: contrib/libs
|
||||||
Architecture: linux-any
|
Architecture: linux-any
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||||
# The libcurl4 is loaded through dlopen("libcurl.so.4").
|
# The libcurl4 is loaded through dlopen("libcurl.so.4").
|
||||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988521
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988521
|
||||||
Recommends: libcurl4
|
Recommends: libcurl4
|
||||||
Breaks: libzfs2, libzfs4, libzfs4linux, libzfs6linux, openzfs-libzfs4
|
Breaks: libzfs2, libzfs4, libzfs4linux, libzfs6linux, libzfs7linux, openzfs-libzfs4, openzfs-libzfs6
|
||||||
Replaces: libzfs2, libzfs4, libzfs4linux, libzfs6linux, openzfs-libzfs4
|
Replaces: libzfs2, libzfs4, libzfs4linux, libzfs6linux, libzfs7linux, openzfs-libzfs4, openzfs-libzfs6
|
||||||
Conflicts: libzfs6linux
|
Conflicts: libzfs7linux
|
||||||
Description: OpenZFS filesystem library for Linux - general support
|
Description: OpenZFS filesystem library for Linux - general support
|
||||||
OpenZFS is a storage platform that encompasses the functionality of
|
OpenZFS is a storage platform that encompasses the functionality of
|
||||||
traditional filesystems and volume managers. It supports data checksums,
|
traditional filesystems and volume managers. It supports data checksums,
|
||||||
@ -124,13 +124,13 @@ Description: OpenZFS filesystem library for Linux - label info support
|
|||||||
.
|
.
|
||||||
The zfsbootenv library provides support for modifying ZFS label information.
|
The zfsbootenv library provides support for modifying ZFS label information.
|
||||||
|
|
||||||
Package: openzfs-libzpool6
|
Package: openzfs-libzpool7
|
||||||
Section: contrib/libs
|
Section: contrib/libs
|
||||||
Architecture: linux-any
|
Architecture: linux-any
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||||
Breaks: libzpool2, libzpool5, libzpool6linux
|
Breaks: libzpool2, libzpool5, libzpool6linux, libzpool7linux
|
||||||
Replaces: libzpool2, libzpool5, libzpool6linux
|
Replaces: libzpool2, libzpool5, libzpool6linux, libzpool7linux
|
||||||
Conflicts: libzpool6linux
|
Conflicts: libzpool7linux
|
||||||
Description: OpenZFS pool library for Linux
|
Description: OpenZFS pool library for Linux
|
||||||
OpenZFS is a storage platform that encompasses the functionality of
|
OpenZFS is a storage platform that encompasses the functionality of
|
||||||
traditional filesystems and volume managers. It supports data checksums,
|
traditional filesystems and volume managers. It supports data checksums,
|
||||||
@ -247,8 +247,8 @@ Architecture: linux-any
|
|||||||
Pre-Depends: ${misc:Pre-Depends}
|
Pre-Depends: ${misc:Pre-Depends}
|
||||||
Depends: openzfs-libnvpair3 (= ${binary:Version}),
|
Depends: openzfs-libnvpair3 (= ${binary:Version}),
|
||||||
openzfs-libuutil3 (= ${binary:Version}),
|
openzfs-libuutil3 (= ${binary:Version}),
|
||||||
openzfs-libzfs6 (= ${binary:Version}),
|
openzfs-libzfs7 (= ${binary:Version}),
|
||||||
openzfs-libzpool6 (= ${binary:Version}),
|
openzfs-libzpool7 (= ${binary:Version}),
|
||||||
python3,
|
python3,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${shlibs:Depends}
|
${shlibs:Depends}
|
||||||
|
|||||||
@ -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 +0,0 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/libzfs.so.*
|
|
||||||
lib/@DEB_HOST_MULTIARCH@/libzfs_core.so.*
|
|
||||||
2
contrib/debian/openzfs-libzfs7.install.in
Normal file
2
contrib/debian/openzfs-libzfs7.install.in
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
usr/lib/@DEB_HOST_MULTIARCH@/libzfs.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 +0,0 @@
|
|||||||
lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
|
|
||||||
1
contrib/debian/openzfs-libzpool7.install.in
Normal file
1
contrib/debian/openzfs-libzpool7.install.in
Normal file
@ -0,0 +1 @@
|
|||||||
|
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() {
|
||||||
|
|||||||
@ -97,7 +97,7 @@ fi
|
|||||||
if [ "$(zpool get -Ho value feature@encryption "${ZFS_POOL}")" = 'active' ]; then
|
if [ "$(zpool get -Ho value feature@encryption "${ZFS_POOL}")" = 'active' ]; then
|
||||||
# if the root dataset has encryption enabled
|
# if the root dataset has encryption enabled
|
||||||
ENCRYPTIONROOT="$(zfs get -Ho value encryptionroot "${ZFS_DATASET}")"
|
ENCRYPTIONROOT="$(zfs get -Ho value encryptionroot "${ZFS_DATASET}")"
|
||||||
if ! [ "${ENCRYPTIONROOT}" = "-" ]; then
|
if [ "${ENCRYPTIONROOT}" != "-" ]; then
|
||||||
KEYSTATUS="$(zfs get -Ho value keystatus "${ENCRYPTIONROOT}")"
|
KEYSTATUS="$(zfs get -Ho value keystatus "${ENCRYPTIONROOT}")"
|
||||||
# if the key needs to be loaded
|
# if the key needs to be loaded
|
||||||
if [ "$KEYSTATUS" = "unavailable" ]; then
|
if [ "$KEYSTATUS" = "unavailable" ]; then
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -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_
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user