mirror of
https://github.com/openzfs/zfs.git
synced 2025-10-01 11:26:49 +00:00
Compare commits
670 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
102ff2a640 | ||
![]() |
e4a407f29f | ||
![]() |
f0a95e8971 | ||
![]() |
75be5f2973 | ||
![]() |
8d4c3ee9e6 | ||
![]() |
4ff25e9013 | ||
![]() |
a44985315e | ||
![]() |
79be201806 | ||
![]() |
aecd6deeb3 | ||
![]() |
5c38029f4b | ||
![]() |
26b0f561be | ||
![]() |
c722bf8812 | ||
![]() |
0e1a53a8c0 | ||
![]() |
3e9347c9f7 | ||
![]() |
b2196fbedf | ||
![]() |
ea37c30fcb | ||
![]() |
876f705cc4 | ||
![]() |
11787965e0 | ||
![]() |
6ba51da93b | ||
![]() |
545d66204d | ||
![]() |
3387d34093 | ||
![]() |
ab8cc63c77 | ||
![]() |
ab93b4b70e | ||
![]() |
ffe93aee0a | ||
![]() |
1d2d812986 | ||
![]() |
d36684201f | ||
![]() |
45ac6045cc | ||
![]() |
faf2db3435 | ||
![]() |
d147ed7d26 | ||
![]() |
58b84289e8 | ||
![]() |
5c46baa1ce | ||
![]() |
f330b463de | ||
![]() |
4b764fb01a | ||
![]() |
f319ff3570 | ||
![]() |
3f4312a0a4 | ||
![]() |
9b772f328b | ||
![]() |
455c36156c | ||
![]() |
bc8bcfc71a | ||
![]() |
cb5f9aa582 | ||
![]() |
35f47cb4f4 | ||
![]() |
37cd30f714 | ||
![]() |
955fbc5ade | ||
![]() |
7b1cc9eb61 | ||
![]() |
654f2dcb42 | ||
![]() |
bc0b5318aa | ||
![]() |
d64711c202 | ||
![]() |
0620c979a5 | ||
![]() |
7f7c58389e | ||
![]() |
cd6db758f3 | ||
![]() |
bc4aac0395 | ||
![]() |
8f15d2e4d5 | ||
![]() |
92ca3ae56a | ||
![]() |
9ae20cf03d | ||
![]() |
a5571a0dd1 | ||
![]() |
d3429a75b0 | ||
![]() |
c6fe41cac5 | ||
![]() |
fe2f7cf6d7 | ||
![]() |
7939bad5e7 | ||
![]() |
9e5e95c24d | ||
![]() |
4b83891db0 | ||
![]() |
e29bfa5bd0 | ||
![]() |
a2424312c4 | ||
![]() |
59f8f5dfe1 | ||
![]() |
8266fa5858 | ||
![]() |
e3c3e86c04 | ||
![]() |
ced72fdd69 | ||
![]() |
b9c6b0e09b | ||
![]() |
c69b7ea6ca | ||
![]() |
ffba31c236 | ||
![]() |
dfc2c32590 | ||
![]() |
11b5c50238 | ||
![]() |
0e88a0e1ea | ||
![]() |
69b65dda8a | ||
![]() |
64d3143e82 | ||
![]() |
9acedbacee | ||
![]() |
5a8ba4520b | ||
![]() |
ccf5a8a6fc | ||
![]() |
1da2c30bed | ||
![]() |
976f765341 | ||
![]() |
ee7c362645 | ||
![]() |
14bad10f96 | ||
![]() |
e903177b56 | ||
![]() |
d247538e15 | ||
![]() |
0d54ae2880 | ||
![]() |
b6bd3228bb | ||
![]() |
e7485d04f1 | ||
![]() |
f1f74577cb | ||
![]() |
00dfa094ac | ||
![]() |
28ff57505b | ||
![]() |
94413bc75d | ||
![]() |
574eec2964 | ||
![]() |
aa6f0f878b | ||
![]() |
eecff1b4a9 | ||
![]() |
f3e49b0cf5 | ||
![]() |
3abf72b251 | ||
![]() |
14d2480708 | ||
![]() |
79a59ae787 | ||
![]() |
2d7928428b | ||
![]() |
a9410ccbd9 | ||
![]() |
2c877e8453 | ||
![]() |
dcd73069f0 | ||
![]() |
8a0e5e8b54 | ||
![]() |
96f9d271ea | ||
![]() |
b2c792778c | ||
![]() |
6bb8fe5528 | ||
![]() |
30a915efed | ||
![]() |
7b54567c1f | ||
![]() |
f65321e30c | ||
![]() |
9b0a9b410e | ||
![]() |
5061f959d1 | ||
![]() |
d151432073 | ||
![]() |
8d35a022e4 | ||
![]() |
28433c4547 | ||
![]() |
930f9cc66c | ||
![]() |
bb9225ea86 | ||
![]() |
885d929cf8 | ||
![]() |
3cfd670e74 | ||
![]() |
077269bfed | ||
![]() |
d3c1d27afd | ||
![]() |
f8bc01c79f | ||
![]() |
22671c4da4 | ||
![]() |
152e34822b | ||
![]() |
1ccae433e9 | ||
![]() |
e0e60d319c | ||
![]() |
531568f438 | ||
![]() |
7c9adc6858 | ||
![]() |
f562e0f691 | ||
![]() |
92da3e18c8 | ||
![]() |
508c546975 | ||
![]() |
6b3333de2d | ||
![]() |
1d0b94c4e7 | ||
![]() |
2fd145b578 | ||
![]() |
90a1e13df2 | ||
![]() |
ef4058fcdc | ||
![]() |
3d6ee9a68c | ||
![]() |
391e85f519 | ||
![]() |
72602f6ad9 | ||
![]() |
99a5f5d1ba | ||
![]() |
967b15b888 | ||
![]() |
1f8c39ddb2 | ||
![]() |
b270663e8a | ||
![]() |
82d6f7b047 | ||
![]() |
f7bdd84328 | ||
![]() |
611b95da18 | ||
![]() |
5c7df3bcac | ||
![]() |
c39e076f23 | ||
![]() |
2564308cb2 | ||
![]() |
e44e51f28d | ||
![]() |
e6eb03a991 | ||
![]() |
3e671f2353 | ||
![]() |
0c376d0f59 | ||
![]() |
3e004369f7 | ||
![]() |
25930cb8a1 | ||
![]() |
03592417cb | ||
![]() |
8302b6e32b | ||
![]() |
60f714e6e2 | ||
![]() |
4ae8bf406b | ||
![]() |
894edd084e | ||
![]() |
c3496b5cc6 | ||
![]() |
fb7a8503bc | ||
![]() |
a18c9edda6 | ||
![]() |
7ac5440ecf | ||
![]() |
31c4fa93bb | ||
![]() |
8ecf044d62 | ||
![]() |
2c8beeece0 | ||
![]() |
48c9b2e79d | ||
![]() |
0b6fd024a7 | ||
![]() |
0f8a1105ee | ||
![]() |
1aec627c60 | ||
![]() |
92da9e0e93 | ||
![]() |
cb5e7e097d | ||
![]() |
2957eabbef | ||
![]() |
dea0fc969b | ||
![]() |
ce9c3b4b94 | ||
![]() |
f70c85086b | ||
![]() |
10a78e2647 | ||
![]() |
b6e8db509d | ||
![]() |
fc885f308f | ||
![]() |
f23e040a37 | ||
![]() |
cf146460c1 | ||
![]() |
4bd7a2eaa5 | ||
![]() |
a8646a8186 | ||
![]() |
5a9b9c7f87 | ||
![]() |
00ce064d8f | ||
![]() |
bf38c15071 | ||
![]() |
d2b9e66b88 | ||
![]() |
e9d249d7e4 | ||
![]() |
2755e2aa60 | ||
![]() |
9292071565 | ||
![]() |
1c483cf3d0 | ||
![]() |
96d20d7d59 | ||
![]() |
cecff09faa | ||
![]() |
a7a144e655 | ||
![]() |
be1e991a1a | ||
![]() |
2669b00f13 | ||
![]() |
d7ab07dfb4 | ||
![]() |
c1e51c55f5 | ||
![]() |
b21e04e8d9 | ||
![]() |
d323fbf49c | ||
![]() |
ee2a2d941a | ||
![]() |
1b84bd1dff | ||
![]() |
fce18e04d5 | ||
![]() |
cb9742e532 | ||
![]() |
967ce75669 | ||
![]() |
3a494c6d2a | ||
![]() |
fe3b2b76cf | ||
![]() |
8de8e0df9f | ||
![]() |
2461e6f636 | ||
![]() |
d6dcae3166 | ||
![]() |
f66b57c87d | ||
![]() |
ea38787f2e | ||
![]() |
a981cb69e4 | ||
![]() |
e845be28e7 | ||
![]() |
4c2a7f85d5 | ||
![]() |
523d9d6007 | ||
![]() |
6af8db61b1 | ||
![]() |
92d3b4ee2c | ||
![]() |
ee0cb4cb89 | ||
![]() |
d411ea2e4d | ||
![]() |
c98a393cb6 | ||
![]() |
4e92aee233 | ||
![]() |
17ee0fd4fa | ||
![]() |
6d838ec0b6 | ||
![]() |
bf846dcb7d | ||
![]() |
eacf618a65 | ||
![]() |
dee62e074a | ||
![]() |
69ee01aa4b | ||
![]() |
ea076d6921 | ||
![]() |
0a2163d194 | ||
![]() |
d461a67d0a | ||
![]() |
46a4075100 | ||
![]() |
48ce292ea0 | ||
![]() |
8170eb6ebc | ||
![]() |
5e5253be84 | ||
![]() |
717213d431 | ||
![]() |
585dbbf13b | ||
![]() |
6cf17f6538 | ||
![]() |
bd27b75401 | ||
![]() |
b4ebba0e04 | ||
![]() |
238eab7dc1 | ||
![]() |
aa964ce61b | ||
![]() |
d1c88cbd4c | ||
![]() |
e3f5e317e0 | ||
![]() |
52352dd748 | ||
![]() |
c1b7bc52fe | ||
![]() |
e0ef4d2768 | ||
![]() |
66ec7fb269 | ||
![]() |
4ae931aa93 | ||
![]() |
3ff2eca0be | ||
![]() |
1987498b66 | ||
![]() |
fbfda270d5 | ||
![]() |
560e3170ef | ||
![]() |
ba227e2cc2 | ||
![]() |
bcd0430236 | ||
![]() |
0e9e2e2501 | ||
![]() |
46b82de618 | ||
![]() |
af7d609592 | ||
![]() |
b96f1a4b1f | ||
![]() |
b7f919d228 | ||
![]() |
68817d28c5 | ||
![]() |
108562344c | ||
![]() |
e0edfcbd4e | ||
![]() |
e1677d9ee1 | ||
![]() |
e8e602d987 | ||
![]() |
90011644ce | ||
![]() |
2d33c8edb6 | ||
![]() |
f03f9c9bde | ||
![]() |
08bf660ac4 | ||
![]() |
a38376b37a | ||
![]() |
1bd225ed8a | ||
![]() |
008c9666ef | ||
![]() |
f5a6dd8b70 | ||
![]() |
b3b3cd1e4f | ||
![]() |
1d482ca6e3 | ||
![]() |
5764e218ba | ||
![]() |
44e3266894 | ||
![]() |
0c94d3838d | ||
![]() |
3084336ae4 | ||
![]() |
3dfa98d013 | ||
![]() |
fa697b94e6 | ||
![]() |
00360efa35 | ||
![]() |
9392be427e | ||
![]() |
dd4e2f99f0 | ||
![]() |
589d99171f | ||
![]() |
6e7e7ea7ef | ||
![]() |
58235f52af | ||
![]() |
7b183f1918 | ||
![]() |
b0e053a10d | ||
![]() |
d1724b59dc | ||
![]() |
5ef91c2bee | ||
![]() |
906ced88df | ||
![]() |
c464f1d014 | ||
![]() |
0372def8c9 | ||
![]() |
2303775fea | ||
![]() |
55d035e866 | ||
![]() |
4653e2f7d3 | ||
![]() |
ac2e579521 | ||
![]() |
468d22d60c | ||
![]() |
8487945034 | ||
![]() |
06fa8f3f69 | ||
![]() |
087d7d80c7 | ||
![]() |
fc617645a3 | ||
![]() |
284580c878 | ||
![]() |
2a91d577b1 | ||
![]() |
b048bfa9c1 | ||
![]() |
9d76950d67 | ||
![]() |
b01d7bd32d | ||
![]() |
92157c840c | ||
![]() |
cdb4c44684 | ||
![]() |
ddf28f27c5 | ||
![]() |
5c30b24381 | ||
![]() |
a6f20250de | ||
![]() |
a387b7599c | ||
![]() |
c4c3917b2a | ||
![]() |
f454cc1723 | ||
![]() |
2e5e4bb0f8 | ||
![]() |
83fa80a550 | ||
![]() |
f0baaa329a | ||
![]() |
841be1d049 | ||
![]() |
bb740d66de | ||
![]() |
d8a33bc0a5 | ||
![]() |
ea74cdedda | ||
![]() |
e55225be3e | ||
![]() |
d5616ad34a | ||
![]() |
086105f4c4 | ||
![]() |
b6916f995e | ||
![]() |
89a8a91582 | ||
![]() |
0aa83dce99 | ||
![]() |
b55256e5bb | ||
![]() |
734eba251d | ||
![]() |
e2ba0f7643 | ||
![]() |
485a2d0112 | ||
![]() |
ae2caf9cb0 | ||
![]() |
8e318fda80 | ||
![]() |
b2284aedab | ||
![]() |
49fbdd4533 | ||
![]() |
9aae14a14a | ||
![]() |
8b9c4e643b | ||
![]() |
2ee5b51a57 | ||
![]() |
c17bdc4914 | ||
![]() |
1a8f5ad3b0 | ||
![]() |
f13d760aa8 | ||
![]() |
4800181b3b | ||
![]() |
78628a5c15 | ||
![]() |
b1ccab1721 | ||
![]() |
c5a6b4417d | ||
![]() |
246e5883bb | ||
![]() |
a7de203c86 | ||
![]() |
f85c96edf7 | ||
![]() |
f86d9af16b | ||
![]() |
634c172ee8 | ||
![]() |
a6cca8a7da | ||
![]() |
f40ab9e399 | ||
![]() |
3b18877269 | ||
![]() |
27f3d94940 | ||
![]() |
aa46cc9812 | ||
![]() |
81dec433b0 | ||
![]() |
c8fa39b46c | ||
![]() |
ba17cedf65 | ||
![]() |
63de2d2dbd | ||
![]() |
88ec6c4f40 | ||
![]() |
d947b9aedd | ||
![]() |
1ef706c4ad | ||
![]() |
1b4826b9a2 | ||
![]() |
7031a48c70 | ||
![]() |
37a3e26552 | ||
![]() |
38c3a8be83 | ||
![]() |
6afb405d96 | ||
![]() |
8f2c2dea3c | ||
![]() |
cb49e7701f | ||
![]() |
5f5321effa | ||
![]() |
1d8f625233 | ||
![]() |
8d1489735b | ||
![]() |
ba03054c83 | ||
![]() |
155847c72d | ||
![]() |
4866c2fabf | ||
![]() |
131df3bbf2 | ||
![]() |
189dc26296 | ||
![]() |
5ab601771c | ||
![]() |
ab9bb193f9 | ||
![]() |
a497c5fc8b | ||
![]() |
8f08dbfbe1 | ||
![]() |
88e3885cf4 | ||
![]() |
09fc7bb47e | ||
![]() |
78a7c78bdf | ||
![]() |
b14b3e3985 | ||
![]() |
c050b7315d | ||
![]() |
7bb13950b4 | ||
![]() |
c967faf19e | ||
![]() |
7c4ff2a051 | ||
![]() |
6f6c504700 | ||
![]() |
9cb9a59e1c | ||
![]() |
20705a8430 | ||
![]() |
2a8d9d9607 | ||
![]() |
7be9fa259e | ||
![]() |
5b0c27cd14 | ||
![]() |
029c4ae03a | ||
![]() |
047803e906 | ||
![]() |
87f8bf6b0c | ||
![]() |
301da593ad | ||
![]() |
367d34b3aa | ||
![]() |
11ca12dbd3 | ||
![]() |
75e921da6f | ||
![]() |
5b29e70ae1 | ||
![]() |
30cc2331f4 | ||
![]() |
dd2a46b5e6 | ||
![]() |
4abc21b28c | ||
![]() |
50d87fed6a | ||
![]() |
240fc4a6d1 | ||
![]() |
a0e62718cf | ||
![]() |
9611dfdc70 | ||
![]() |
885f87fa3e | ||
![]() |
fd018248d5 | ||
![]() |
ef81812726 | ||
![]() |
e759a86fa5 | ||
![]() |
1d4505d7a1 | ||
![]() |
b386bf87c1 | ||
![]() |
73494f3352 | ||
![]() |
530ddcd5f1 | ||
![]() |
94a3fabcb0 | ||
![]() |
3862ebbf1f | ||
![]() |
45e9b54e9e | ||
![]() |
d28d2e3007 | ||
![]() |
5b5a514955 | ||
![]() |
9250403ba6 | ||
![]() |
94b9cbbe1e | ||
![]() |
676b7ef104 | ||
![]() |
83fa051ceb | ||
![]() |
d033f26765 | ||
![]() |
3cd9934a48 | ||
![]() |
6e89095873 | ||
![]() |
cb4b854838 | ||
![]() |
f69631992d | ||
![]() |
21850f519b | ||
![]() |
f5312d2996 | ||
![]() |
a8847a7e4f | ||
![]() |
bf754d6010 | ||
![]() |
44dc09614e | ||
![]() |
9fd7401d75 | ||
![]() |
ff28d9fc6f | ||
![]() |
f8d29099e7 | ||
![]() |
f83431b3bd | ||
![]() |
c404ffb446 | ||
![]() |
7d8dd8d9a5 | ||
![]() |
4eafa9e5e8 | ||
![]() |
137045be98 | ||
![]() |
eb9098ed47 | ||
![]() |
201d262949 | ||
![]() |
1b495eeab3 | ||
![]() |
084531bcce | ||
![]() |
0ea44e576b | ||
![]() |
09f4dd06c3 | ||
![]() |
13ec35ce3b | ||
![]() |
0433523ca2 | ||
![]() |
4ddaf45ba4 | ||
![]() |
41823a0ede | ||
![]() |
62a9d372f8 | ||
![]() |
fe674998bb | ||
![]() |
57f192fcaa | ||
![]() |
fc460bfbaf | ||
![]() |
a44f423b00 | ||
![]() |
72c0fde609 | ||
![]() |
60031906b4 | ||
![]() |
2c897e0666 | ||
![]() |
4581c4fcbe | ||
![]() |
cc9180d338 | ||
![]() |
4afec534cc | ||
![]() |
f65fc98a8c | ||
![]() |
7f05fface3 | ||
![]() |
88b0594f93 | ||
![]() |
ece35e0e66 | ||
![]() |
ab3db6d15d | ||
![]() |
701093c44f | ||
![]() |
a5fb5c55be | ||
![]() |
d7d2744711 | ||
![]() |
523e3adac9 | ||
![]() |
ecc44c45cb | ||
![]() |
ee8803adc2 | ||
![]() |
682c5f6a0a | ||
![]() |
c43df8bbbf | ||
![]() |
6a2f7b3844 | ||
![]() |
68473c4fd8 | ||
![]() |
d4a5a7e3aa | ||
![]() |
db62886d98 | ||
![]() |
b901d4a0b6 | ||
![]() |
b8c73ab780 | ||
![]() |
d2147de319 | ||
![]() |
c2458ba921 | ||
![]() |
88020b993c | ||
![]() |
40496514b8 | ||
![]() |
2cccbacefc | ||
![]() |
0be1da26cb | ||
![]() |
2ca91ba3cf | ||
![]() |
7ef6b70e96 | ||
![]() |
390f6c1190 | ||
![]() |
21205f6488 | ||
![]() |
387ed5ca41 | ||
![]() |
1e32c57893 | ||
![]() |
12f0baf348 | ||
![]() |
34205715e1 | ||
![]() |
26e38aec46 | ||
![]() |
dfdc5ea993 | ||
![]() |
59a77512ca | ||
![]() |
4acce93fde | ||
![]() |
722cf7bfd5 | ||
![]() |
b8c0c154ad | ||
![]() |
919bc4d10e | ||
![]() |
788e69ca5d | ||
![]() |
aaeb7fa3d0 | ||
![]() |
fe44c5ae27 | ||
![]() |
2aa3fbe761 | ||
![]() |
fae4c664a4 | ||
![]() |
b8e09c7007 | ||
![]() |
18c67d2418 | ||
![]() |
3a445f2ef5 | ||
![]() |
dc0324bfa9 | ||
![]() |
939e0237c5 | ||
![]() |
50cbb14641 | ||
![]() |
ee3bde9dad | ||
![]() |
c02e1cf055 | ||
![]() |
e94549d868 | ||
![]() |
478b09577a | ||
![]() |
d35f9f2e84 | ||
![]() |
d6b4110d71 | ||
![]() |
8dc15ef4b3 | ||
![]() |
3c2267a873 | ||
![]() |
25238baad5 | ||
![]() |
54126fdb5b | ||
![]() |
9dd5fe1095 | ||
![]() |
a153397f41 | ||
![]() |
b66d910113 | ||
![]() |
8bf1e83eef | ||
![]() |
c4e5fa5e17 | ||
![]() |
03b7cfdef3 | ||
![]() |
779c5a5deb | ||
![]() |
89f796dec6 | ||
![]() |
c37a2ddaaa | ||
![]() |
1acd246964 | ||
![]() |
219a89cbbf | ||
![]() |
f00a57a786 | ||
![]() |
e5ac7786bd | ||
![]() |
ab7cbbe789 | ||
![]() |
830a531249 | ||
![]() |
882a809983 | ||
![]() |
c6442bd3b6 | ||
![]() |
acda137d8c | ||
![]() |
22259fb24d | ||
![]() |
ff6266ee9b | ||
![]() |
586304ac44 | ||
![]() |
46e06feded | ||
![]() |
fbea92432a | ||
![]() |
76f57ab9f7 | ||
![]() |
ecc0970e3e | ||
![]() |
6c9b4f18d3 | ||
![]() |
19a04e5ad2 | ||
![]() |
e0039c7057 | ||
![]() |
0de8ae56f7 | ||
![]() |
ba00a6f9a3 | ||
![]() |
903895ea5f | ||
![]() |
a44eaf1690 | ||
![]() |
e8b333e4d3 | ||
![]() |
44446dccdb | ||
![]() |
2507db612d | ||
![]() |
a01504b35c | ||
![]() |
c33a55b0c2 | ||
![]() |
0e020bf3e1 | ||
![]() |
4b4e346b9f | ||
![]() |
1cd2419ece | ||
![]() |
654ade8ca2 | ||
![]() |
ae00c807dc | ||
![]() |
027b3e06ed | ||
![]() |
6e3c109bc0 | ||
![]() |
3e9ba0f223 | ||
![]() |
c8a326aab7 | ||
![]() |
f29dcc25c7 | ||
![]() |
0ffa6f3464 | ||
![]() |
d2b0ca953f | ||
![]() |
d0a91b9f88 | ||
![]() |
b3b0ce64d5 | ||
![]() |
38c0324c0f | ||
![]() |
ae1d11882d | ||
![]() |
225e76cd7d | ||
![]() |
9a81484e35 | ||
![]() |
d02257c280 | ||
![]() |
d76d79fd27 | ||
![]() |
457f8b76e7 | ||
![]() |
49a377aa30 | ||
![]() |
0ca82c5680 | ||
![]() |
534688948c | ||
![]() |
ffe2112795 | ||
![]() |
e08e832b10 | ||
![]() |
0d6306be8c | ||
![]() |
ff3df1211c | ||
![]() |
fd6e8c1d2a | ||
![]() |
309ce6303f | ||
![]() |
1ee251bdde | ||
![]() |
483087b06f | ||
![]() |
648873f020 | ||
![]() |
de2e9a5c6b | ||
![]() |
3462f3bd50 | ||
![]() |
8dc452d907 | ||
![]() |
46c4f2ce0b | ||
![]() |
a60ed3822b | ||
![]() |
178682506f | ||
![]() |
25eb538778 | ||
![]() |
1c9a4c8cb4 | ||
![]() |
3a0a142f1c | ||
![]() |
57fc5971f6 | ||
![]() |
4a7a0a0290 | ||
![]() |
187f931372 | ||
![]() |
5945676bcc | ||
![]() |
7b6e9675da | ||
![]() |
f38e2d239f | ||
![]() |
60c202cca4 | ||
![]() |
e17a9698fa | ||
![]() |
5e726779f5 | ||
![]() |
5a2333b10f | ||
![]() |
c8aed9f973 | ||
![]() |
b16e096198 | ||
![]() |
91bd12dfeb | ||
![]() |
1c7d4b4c94 | ||
![]() |
db2354534d | ||
![]() |
673efbbf5d | ||
![]() |
acb6e71eda | ||
![]() |
3c650bec15 | ||
![]() |
e7425ae624 | ||
![]() |
63bafe60ec | ||
![]() |
ae93aeb849 | ||
![]() |
6187b19434 | ||
![]() |
2bf1520211 | ||
![]() |
c480e06d88 | ||
![]() |
e5d1f68167 | ||
![]() |
94a03dd1e4 | ||
![]() |
2e4e092822 | ||
![]() |
aefc2da8a5 | ||
![]() |
152ae5c9bc | ||
![]() |
96f382d113 | ||
![]() |
21cba06bef | ||
![]() |
b2f6de7b58 | ||
![]() |
a9851ea3dd | ||
![]() |
fba6a90696 | ||
![]() |
b85c564161 | ||
![]() |
2596a75306 | ||
![]() |
c7e47b3d9a | ||
![]() |
0a001f3088 | ||
![]() |
27e8f56102 | ||
![]() |
38a04f0a7c | ||
![]() |
e0bf43d64e | ||
![]() |
e7b64159f8 | ||
![]() |
c642e985e5 | ||
![]() |
48dfe39747 | ||
![]() |
97ba7c210c | ||
![]() |
9f3f80c0cc | ||
![]() |
34efa8e2d8 | ||
![]() |
7e4be92750 | ||
![]() |
7bf525530a | ||
![]() |
b4e4cbeb20 | ||
![]() |
efeb60b86a | ||
![]() |
4319e71402 | ||
![]() |
cefef28e98 | ||
![]() |
75dda92dc3 | ||
![]() |
65a94ffa80 | ||
![]() |
ca0141f325 | ||
![]() |
ab777f436c | ||
![]() |
e8f0aa143e | ||
![]() |
c59d5495fe | ||
![]() |
0b4dcbe5b4 | ||
![]() |
995a3a61fd | ||
![]() |
87ca6ba9a8 | ||
![]() |
437227a9cc |
21
.cirrus.yml
21
.cirrus.yml
@ -1,21 +0,0 @@
|
|||||||
env:
|
|
||||||
CIRRUS_CLONE_DEPTH: 1
|
|
||||||
ARCH: amd64
|
|
||||||
|
|
||||||
build_task:
|
|
||||||
matrix:
|
|
||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-12-4
|
|
||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-13-2
|
|
||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-14-0-snap
|
|
||||||
prepare_script:
|
|
||||||
- pkg install -y autoconf automake libtool gettext-runtime gmake ksh93 py39-packaging py39-cffi py39-sysctl
|
|
||||||
configure_script:
|
|
||||||
- env MAKE=gmake ./autogen.sh
|
|
||||||
- env MAKE=gmake ./configure --with-config="user" --with-python=3.9
|
|
||||||
build_script:
|
|
||||||
- gmake -j `sysctl -n kern.smp.cpus`
|
|
||||||
install_script:
|
|
||||||
- gmake install
|
|
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
6
.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. -->
|
||||||
@ -27,6 +22,7 @@ https://openzfs.github.io/openzfs-docs/Developer%20Resources/Buildbot%20Options.
|
|||||||
- [ ] New feature (non-breaking change which adds functionality)
|
- [ ] New feature (non-breaking change which adds functionality)
|
||||||
- [ ] Performance enhancement (non-breaking change which improves efficiency)
|
- [ ] Performance enhancement (non-breaking change which improves efficiency)
|
||||||
- [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
|
- [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
|
||||||
|
- [ ] Quality assurance (non-breaking change which makes the code more robust against bugs)
|
||||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||||
- [ ] Library ABI change (libzfs, libzfs\_core, libnvpair, libuutil and libzfsbootenv)
|
- [ ] Library ABI change (libzfs, libzfs\_core, libnvpair, libuutil and libzfsbootenv)
|
||||||
- [ ] Documentation (a change to man pages or other documentation)
|
- [ ] Documentation (a change to man pages or other documentation)
|
||||||
|
1
.github/codeql-cpp.yml
vendored
1
.github/codeql-cpp.yml
vendored
@ -2,3 +2,4 @@ name: "Custom CodeQL Analysis"
|
|||||||
|
|
||||||
queries:
|
queries:
|
||||||
- uses: ./.github/codeql/custom-queries/cpp/deprecatedFunctionUsage.ql
|
- uses: ./.github/codeql/custom-queries/cpp/deprecatedFunctionUsage.ql
|
||||||
|
- uses: ./.github/codeql/custom-queries/cpp/dslDatasetHoldReleMismatch.ql
|
||||||
|
34
.github/codeql/custom-queries/cpp/dslDatasetHoldReleMismatch.ql
vendored
Normal file
34
.github/codeql/custom-queries/cpp/dslDatasetHoldReleMismatch.ql
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* @name Detect mismatched dsl_dataset_hold/_rele pairs
|
||||||
|
* @description Flags instances of issue #12014 where
|
||||||
|
* - a dataset held with dsl_dataset_hold_obj() ends up in dsl_dataset_rele_flags(), or
|
||||||
|
* - a dataset held with dsl_dataset_hold_obj_flags() ends up in dsl_dataset_rele().
|
||||||
|
* @kind problem
|
||||||
|
* @severity error
|
||||||
|
* @tags correctness
|
||||||
|
* @id cpp/dslDatasetHoldReleMismatch
|
||||||
|
*/
|
||||||
|
|
||||||
|
import cpp
|
||||||
|
|
||||||
|
from Variable ds, Call holdCall, Call releCall, string message
|
||||||
|
where
|
||||||
|
ds.getType().toString() = "dsl_dataset_t *" and
|
||||||
|
holdCall.getASuccessor*() = releCall and
|
||||||
|
(
|
||||||
|
(holdCall.getTarget().getName() = "dsl_dataset_hold_obj_flags" and
|
||||||
|
holdCall.getArgument(4).(AddressOfExpr).getOperand().(VariableAccess).getTarget() = ds and
|
||||||
|
releCall.getTarget().getName() = "dsl_dataset_rele" and
|
||||||
|
releCall.getArgument(0).(VariableAccess).getTarget() = ds and
|
||||||
|
message = "Held with dsl_dataset_hold_obj_flags but released with dsl_dataset_rele")
|
||||||
|
or
|
||||||
|
(holdCall.getTarget().getName() = "dsl_dataset_hold_obj" and
|
||||||
|
holdCall.getArgument(3).(AddressOfExpr).getOperand().(VariableAccess).getTarget() = ds and
|
||||||
|
releCall.getTarget().getName() = "dsl_dataset_rele_flags" and
|
||||||
|
releCall.getArgument(0).(VariableAccess).getTarget() = ds and
|
||||||
|
message = "Held with dsl_dataset_hold_obj but released with dsl_dataset_rele_flags")
|
||||||
|
)
|
||||||
|
select releCall,
|
||||||
|
"Mismatched release: held with $@ but released with " + releCall.getTarget().getName() + " for dataset $@",
|
||||||
|
holdCall, holdCall.getTarget().getName(),
|
||||||
|
ds, ds.toString()
|
2
.github/workflows/checkstyle.yaml
vendored
2
.github/workflows/checkstyle.yaml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# for x in lxd core20 snapd; do sudo snap remove $x; done
|
# for x in lxd core20 snapd; do sudo snap remove $x; done
|
||||||
sudo apt-get purge -y snapd google-chrome-stable firefox
|
sudo apt-get purge -y snapd google-chrome-stable firefox
|
||||||
ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps.sh ubuntu22
|
ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps-vm.sh ubuntu22
|
||||||
sudo apt-get install -y cppcheck devscripts mandoc pax-utils shellcheck
|
sudo apt-get install -y cppcheck devscripts mandoc pax-utils shellcheck
|
||||||
sudo python -m pipx install --quiet flake8
|
sudo python -m pipx install --quiet flake8
|
||||||
# confirm that the tools are installed
|
# confirm that the tools are installed
|
||||||
|
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@ -11,7 +11,7 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: Analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
contents: read
|
contents: read
|
||||||
|
49
.github/workflows/labels.yml
vendored
Normal file
49
.github/workflows/labels.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
name: labels
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [ opened, synchronize, reopened, converted_to_draft, ready_for_review ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
open:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'opened' && github.event.pull_request.draft }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --add-label "Status: Work in Progress"
|
||||||
|
|
||||||
|
push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'synchronize' || github.event.action == 'reopened' }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Inactive,Status: Revision Needed,Status: Stale"
|
||||||
|
|
||||||
|
draft:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'converted_to_draft' }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Code Review Needed,Status: Inactive,Status: Revision Needed,Status: Stale" --add-label "Status: Work in Progress"
|
||||||
|
|
||||||
|
rfr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.action == 'ready_for_review' }}
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ISSUE: ${{ github.event.pull_request.html_url }}
|
||||||
|
run: |
|
||||||
|
gh pr edit $ISSUE --remove-label "Status: Accepted,Status: Inactive,Status: Revision Needed,Status: Stale,Status: Work in Progress" --add-label "Status: Code Review Needed"
|
@ -29,6 +29,7 @@ FULL_RUN_IGNORE_REGEX = list(map(re.compile, [
|
|||||||
Patterns of files that are considered to trigger full CI.
|
Patterns of files that are considered to trigger full CI.
|
||||||
"""
|
"""
|
||||||
FULL_RUN_REGEX = list(map(re.compile, [
|
FULL_RUN_REGEX = list(map(re.compile, [
|
||||||
|
r'\.github/workflows/scripts/.*',
|
||||||
r'cmd.*',
|
r'cmd.*',
|
||||||
r'configs/.*',
|
r'configs/.*',
|
||||||
r'META',
|
r'META',
|
||||||
@ -64,7 +65,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# check last (HEAD) commit message
|
# check last (HEAD) commit message
|
||||||
last_commit_message_raw = subprocess.run([
|
last_commit_message_raw = subprocess.run([
|
||||||
'git', 'show', '-s', '--format=%B', 'HEAD'
|
'git', 'show', '-s', '--format=%B', head
|
||||||
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
for line in last_commit_message_raw.stdout.decode().splitlines():
|
for line in last_commit_message_raw.stdout.decode().splitlines():
|
||||||
|
52
.github/workflows/scripts/qemu-1-setup.sh
vendored
52
.github/workflows/scripts/qemu-1-setup.sh
vendored
@ -6,38 +6,23 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
# We've been seeing this script take over 15min to run. This may or
|
||||||
|
# may not be normal. Just to get a little more insight, print out
|
||||||
|
# a message to stdout with the top running process, and do this every
|
||||||
|
# 30 seconds. We can delete this watchdog later once we get a better
|
||||||
|
# handle on what the timeout value should be.
|
||||||
|
(while [ 1 ] ; do sleep 30 && echo "[watchdog: $(ps -eo cmd --sort=-pcpu | head -n 2 | tail -n 1)}')]"; done) &
|
||||||
|
|
||||||
# install needed packages
|
# install needed packages
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get install -y axel cloud-image-utils daemonize guestfs-tools \
|
sudo apt-get install -y axel cloud-image-utils daemonize guestfs-tools \
|
||||||
ksmtuned virt-manager linux-modules-extra-$(uname -r) zfsutils-linux
|
virt-manager linux-modules-extra-$(uname -r) zfsutils-linux
|
||||||
|
|
||||||
# generate ssh keys
|
# generate ssh keys
|
||||||
rm -f ~/.ssh/id_ed25519
|
rm -f ~/.ssh/id_ed25519
|
||||||
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
|
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
|
||||||
|
|
||||||
# we expect RAM shortage
|
|
||||||
cat << EOF | sudo tee /etc/ksmtuned.conf > /dev/null
|
|
||||||
# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/virtualization_tuning_and_optimization_guide/chap-ksm
|
|
||||||
KSM_MONITOR_INTERVAL=60
|
|
||||||
|
|
||||||
# Millisecond sleep between ksm scans for 16Gb server.
|
|
||||||
# Smaller servers sleep more, bigger sleep less.
|
|
||||||
KSM_SLEEP_MSEC=10
|
|
||||||
KSM_NPAGES_BOOST=300
|
|
||||||
KSM_NPAGES_DECAY=-50
|
|
||||||
KSM_NPAGES_MIN=64
|
|
||||||
KSM_NPAGES_MAX=2048
|
|
||||||
|
|
||||||
KSM_THRES_COEF=25
|
|
||||||
KSM_THRES_CONST=2048
|
|
||||||
|
|
||||||
LOGFILE=/var/log/ksmtuned.log
|
|
||||||
DEBUG=1
|
|
||||||
EOF
|
|
||||||
sudo systemctl restart ksm
|
|
||||||
sudo systemctl restart ksmtuned
|
|
||||||
|
|
||||||
# not needed
|
# not needed
|
||||||
sudo systemctl stop docker.socket
|
sudo systemctl stop docker.socket
|
||||||
sudo systemctl stop multipathd.socket
|
sudo systemctl stop multipathd.socket
|
||||||
@ -63,16 +48,14 @@ $DISK
|
|||||||
sync
|
sync
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# swap with same size as RAM
|
# swap with same size as RAM (16GiB)
|
||||||
sudo mkswap $DISK-part1
|
sudo mkswap $DISK-part1
|
||||||
sudo swapon $DISK-part1
|
sudo swapon $DISK-part1
|
||||||
|
|
||||||
# 60GB data disk
|
# JBOD 2xdisk for OpenZFS storage (test vm's)
|
||||||
SSD1="$DISK-part2"
|
SSD1="$DISK-part2"
|
||||||
|
sudo fallocate -l 12G /test.ssd2
|
||||||
# 10GB data disk on ext4
|
SSD2=$(sudo losetup -b 4096 -f /test.ssd2 --show)
|
||||||
sudo fallocate -l 10G /test.ssd1
|
|
||||||
SSD2=$(sudo losetup -b 4096 -f /test.ssd1 --show)
|
|
||||||
|
|
||||||
# adjust zfs module parameter and create pool
|
# adjust zfs module parameter and create pool
|
||||||
exec 1>/dev/null
|
exec 1>/dev/null
|
||||||
@ -81,11 +64,14 @@ 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 \
|
sudo zpool create -f -o ashift=12 zpool $SSD1 $SSD2 -O relatime=off \
|
||||||
-O relatime=off -O atime=off -O xattr=sa -O compression=lz4 \
|
-O atime=off -O xattr=sa -O compression=lz4 -O sync=disabled \
|
||||||
-O mountpoint=/mnt/tests
|
-O redundant_metadata=none -O mountpoint=/mnt/tests
|
||||||
|
|
||||||
# no need for some scheduler
|
# no need for some scheduler
|
||||||
for i in /sys/block/s*/queue/scheduler; do
|
for i in /sys/block/s*/queue/scheduler; do
|
||||||
echo "none" | sudo tee $i > /dev/null
|
echo "none" | sudo tee $i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Kill off our watchdog
|
||||||
|
kill $(jobs -p)
|
||||||
|
204
.github/workflows/scripts/qemu-2-start.sh
vendored
204
.github/workflows/scripts/qemu-2-start.sh
vendored
@ -12,19 +12,23 @@ OS="$1"
|
|||||||
# OS variant (virt-install --os-variant list)
|
# OS variant (virt-install --os-variant list)
|
||||||
OSv=$OS
|
OSv=$OS
|
||||||
|
|
||||||
# compressed with .zst extension
|
# FreeBSD urls's
|
||||||
REPO="https://github.com/mcmilk/openzfs-freebsd-images"
|
FREEBSD_REL="https://download.freebsd.org/releases/CI-IMAGES"
|
||||||
FREEBSD="$REPO/releases/download/v2024-09-16"
|
FREEBSD_SNAP="https://download.freebsd.org/snapshots/CI-IMAGES"
|
||||||
URLzs=""
|
URLxz=""
|
||||||
|
|
||||||
# Ubuntu mirrors
|
# Ubuntu mirrors
|
||||||
#UBMIRROR="https://cloud-images.ubuntu.com"
|
UBMIRROR="https://cloud-images.ubuntu.com"
|
||||||
#UBMIRROR="https://mirrors.cloud.tencent.com/ubuntu-cloud-images"
|
#UBMIRROR="https://mirrors.cloud.tencent.com/ubuntu-cloud-images"
|
||||||
UBMIRROR="https://mirror.citrahost.com/ubuntu-cloud-images"
|
#UBMIRROR="https://mirror.citrahost.com/ubuntu-cloud-images"
|
||||||
|
|
||||||
# default nic model for vm's
|
# default nic model for vm's
|
||||||
NIC="virtio"
|
NIC="virtio"
|
||||||
|
|
||||||
|
# additional options for virt-install
|
||||||
|
OPTS[0]=""
|
||||||
|
OPTS[1]=""
|
||||||
|
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
almalinux8)
|
almalinux8)
|
||||||
OSNAME="AlmaLinux 8"
|
OSNAME="AlmaLinux 8"
|
||||||
@ -34,11 +38,20 @@ case "$OS" in
|
|||||||
OSNAME="AlmaLinux 9"
|
OSNAME="AlmaLinux 9"
|
||||||
URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
|
URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
|
||||||
;;
|
;;
|
||||||
|
almalinux10)
|
||||||
|
OSNAME="AlmaLinux 10"
|
||||||
|
OSv="almalinux9"
|
||||||
|
URL="https://repo.almalinux.org/almalinux/10/cloud/x86_64/images/AlmaLinux-10-GenericCloud-latest.x86_64.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"
|
||||||
# dns sometimes fails with that url :/
|
;;
|
||||||
echo "89.187.191.12 geo.mirror.pkgbuild.com" | sudo tee /etc/hosts > /dev/null
|
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"
|
||||||
@ -52,47 +65,67 @@ case "$OS" in
|
|||||||
OSNAME="Debian 12"
|
OSNAME="Debian 12"
|
||||||
URL="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"
|
URL="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"
|
||||||
;;
|
;;
|
||||||
fedora39)
|
debian13)
|
||||||
OSNAME="Fedora 39"
|
OSNAME="Debian 13"
|
||||||
OSv="fedora39"
|
# TODO: Overwrite OSv to debian13 for virt-install until it's added to osinfo
|
||||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/x86_64/images/Fedora-Cloud-Base-39-1.5.x86_64.qcow2"
|
OSv="debian12"
|
||||||
|
URL="https://cloud.debian.org/images/cloud/trixie/latest/debian-13-generic-amd64.qcow2"
|
||||||
|
OPTS[0]="--boot"
|
||||||
|
OPTS[1]="uefi=on"
|
||||||
;;
|
;;
|
||||||
fedora40)
|
fedora41)
|
||||||
OSNAME="Fedora 40"
|
OSNAME="Fedora 41"
|
||||||
OSv="fedora39"
|
OSv="fedora-unknown"
|
||||||
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2"
|
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2"
|
||||||
;;
|
;;
|
||||||
freebsd13r)
|
fedora42)
|
||||||
OSNAME="FreeBSD 13.4-RELEASE"
|
OSNAME="Fedora 42"
|
||||||
|
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"
|
||||||
|
;;
|
||||||
|
freebsd13-5r)
|
||||||
|
FreeBSD="13.5-RELEASE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd13.0"
|
OSv="freebsd13.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-13.4-RELEASE.qcow2.zst"
|
URLxz="$FREEBSD_REL/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
||||||
NIC="rtl8139"
|
NIC="rtl8139"
|
||||||
;;
|
;;
|
||||||
freebsd13)
|
freebsd14-2r)
|
||||||
OSNAME="FreeBSD 13.4-STABLE"
|
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)
|
||||||
|
FreeBSD="14.3-RELEASE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
|
OSv="freebsd14.0"
|
||||||
|
URLxz="$FREEBSD_REL/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
||||||
|
KSRC="$FREEBSD_REL/../amd64/$FreeBSD/src.txz"
|
||||||
|
;;
|
||||||
|
freebsd13-5s)
|
||||||
|
FreeBSD="13.5-STABLE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd13.0"
|
OSv="freebsd13.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-13.4-STABLE.qcow2.zst"
|
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
NIC="rtl8139"
|
NIC="rtl8139"
|
||||||
;;
|
;;
|
||||||
freebsd14r)
|
freebsd14-3s)
|
||||||
OSNAME="FreeBSD 14.1-RELEASE"
|
FreeBSD="14.3-STABLE"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-14.1-RELEASE.qcow2.zst"
|
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI-ufs.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
;;
|
;;
|
||||||
freebsd14)
|
freebsd15-0c)
|
||||||
OSNAME="FreeBSD 14.1-STABLE"
|
FreeBSD="15.0-ALPHA3"
|
||||||
|
OSNAME="FreeBSD $FreeBSD"
|
||||||
OSv="freebsd14.0"
|
OSv="freebsd14.0"
|
||||||
URLzs="$FREEBSD/amd64-freebsd-14.1-STABLE.qcow2.zst"
|
URLxz="$FREEBSD_SNAP/$FreeBSD/amd64/Latest/FreeBSD-$FreeBSD-amd64-BASIC-CI-ufs.raw.xz"
|
||||||
BASH="/usr/local/bin/bash"
|
KSRC="$FREEBSD_SNAP/../amd64/$FreeBSD/src.txz"
|
||||||
;;
|
|
||||||
freebsd15)
|
|
||||||
OSNAME="FreeBSD 15.0-CURRENT"
|
|
||||||
OSv="freebsd14.0"
|
|
||||||
URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst"
|
|
||||||
BASH="/usr/local/bin/bash"
|
|
||||||
;;
|
;;
|
||||||
tumbleweed)
|
tumbleweed)
|
||||||
OSNAME="openSUSE Tumbleweed"
|
OSNAME="openSUSE Tumbleweed"
|
||||||
@ -100,11 +133,6 @@ case "$OS" in
|
|||||||
MIRROR="http://opensuse-mirror-gce-us.susecloud.net"
|
MIRROR="http://opensuse-mirror-gce-us.susecloud.net"
|
||||||
URL="$MIRROR/tumbleweed/appliances/openSUSE-MicroOS.x86_64-OpenStack-Cloud.qcow2"
|
URL="$MIRROR/tumbleweed/appliances/openSUSE-MicroOS.x86_64-OpenStack-Cloud.qcow2"
|
||||||
;;
|
;;
|
||||||
ubuntu20)
|
|
||||||
OSNAME="Ubuntu 20.04"
|
|
||||||
OSv="ubuntu20.04"
|
|
||||||
URL="$UBMIRROR/focal/current/focal-server-cloudimg-amd64.img"
|
|
||||||
;;
|
|
||||||
ubuntu22)
|
ubuntu22)
|
||||||
OSNAME="Ubuntu 22.04"
|
OSNAME="Ubuntu 22.04"
|
||||||
OSv="ubuntu22.04"
|
OSv="ubuntu22.04"
|
||||||
@ -128,7 +156,7 @@ echo "ENV=$ENV" >> $ENV
|
|||||||
# result path
|
# result path
|
||||||
echo 'RESPATH="/var/tmp/test_results"' >> $ENV
|
echo 'RESPATH="/var/tmp/test_results"' >> $ENV
|
||||||
|
|
||||||
# FreeBSD 13 has problems with: e1000+virtio
|
# FreeBSD 13 has problems with: e1000 and virtio
|
||||||
echo "NIC=$NIC" >> $ENV
|
echo "NIC=$NIC" >> $ENV
|
||||||
|
|
||||||
# freebsd15 -> used in zfs-qemu.yml
|
# freebsd15 -> used in zfs-qemu.yml
|
||||||
@ -140,34 +168,48 @@ echo "OSv=\"$OSv\"" >> $ENV
|
|||||||
# FreeBSD 15 (Current) -> used for summary
|
# FreeBSD 15 (Current) -> used for summary
|
||||||
echo "OSNAME=\"$OSNAME\"" >> $ENV
|
echo "OSNAME=\"$OSNAME\"" >> $ENV
|
||||||
|
|
||||||
|
# default vm count for testings
|
||||||
|
VMs=2
|
||||||
|
echo "VMs=\"$VMs\"" >> $ENV
|
||||||
|
|
||||||
|
# default cpu count for testing vm's
|
||||||
|
CPU=2
|
||||||
|
echo "CPU=\"$CPU\"" >> $ENV
|
||||||
|
|
||||||
sudo mkdir -p "/mnt/tests"
|
sudo mkdir -p "/mnt/tests"
|
||||||
sudo chown -R $(whoami) /mnt/tests
|
sudo chown -R $(whoami) /mnt/tests
|
||||||
|
|
||||||
|
DISK="/dev/zvol/zpool/openzfs"
|
||||||
|
sudo zfs create -ps -b 64k -V 80g zpool/openzfs
|
||||||
|
while true; do test -b $DISK && break; sleep 1; done
|
||||||
|
|
||||||
# we are downloading via axel, curl and wget are mostly slower and
|
# we are downloading via axel, curl and wget are mostly slower and
|
||||||
# require more return value checking
|
# require more return value checking
|
||||||
IMG="/mnt/tests/cloudimg.qcow2"
|
IMG="/mnt/tests/cloud-image"
|
||||||
if [ ! -z "$URLzs" ]; then
|
if [ ! -z "$URLxz" ]; then
|
||||||
echo "Loading image $URLzs ..."
|
echo "Loading $URLxz ..."
|
||||||
time axel -q -o "$IMG.zst" "$URLzs"
|
time axel -q -o "$IMG" "$URLxz"
|
||||||
zstd -q -d --rm "$IMG.zst"
|
echo "Loading $KSRC ..."
|
||||||
|
time axel -q -o ~/src.txz $KSRC
|
||||||
else
|
else
|
||||||
echo "Loading image $URL ..."
|
echo "Loading $URL ..."
|
||||||
time axel -q -o "$IMG" "$URL"
|
time axel -q -o "$IMG" "$URL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DISK="/dev/zvol/zpool/openzfs"
|
|
||||||
FORMAT="raw"
|
|
||||||
sudo zfs create -ps -b 64k -V 80g zpool/openzfs
|
|
||||||
while true; do test -b $DISK && break; sleep 1; done
|
|
||||||
echo "Importing VM image to zvol..."
|
echo "Importing VM image to zvol..."
|
||||||
|
if [ ! -z "$URLxz" ]; then
|
||||||
|
xzcat -T0 $IMG | sudo dd of=$DISK bs=4M
|
||||||
|
else
|
||||||
sudo qemu-img dd -f qcow2 -O raw if=$IMG of=$DISK bs=4M
|
sudo qemu-img dd -f qcow2 -O raw if=$IMG of=$DISK bs=4M
|
||||||
|
fi
|
||||||
rm -f $IMG
|
rm -f $IMG
|
||||||
|
|
||||||
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
||||||
|
if [ ${OS:0:7} != "freebsd" ]; then
|
||||||
cat <<EOF > /tmp/user-data
|
cat <<EOF > /tmp/user-data
|
||||||
#cloud-config
|
#cloud-config
|
||||||
|
|
||||||
fqdn: $OS
|
hostname: $OS
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: root
|
- name: root
|
||||||
@ -183,6 +225,19 @@ growpart:
|
|||||||
devices: ['/']
|
devices: ['/']
|
||||||
ignore_growroot_disabled: false
|
ignore_growroot_disabled: false
|
||||||
EOF
|
EOF
|
||||||
|
else
|
||||||
|
cat <<EOF > /tmp/user-data
|
||||||
|
#cloud-config
|
||||||
|
|
||||||
|
hostname: $OS
|
||||||
|
|
||||||
|
# minimized config without sudo for nuageinit of FreeBSD
|
||||||
|
growpart:
|
||||||
|
mode: auto
|
||||||
|
devices: ['/']
|
||||||
|
ignore_growroot_disabled: false
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
sudo virsh net-update default add ip-dhcp-host \
|
sudo virsh net-update default add ip-dhcp-host \
|
||||||
"<host mac='52:54:00:83:79:00' ip='192.168.122.10'/>" --live --config
|
"<host mac='52:54:00:83:79:00' ip='192.168.122.10'/>" --live --config
|
||||||
@ -198,8 +253,17 @@ sudo virt-install \
|
|||||||
--graphics none \
|
--graphics none \
|
||||||
--network bridge=virbr0,model=$NIC,mac='52:54:00:83:79:00' \
|
--network bridge=virbr0,model=$NIC,mac='52:54:00:83:79:00' \
|
||||||
--cloud-init user-data=/tmp/user-data \
|
--cloud-init user-data=/tmp/user-data \
|
||||||
--disk $DISK,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
--disk $DISK,bus=virtio,cache=none,format=raw,driver.discard=unmap \
|
||||||
--import --noautoconsole >/dev/null
|
--import --noautoconsole ${OPTS[0]} ${OPTS[1]} >/dev/null
|
||||||
|
|
||||||
|
# Give the VMs hostnames so we don't have to refer to them with
|
||||||
|
# hardcoded IP addresses.
|
||||||
|
#
|
||||||
|
# vm0: Initial VM we install dependencies and build ZFS on.
|
||||||
|
# vm1..2 Testing VMs
|
||||||
|
for ((i=0; i<=VMs; i++)); do
|
||||||
|
echo "192.168.122.1$i vm$i" | sudo tee -a /etc/hosts
|
||||||
|
done
|
||||||
|
|
||||||
# in case the directory isn't there already
|
# in case the directory isn't there already
|
||||||
mkdir -p $HOME/.ssh
|
mkdir -p $HOME/.ssh
|
||||||
@ -211,3 +275,29 @@ StrictHostKeyChecking no
|
|||||||
# small timeout, used in while loops later
|
# small timeout, used in while loops later
|
||||||
ConnectTimeout 1
|
ConnectTimeout 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [ ${OS:0:7} != "freebsd" ]; then
|
||||||
|
# enable KSM on Linux
|
||||||
|
sudo virsh dommemstat --domain "openzfs" --period 5
|
||||||
|
sudo virsh node-memory-tune 100 50 1
|
||||||
|
echo 1 | sudo tee /sys/kernel/mm/ksm/run > /dev/null
|
||||||
|
else
|
||||||
|
# on FreeBSD we need some more init stuff, because of nuageinit
|
||||||
|
BASH="/usr/local/bin/bash"
|
||||||
|
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
||||||
|
ssh 2>/dev/null root@vm0 "uname -a" && break
|
||||||
|
done
|
||||||
|
ssh root@vm0 "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 'sysrc qemu_guest_agent_enable="YES"'
|
||||||
|
ssh root@vm0 'sysrc cloudinit_enable="YES"'
|
||||||
|
ssh root@vm0 "pw add user zfs -w no -s $BASH"
|
||||||
|
ssh root@vm0 'mkdir -p ~zfs/.ssh'
|
||||||
|
ssh root@vm0 'echo "zfs ALL=(ALL:ALL) NOPASSWD: ALL" >> /usr/local/etc/sudoers'
|
||||||
|
ssh root@vm0 'echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config'
|
||||||
|
scp ~/.ssh/id_ed25519.pub "root@vm0:~zfs/.ssh/authorized_keys"
|
||||||
|
ssh root@vm0 'chown -R zfs ~zfs'
|
||||||
|
ssh root@vm0 'service sshd restart'
|
||||||
|
scp ~/src.txz "root@vm0:/tmp/src.txz"
|
||||||
|
ssh root@vm0 'tar -C / -zxf /tmp/src.txz'
|
||||||
|
fi
|
||||||
|
262
.github/workflows/scripts/qemu-3-deps-vm.sh
vendored
Executable file
262
.github/workflows/scripts/qemu-3-deps-vm.sh
vendored
Executable file
@ -0,0 +1,262 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# 3) install dependencies for compiling and loading
|
||||||
|
#
|
||||||
|
# $1: OS name (like 'fedora41')
|
||||||
|
# $2: (optional) Experimental Fedora kernel version, like "6.14" to
|
||||||
|
# install instead of Fedora defaults.
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
function archlinux() {
|
||||||
|
echo "##[group]Running pacman -Syu"
|
||||||
|
sudo btrfs filesystem resize max /
|
||||||
|
sudo pacman -Syu --noconfirm
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Install Development Tools"
|
||||||
|
sudo pacman -Sy --noconfirm base-devel bc cpio cryptsetup dhclient dkms \
|
||||||
|
fakeroot fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils \
|
||||||
|
parted pax perf python-packaging python-setuptools qemu-guest-agent ksh \
|
||||||
|
samba strace sysstat rng-tools rsync wget xxhash
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function debian() {
|
||||||
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
|
echo "##[group]Running apt-get update+upgrade"
|
||||||
|
sudo sed -i '/[[:alpha:]]-backports/d' /etc/apt/sources.list
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get upgrade -y
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Install Development Tools"
|
||||||
|
sudo apt-get install -y \
|
||||||
|
acl alien attr autoconf bc cpio cryptsetup curl dbench dh-python dkms \
|
||||||
|
fakeroot fio gdb gdebi git ksh lcov isc-dhcp-client jq libacl1-dev \
|
||||||
|
libaio-dev libattr1-dev libblkid-dev libcurl4-openssl-dev libdevmapper-dev \
|
||||||
|
libelf-dev libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev \
|
||||||
|
libtool libtool-bin libudev-dev libunwind-dev linux-headers-$(uname -r) \
|
||||||
|
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
||||||
|
python3-cffi python3-dev python3-distlib python3-packaging libtirpc-dev \
|
||||||
|
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
||||||
|
rsync samba strace sysstat uuid-dev watchdog wget xfslibs-dev xxhash \
|
||||||
|
zlib1g-dev
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function freebsd() {
|
||||||
|
export ASSUME_ALWAYS_YES="YES"
|
||||||
|
|
||||||
|
echo "##[group]Install Development Tools"
|
||||||
|
sudo pkg install -y autoconf automake autotools base64 checkbashisms fio \
|
||||||
|
gdb gettext gettext-runtime git gmake gsed jq ksh lcov libtool lscpu \
|
||||||
|
pkgconf python python3 pamtester pamtester qemu-guest-agent rsync xxhash
|
||||||
|
sudo pkg install -xy \
|
||||||
|
'^samba4[[:digit:]]+$' \
|
||||||
|
'^py3[[:digit:]]+-cffi$' \
|
||||||
|
'^py3[[:digit:]]+-sysctl$' \
|
||||||
|
'^py3[[:digit:]]+-setuptools$' \
|
||||||
|
'^py3[[:digit:]]+-packaging$'
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
# common packages for: almalinux, centos, redhat
|
||||||
|
function rhel() {
|
||||||
|
echo "##[group]Running dnf update"
|
||||||
|
echo "max_parallel_downloads=10" | sudo -E tee -a /etc/dnf/dnf.conf
|
||||||
|
sudo dnf clean all
|
||||||
|
sudo dnf update -y --setopt=fastestmirror=1 --refresh
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Install Development Tools"
|
||||||
|
|
||||||
|
# Alma wants "Development Tools", Fedora 41 wants "development-tools"
|
||||||
|
if ! sudo dnf group install -y "Development Tools" ; then
|
||||||
|
echo "Trying 'development-tools' instead of 'Development Tools'"
|
||||||
|
sudo dnf group install -y development-tools
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo dnf install -y \
|
||||||
|
acl attr bc bzip2 cryptsetup curl dbench dkms elfutils-libelf-devel fio \
|
||||||
|
gdb git jq kernel-rpm-macros ksh libacl-devel libaio-devel \
|
||||||
|
libargon2-devel libattr-devel libblkid-devel libcurl-devel libffi-devel \
|
||||||
|
ncompress libselinux-devel libtirpc-devel libtool libudev-devel \
|
||||||
|
libuuid-devel lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester \
|
||||||
|
parted perf python3 python3-cffi python3-devel python3-packaging \
|
||||||
|
kernel-devel python3-setuptools qemu-guest-agent rng-tools rpcgen \
|
||||||
|
rpm-build rsync samba strace sysstat systemd watchdog wget xfsprogs-devel \
|
||||||
|
xxhash zlib-devel
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function tumbleweed() {
|
||||||
|
echo "##[group]Running zypper is TODO!"
|
||||||
|
sleep 23456
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
# $1: Kernel version to install (like '6.14rc7')
|
||||||
|
function install_fedora_experimental_kernel {
|
||||||
|
|
||||||
|
our_version="$1"
|
||||||
|
sudo dnf -y copr enable @kernel-vanilla/stable
|
||||||
|
sudo dnf -y copr enable @kernel-vanilla/mainline
|
||||||
|
all="$(sudo dnf list --showduplicates kernel-* python3-perf* perf* bpftool*)"
|
||||||
|
echo "Available versions:"
|
||||||
|
echo "$all"
|
||||||
|
|
||||||
|
# You can have a bunch of minor variants of the version we want '6.14'.
|
||||||
|
# Pick the newest variant (sorted by version number).
|
||||||
|
specific_version=$(echo "$all" | grep $our_version | awk '{print $2}' | sort -V | tail -n 1)
|
||||||
|
list="$(echo "$all" | grep $specific_version | grep -Ev 'kernel-rt|kernel-selftests|kernel-debuginfo' | sed 's/.x86_64//g' | awk '{print $1"-"$2}')"
|
||||||
|
sudo dnf install -y $list
|
||||||
|
sudo dnf -y copr disable @kernel-vanilla/stable
|
||||||
|
sudo dnf -y copr disable @kernel-vanilla/mainline
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
case "$1" in
|
||||||
|
almalinux8)
|
||||||
|
echo "##[group]Enable epel and powertools repositories"
|
||||||
|
sudo dnf config-manager -y --set-enabled powertools
|
||||||
|
sudo dnf install -y epel-release
|
||||||
|
echo "##[endgroup]"
|
||||||
|
rhel
|
||||||
|
echo "##[group]Install kernel-abi-whitelists"
|
||||||
|
sudo dnf install -y kernel-abi-whitelists
|
||||||
|
echo "##[endgroup]"
|
||||||
|
;;
|
||||||
|
almalinux9|almalinux10|centos-stream9|centos-stream10)
|
||||||
|
echo "##[group]Enable epel and crb repositories"
|
||||||
|
sudo dnf config-manager -y --set-enabled crb
|
||||||
|
sudo dnf install -y epel-release
|
||||||
|
echo "##[endgroup]"
|
||||||
|
rhel
|
||||||
|
echo "##[group]Install kernel-abi-stablelists"
|
||||||
|
sudo dnf install -y kernel-abi-stablelists
|
||||||
|
echo "##[endgroup]"
|
||||||
|
;;
|
||||||
|
archlinux)
|
||||||
|
archlinux
|
||||||
|
;;
|
||||||
|
debian*)
|
||||||
|
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
|
||||||
|
debian
|
||||||
|
echo "##[group]Install Debian specific"
|
||||||
|
sudo apt-get install -yq linux-perf dh-sequence-dkms
|
||||||
|
echo "##[endgroup]"
|
||||||
|
;;
|
||||||
|
fedora*)
|
||||||
|
rhel
|
||||||
|
sudo dnf install -y libunwind-devel
|
||||||
|
|
||||||
|
# Fedora 42+ moves /usr/bin/script from 'util-linux' to 'util-linux-script'
|
||||||
|
sudo dnf install -y util-linux-script || true
|
||||||
|
|
||||||
|
# Optional: Install an experimental kernel ($2 = kernel version)
|
||||||
|
if [ -n "${2:-}" ] ; then
|
||||||
|
install_fedora_experimental_kernel "$2"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
freebsd*)
|
||||||
|
freebsd
|
||||||
|
;;
|
||||||
|
tumbleweed)
|
||||||
|
tumbleweed
|
||||||
|
;;
|
||||||
|
ubuntu*)
|
||||||
|
debian
|
||||||
|
echo "##[group]Install Ubuntu specific"
|
||||||
|
sudo apt-get install -yq linux-tools-common libtirpc-dev \
|
||||||
|
linux-modules-extra-$(uname -r)
|
||||||
|
sudo apt-get install -yq dh-sequence-dkms
|
||||||
|
echo "##[endgroup]"
|
||||||
|
echo "##[group]Delete Ubuntu OpenZFS modules"
|
||||||
|
for i in $(find /lib/modules -name zfs -type d); do sudo rm -rvf $i; done
|
||||||
|
echo "##[endgroup]"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# This script is used for checkstyle + zloop deps also.
|
||||||
|
# Install only the needed packages and exit - when used this way.
|
||||||
|
test -z "${ONLY_DEPS:-}" || exit 0
|
||||||
|
|
||||||
|
# Start services
|
||||||
|
echo "##[group]Enable services"
|
||||||
|
case "$1" in
|
||||||
|
freebsd*)
|
||||||
|
# add virtio things
|
||||||
|
echo 'virtio_load="YES"' | sudo -E tee -a /boot/loader.conf
|
||||||
|
for i in balloon blk console random scsi; do
|
||||||
|
echo "virtio_${i}_load=\"YES\"" | sudo -E tee -a /boot/loader.conf
|
||||||
|
done
|
||||||
|
echo "fdescfs /dev/fd fdescfs rw 0 0" | sudo -E tee -a /etc/fstab
|
||||||
|
sudo -E mount /dev/fd
|
||||||
|
sudo -E touch /etc/zfs/exports
|
||||||
|
sudo -E sysrc mountd_flags="/etc/zfs/exports"
|
||||||
|
echo '[global]' | sudo -E tee /usr/local/etc/smb4.conf >/dev/null
|
||||||
|
sudo -E service nfsd enable
|
||||||
|
sudo -E service qemu-guest-agent enable
|
||||||
|
sudo -E service samba_server enable
|
||||||
|
;;
|
||||||
|
debian*|ubuntu*)
|
||||||
|
sudo -E systemctl enable nfs-kernel-server
|
||||||
|
sudo -E systemctl enable qemu-guest-agent
|
||||||
|
sudo -E systemctl enable smbd
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# All other linux distros
|
||||||
|
sudo -E systemctl enable nfs-server
|
||||||
|
sudo -E systemctl enable qemu-guest-agent
|
||||||
|
sudo -E systemctl enable smb
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
# Setup Kernel cmdline
|
||||||
|
CMDLINE="console=tty0 console=ttyS0,115200n8"
|
||||||
|
CMDLINE="$CMDLINE selinux=0"
|
||||||
|
CMDLINE="$CMDLINE random.trust_cpu=on"
|
||||||
|
CMDLINE="$CMDLINE no_timer_check"
|
||||||
|
case "$1" in
|
||||||
|
almalinux*|centos*|fedora*)
|
||||||
|
GRUB_CFG="/boot/grub2/grub.cfg"
|
||||||
|
GRUB_MKCONFIG="grub2-mkconfig"
|
||||||
|
CMDLINE="$CMDLINE biosdevname=0 net.ifnames=0"
|
||||||
|
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200"' \
|
||||||
|
| sudo tee -a /etc/default/grub >/dev/null
|
||||||
|
;;
|
||||||
|
ubuntu24)
|
||||||
|
GRUB_CFG="/boot/grub/grub.cfg"
|
||||||
|
GRUB_MKCONFIG="grub-mkconfig"
|
||||||
|
echo 'GRUB_DISABLE_OS_PROBER="false"' \
|
||||||
|
| sudo tee -a /etc/default/grub >/dev/null
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
GRUB_CFG="/boot/grub/grub.cfg"
|
||||||
|
GRUB_MKCONFIG="grub-mkconfig"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
archlinux|freebsd*)
|
||||||
|
true
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "##[group]Edit kernel cmdline"
|
||||||
|
sudo sed -i -e '/^GRUB_CMDLINE_LINUX/d' /etc/default/grub || true
|
||||||
|
echo "GRUB_CMDLINE_LINUX=\"$CMDLINE\"" \
|
||||||
|
| sudo tee -a /etc/default/grub >/dev/null
|
||||||
|
sudo $GRUB_MKCONFIG -o $GRUB_CFG
|
||||||
|
echo "##[endgroup]"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# reset cloud-init configuration and poweroff
|
||||||
|
sudo cloud-init clean --logs
|
||||||
|
sleep 2 && sudo poweroff &
|
||||||
|
exit 0
|
237
.github/workflows/scripts/qemu-3-deps.sh
vendored
237
.github/workflows/scripts/qemu-3-deps.sh
vendored
@ -1,221 +1,28 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# 3) install dependencies for compiling and loading
|
# 3) Wait for VM to boot from previous step and launch dependencies
|
||||||
|
# script on it.
|
||||||
|
#
|
||||||
|
# $1: OS name (like 'fedora41')
|
||||||
|
# $2: (optional) Experimental kernel version to install on fedora,
|
||||||
|
# like "6.14".
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
set -eu
|
.github/workflows/scripts/qemu-wait-for-vm.sh vm0
|
||||||
|
|
||||||
function archlinux() {
|
# SPECIAL CASE:
|
||||||
echo "##[group]Running pacman -Syu"
|
#
|
||||||
sudo btrfs filesystem resize max /
|
# If the user passed in an experimental kernel version to test on Fedora,
|
||||||
sudo pacman -Syu --noconfirm
|
# we need to update the kernel version in zfs's META file to allow the
|
||||||
echo "##[endgroup]"
|
# build to happen. We update our local copy of META here, since we know
|
||||||
|
# it will be rsync'd up in the next step.
|
||||||
echo "##[group]Install Development Tools"
|
if [ -n "${2:-}" ] ; then
|
||||||
sudo pacman -Sy --noconfirm base-devel bc cpio dhclient dkms fakeroot \
|
sed -i -E 's/Linux-Maximum: .+/Linux-Maximum: 99.99/g' META
|
||||||
fio gdb inetutils jq less linux linux-headers lsscsi nfs-utils parted \
|
|
||||||
pax perf python-packaging python-setuptools qemu-guest-agent ksh samba \
|
|
||||||
sysstat rng-tools rsync wget xxhash
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
function debian() {
|
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
|
||||||
|
|
||||||
echo "##[group]Running apt-get update+upgrade"
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get upgrade -y
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Install Development Tools"
|
|
||||||
sudo apt-get install -y \
|
|
||||||
acl alien attr autoconf bc cpio curl dbench dh-python dkms fakeroot \
|
|
||||||
fio gdb gdebi git ksh lcov isc-dhcp-client jq libacl1-dev libaio-dev \
|
|
||||||
libattr1-dev libblkid-dev libcurl4-openssl-dev libdevmapper-dev libelf-dev \
|
|
||||||
libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev libtool \
|
|
||||||
libtool-bin libudev-dev libunwind-dev linux-headers-$(uname -r) \
|
|
||||||
lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
|
|
||||||
python3-cffi python3-dev python3-distlib python3-packaging \
|
|
||||||
python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
|
|
||||||
rsync samba sysstat uuid-dev watchdog wget xfslibs-dev xxhash zlib1g-dev
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
function freebsd() {
|
|
||||||
export ASSUME_ALWAYS_YES="YES"
|
|
||||||
|
|
||||||
echo "##[group]Install Development Tools"
|
|
||||||
sudo pkg install -y autoconf automake autotools base64 checkbashisms fio \
|
|
||||||
gdb gettext gettext-runtime git gmake gsed jq ksh93 lcov libtool lscpu \
|
|
||||||
pkgconf python python3 pamtester pamtester qemu-guest-agent rsync xxhash
|
|
||||||
sudo pkg install -xy \
|
|
||||||
'^samba4[[:digit:]]+$' \
|
|
||||||
'^py3[[:digit:]]+-cffi$' \
|
|
||||||
'^py3[[:digit:]]+-sysctl$' \
|
|
||||||
'^py3[[:digit:]]+-packaging$'
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
# common packages for: almalinux, centos, redhat
|
|
||||||
function rhel() {
|
|
||||||
echo "##[group]Running dnf update"
|
|
||||||
echo "max_parallel_downloads=10" | sudo -E tee -a /etc/dnf/dnf.conf
|
|
||||||
sudo dnf clean all
|
|
||||||
sudo dnf update -y --setopt=fastestmirror=1 --refresh
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Install Development Tools"
|
|
||||||
sudo dnf group install -y "Development Tools"
|
|
||||||
sudo dnf install -y \
|
|
||||||
acl attr bc bzip2 curl dbench dkms elfutils-libelf-devel fio gdb git \
|
|
||||||
jq kernel-rpm-macros ksh libacl-devel libaio-devel libargon2-devel \
|
|
||||||
libattr-devel libblkid-devel libcurl-devel libffi-devel ncompress \
|
|
||||||
libselinux-devel libtirpc-devel libtool libudev-devel libuuid-devel \
|
|
||||||
lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester parted perf \
|
|
||||||
python3 python3-cffi python3-devel python3-packaging kernel-devel \
|
|
||||||
python3-setuptools qemu-guest-agent rng-tools rpcgen rpm-build rsync \
|
|
||||||
samba sysstat systemd watchdog wget xfsprogs-devel xxhash zlib-devel
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
function tumbleweed() {
|
|
||||||
echo "##[group]Running zypper is TODO!"
|
|
||||||
sleep 23456
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
case "$1" in
|
|
||||||
almalinux8)
|
|
||||||
echo "##[group]Enable epel and powertools repositories"
|
|
||||||
sudo dnf config-manager -y --set-enabled powertools
|
|
||||||
sudo dnf install -y epel-release
|
|
||||||
echo "##[endgroup]"
|
|
||||||
rhel
|
|
||||||
echo "##[group]Install kernel-abi-whitelists"
|
|
||||||
sudo dnf install -y kernel-abi-whitelists
|
|
||||||
echo "##[endgroup]"
|
|
||||||
;;
|
|
||||||
almalinux9|centos-stream9)
|
|
||||||
echo "##[group]Enable epel and crb repositories"
|
|
||||||
sudo dnf config-manager -y --set-enabled crb
|
|
||||||
sudo dnf install -y epel-release
|
|
||||||
echo "##[endgroup]"
|
|
||||||
rhel
|
|
||||||
echo "##[group]Install kernel-abi-stablelists"
|
|
||||||
sudo dnf install -y kernel-abi-stablelists
|
|
||||||
echo "##[endgroup]"
|
|
||||||
;;
|
|
||||||
archlinux)
|
|
||||||
archlinux
|
|
||||||
;;
|
|
||||||
debian*)
|
|
||||||
debian
|
|
||||||
echo "##[group]Install Debian specific"
|
|
||||||
sudo apt-get install -yq linux-perf dh-sequence-dkms
|
|
||||||
echo "##[endgroup]"
|
|
||||||
;;
|
|
||||||
fedora*)
|
|
||||||
rhel
|
|
||||||
;;
|
|
||||||
freebsd*)
|
|
||||||
freebsd
|
|
||||||
;;
|
|
||||||
tumbleweed)
|
|
||||||
tumbleweed
|
|
||||||
;;
|
|
||||||
ubuntu*)
|
|
||||||
debian
|
|
||||||
echo "##[group]Install Ubuntu specific"
|
|
||||||
sudo apt-get install -yq linux-tools-common libtirpc-dev \
|
|
||||||
linux-modules-extra-$(uname -r)
|
|
||||||
if [ "$1" != "ubuntu20" ]; then
|
|
||||||
sudo apt-get install -yq dh-sequence-dkms
|
|
||||||
fi
|
fi
|
||||||
echo "##[endgroup]"
|
|
||||||
echo "##[group]Delete Ubuntu OpenZFS modules"
|
|
||||||
for i in $(find /lib/modules -name zfs -type d); do sudo rm -rvf $i; done
|
|
||||||
echo "##[endgroup]"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# This script is used for checkstyle + zloop deps also.
|
scp .github/workflows/scripts/qemu-3-deps-vm.sh zfs@vm0:qemu-3-deps-vm.sh
|
||||||
# Install only the needed packages and exit - when used this way.
|
PID=`pidof /usr/bin/qemu-system-x86_64`
|
||||||
test -z "${ONLY_DEPS:-}" || exit 0
|
ssh zfs@vm0 '$HOME/qemu-3-deps-vm.sh' "$@"
|
||||||
|
# wait for poweroff to succeed
|
||||||
# Start services
|
tail --pid=$PID -f /dev/null
|
||||||
echo "##[group]Enable services"
|
sleep 5 # avoid this: "error: Domain is already active"
|
||||||
case "$1" in
|
rm -f $HOME/.ssh/known_hosts
|
||||||
freebsd*)
|
|
||||||
# add virtio things
|
|
||||||
echo 'virtio_load="YES"' | sudo -E tee -a /boot/loader.conf
|
|
||||||
for i in balloon blk console random scsi; do
|
|
||||||
echo "virtio_${i}_load=\"YES\"" | sudo -E tee -a /boot/loader.conf
|
|
||||||
done
|
|
||||||
echo "fdescfs /dev/fd fdescfs rw 0 0" | sudo -E tee -a /etc/fstab
|
|
||||||
sudo -E mount /dev/fd
|
|
||||||
sudo -E touch /etc/zfs/exports
|
|
||||||
sudo -E sysrc mountd_flags="/etc/zfs/exports"
|
|
||||||
echo '[global]' | sudo -E tee /usr/local/etc/smb4.conf >/dev/null
|
|
||||||
sudo -E service nfsd enable
|
|
||||||
sudo -E service qemu-guest-agent enable
|
|
||||||
sudo -E service samba_server enable
|
|
||||||
;;
|
|
||||||
debian*|ubuntu*)
|
|
||||||
sudo -E systemctl enable nfs-kernel-server
|
|
||||||
sudo -E systemctl enable qemu-guest-agent
|
|
||||||
sudo -E systemctl enable smbd
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# All other linux distros
|
|
||||||
sudo -E systemctl enable nfs-server
|
|
||||||
sudo -E systemctl enable qemu-guest-agent
|
|
||||||
sudo -E systemctl enable smb
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
# Setup Kernel cmdline
|
|
||||||
CMDLINE="console=tty0 console=ttyS0,115200n8"
|
|
||||||
CMDLINE="$CMDLINE selinux=0"
|
|
||||||
CMDLINE="$CMDLINE random.trust_cpu=on"
|
|
||||||
CMDLINE="$CMDLINE no_timer_check"
|
|
||||||
case "$1" in
|
|
||||||
almalinux*|centos*|fedora*)
|
|
||||||
GRUB_CFG="/boot/grub2/grub.cfg"
|
|
||||||
GRUB_MKCONFIG="grub2-mkconfig"
|
|
||||||
CMDLINE="$CMDLINE biosdevname=0 net.ifnames=0"
|
|
||||||
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200"' \
|
|
||||||
| sudo tee -a /etc/default/grub >/dev/null
|
|
||||||
;;
|
|
||||||
ubuntu24)
|
|
||||||
GRUB_CFG="/boot/grub/grub.cfg"
|
|
||||||
GRUB_MKCONFIG="grub-mkconfig"
|
|
||||||
echo 'GRUB_DISABLE_OS_PROBER="false"' \
|
|
||||||
| sudo tee -a /etc/default/grub >/dev/null
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
GRUB_CFG="/boot/grub/grub.cfg"
|
|
||||||
GRUB_MKCONFIG="grub-mkconfig"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
archlinux|freebsd*)
|
|
||||||
true
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "##[group]Edit kernel cmdline"
|
|
||||||
sudo sed -i -e '/^GRUB_CMDLINE_LINUX/d' /etc/default/grub || true
|
|
||||||
echo "GRUB_CMDLINE_LINUX=\"$CMDLINE\"" \
|
|
||||||
| sudo tee -a /etc/default/grub >/dev/null
|
|
||||||
sudo $GRUB_MKCONFIG -o $GRUB_CFG
|
|
||||||
echo "##[endgroup]"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# reset cloud-init configuration and poweroff
|
|
||||||
sudo cloud-init clean --logs
|
|
||||||
sleep 2 && sudo poweroff &
|
|
||||||
exit 0
|
|
||||||
|
396
.github/workflows/scripts/qemu-4-build-vm.sh
vendored
Executable file
396
.github/workflows/scripts/qemu-4-build-vm.sh
vendored
Executable file
@ -0,0 +1,396 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# 4) configure and build openzfs modules. This is run on the VMs.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# qemu-4-build-vm.sh OS [--enable-debug][--dkms][--patch-level NUM]
|
||||||
|
# [--poweroff][--release][--repo][--tarball]
|
||||||
|
#
|
||||||
|
# OS: OS name like 'fedora41'
|
||||||
|
# --enable-debug: Build RPMs with '--enable-debug' (for testing)
|
||||||
|
# --dkms: Build DKMS RPMs as well
|
||||||
|
# --patch-level NUM: Use a custom patch level number for packages.
|
||||||
|
# --poweroff: Power-off the VM after building
|
||||||
|
# --release Build zfs-release*.rpm as well
|
||||||
|
# --repo After building everything, copy RPMs into /tmp/repo
|
||||||
|
# in the ZFS RPM repository file structure. Also
|
||||||
|
# copy tarballs if they were built.
|
||||||
|
# --tarball: Also build a tarball of ZFS source
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
ENABLE_DEBUG=""
|
||||||
|
DKMS=""
|
||||||
|
PATCH_LEVEL=""
|
||||||
|
POWEROFF=""
|
||||||
|
RELEASE=""
|
||||||
|
REPO=""
|
||||||
|
TARBALL=""
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
--enable-debug)
|
||||||
|
ENABLE_DEBUG=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--dkms)
|
||||||
|
DKMS=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--patch-level)
|
||||||
|
PATCH_LEVEL=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--poweroff)
|
||||||
|
POWEROFF=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--release)
|
||||||
|
RELEASE=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--repo)
|
||||||
|
REPO=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--tarball)
|
||||||
|
TARBALL=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
OS=$1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
function run() {
|
||||||
|
LOG="/var/tmp/build-stderr.txt"
|
||||||
|
echo "****************************************************"
|
||||||
|
echo "$(date) ($*)"
|
||||||
|
echo "****************************************************"
|
||||||
|
($@ || echo $? > /tmp/rv) 3>&1 1>&2 2>&3 | stdbuf -eL -oL tee -a $LOG
|
||||||
|
if [ -f /tmp/rv ]; then
|
||||||
|
RV=$(cat /tmp/rv)
|
||||||
|
echo "****************************************************"
|
||||||
|
echo "exit with value=$RV ($*)"
|
||||||
|
echo "****************************************************"
|
||||||
|
echo 1 > /var/tmp/build-exitcode.txt
|
||||||
|
exit $RV
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Look at the RPMs in the current directory and copy/move them to
|
||||||
|
# /tmp/repo, using the directory structure we use for the ZFS RPM repos.
|
||||||
|
#
|
||||||
|
# For example:
|
||||||
|
# /tmp/repo/epel-testing/9.5
|
||||||
|
# /tmp/repo/epel-testing/9.5/SRPMS
|
||||||
|
# /tmp/repo/epel-testing/9.5/SRPMS/zfs-2.3.99-1.el9.src.rpm
|
||||||
|
# /tmp/repo/epel-testing/9.5/SRPMS/zfs-kmod-2.3.99-1.el9.src.rpm
|
||||||
|
# /tmp/repo/epel-testing/9.5/kmod
|
||||||
|
# /tmp/repo/epel-testing/9.5/kmod/x86_64
|
||||||
|
# /tmp/repo/epel-testing/9.5/kmod/x86_64/debug
|
||||||
|
# /tmp/repo/epel-testing/9.5/kmod/x86_64/debug/kmod-zfs-debuginfo-2.3.99-1.el9.x86_64.rpm
|
||||||
|
# /tmp/repo/epel-testing/9.5/kmod/x86_64/debug/libnvpair3-debuginfo-2.3.99-1.el9.x86_64.rpm
|
||||||
|
# /tmp/repo/epel-testing/9.5/kmod/x86_64/debug/libuutil3-debuginfo-2.3.99-1.el9.x86_64.rpm
|
||||||
|
# ...
|
||||||
|
function copy_rpms_to_repo {
|
||||||
|
# Pick a RPM to query. It doesn't matter which one - we just want to extract
|
||||||
|
# the 'Build Host' value from it.
|
||||||
|
rpm=$(ls zfs-*.rpm | head -n 1)
|
||||||
|
|
||||||
|
# Get zfs version '2.2.99'
|
||||||
|
zfs_ver=$(rpm -qpi $rpm | awk '/Version/{print $3}')
|
||||||
|
|
||||||
|
# Get "2.1" or "2.2"
|
||||||
|
zfs_major=$(echo $zfs_ver | grep -Eo [0-9]+\.[0-9]+)
|
||||||
|
|
||||||
|
# Get 'almalinux9.5' or 'fedora41' type string
|
||||||
|
build_host=$(rpm -qpi $rpm | awk '/Build Host/{print $4}')
|
||||||
|
|
||||||
|
# Get '9.5' or '41' OS version
|
||||||
|
os_ver=$(echo $build_host | grep -Eo '[0-9\.]+$')
|
||||||
|
|
||||||
|
# Our ZFS version and OS name will determine which repo the RPMs
|
||||||
|
# will go in (regular or testing). Fedora always gets the newest
|
||||||
|
# releases, and Alma gets the older releases.
|
||||||
|
case $build_host in
|
||||||
|
almalinux*)
|
||||||
|
case $zfs_major in
|
||||||
|
2.2)
|
||||||
|
d="epel"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
d="epel-testing"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
fedora*)
|
||||||
|
d="fedora"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
prefix=/tmp/repo
|
||||||
|
dst="$prefix/$d/$os_ver"
|
||||||
|
|
||||||
|
# Special case: move zfs-release*.rpm out of the way first (if we built them).
|
||||||
|
# This will make filtering the other RPMs easier.
|
||||||
|
mkdir -p $dst
|
||||||
|
mv zfs-release*.rpm $dst || true
|
||||||
|
|
||||||
|
# Copy source RPMs
|
||||||
|
mkdir -p $dst/SRPMS
|
||||||
|
cp $(ls *.src.rpm) $dst/SRPMS/
|
||||||
|
|
||||||
|
if [[ "$build_host" =~ "almalinux" ]] ; then
|
||||||
|
# Copy kmods+userspace
|
||||||
|
mkdir -p $dst/kmod/x86_64/debug
|
||||||
|
cp $(ls *.rpm | grep -Ev 'src.rpm|dkms|debuginfo') $dst/kmod/x86_64
|
||||||
|
cp *debuginfo*.rpm $dst/kmod/x86_64/debug
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$DKMS" ] ; then
|
||||||
|
# Copy dkms+userspace
|
||||||
|
mkdir -p $dst/x86_64
|
||||||
|
cp $(ls *.rpm | grep -Ev 'src.rpm|kmod|debuginfo') $dst/x86_64
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy debug
|
||||||
|
mkdir -p $dst/x86_64/debug
|
||||||
|
cp $(ls *debuginfo*.rpm | grep -v kmod) $dst/x86_64/debug
|
||||||
|
}
|
||||||
|
|
||||||
|
function freebsd() {
|
||||||
|
extra="${1:-}"
|
||||||
|
|
||||||
|
export MAKE="gmake"
|
||||||
|
echo "##[group]Autogen.sh"
|
||||||
|
run ./autogen.sh
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Configure"
|
||||||
|
run ./configure \
|
||||||
|
--prefix=/usr/local \
|
||||||
|
--with-libintl-prefix=/usr/local \
|
||||||
|
--enable-pyzfs \
|
||||||
|
--enable-debuginfo $extra
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Build"
|
||||||
|
run gmake -j$(sysctl -n hw.ncpu)
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Install"
|
||||||
|
run sudo gmake install
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function linux() {
|
||||||
|
extra="${1:-}"
|
||||||
|
|
||||||
|
echo "##[group]Autogen.sh"
|
||||||
|
run ./autogen.sh
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Configure"
|
||||||
|
run ./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--enable-pyzfs \
|
||||||
|
--enable-debuginfo $extra
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Build"
|
||||||
|
run make -j$(nproc)
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Install"
|
||||||
|
run sudo make install
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function rpm_build_and_install() {
|
||||||
|
extra="${1:-}"
|
||||||
|
|
||||||
|
# Build RPMs with XZ compression by default (since gzip decompression is slow)
|
||||||
|
echo "%_binary_payload w7.xzdio" >> ~/.rpmmacros
|
||||||
|
|
||||||
|
echo "##[group]Autogen.sh"
|
||||||
|
run ./autogen.sh
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
if [ -n "$PATCH_LEVEL" ] ; then
|
||||||
|
sed -i -E 's/(Release:\s+)1/\1'$PATCH_LEVEL'/g' META
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "##[group]Configure"
|
||||||
|
run ./configure --enable-debuginfo $extra
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Build"
|
||||||
|
run make pkg-kmod pkg-utils
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
if [ -n "$DKMS" ] ; then
|
||||||
|
echo "##[group]DKMS"
|
||||||
|
make rpm-dkms
|
||||||
|
echo "##[endgroup]"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$REPO" ] ; then
|
||||||
|
echo "Skipping install since we're only building RPMs and nothing else"
|
||||||
|
else
|
||||||
|
echo "##[group]Install"
|
||||||
|
run sudo dnf -y --nobest install $(ls *.rpm | grep -Ev 'dkms|src.rpm')
|
||||||
|
echo "##[endgroup]"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Optionally build the zfs-release.*.rpm
|
||||||
|
if [ -n "$RELEASE" ] ; then
|
||||||
|
echo "##[group]Release"
|
||||||
|
pushd ~
|
||||||
|
sudo dnf -y install rpm-build || true
|
||||||
|
# Check out a sparse copy of zfsonlinux.github.com.git so we don't get
|
||||||
|
# all the binaries. We just need a few kilobytes of files to build RPMs.
|
||||||
|
git clone --depth 1 --no-checkout \
|
||||||
|
https://github.com/zfsonlinux/zfsonlinux.github.com.git
|
||||||
|
|
||||||
|
cd zfsonlinux.github.com
|
||||||
|
git sparse-checkout set zfs-release
|
||||||
|
git checkout
|
||||||
|
cd zfs-release
|
||||||
|
|
||||||
|
mkdir -p ~/rpmbuild/{BUILDROOT,SPECS,RPMS,SRPMS,SOURCES,BUILD}
|
||||||
|
cp RPM-GPG-KEY-openzfs* *.repo ~/rpmbuild/SOURCES
|
||||||
|
cp zfs-release.spec ~/rpmbuild/SPECS/
|
||||||
|
rpmbuild -ba ~/rpmbuild/SPECS/zfs-release.spec
|
||||||
|
|
||||||
|
# ZFS release RPMs are built. Copy them to the ~/zfs directory just to
|
||||||
|
# keep all the RPMs in the same place.
|
||||||
|
cp ~/rpmbuild/RPMS/noarch/*.rpm ~/zfs
|
||||||
|
cp ~/rpmbuild/SRPMS/*.rpm ~/zfs
|
||||||
|
|
||||||
|
popd
|
||||||
|
rm -fr ~/rpmbuild
|
||||||
|
echo "##[endgroup]"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$REPO" ] ; then
|
||||||
|
echo "##[group]Repo"
|
||||||
|
copy_rpms_to_repo
|
||||||
|
echo "##[endgroup]"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function deb_build_and_install() {
|
||||||
|
extra="${1:-}"
|
||||||
|
|
||||||
|
echo "##[group]Autogen.sh"
|
||||||
|
run ./autogen.sh
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Configure"
|
||||||
|
run ./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--enable-pyzfs \
|
||||||
|
--enable-debuginfo $extra
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Build"
|
||||||
|
run make native-deb-kmod native-deb-utils
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
echo "##[group]Install"
|
||||||
|
# Do kmod install. Note that when you build the native debs, the
|
||||||
|
# packages themselves are placed in parent directory '../' rather than
|
||||||
|
# in the source directory like the rpms are.
|
||||||
|
run sudo apt-get -y install $(find ../ | grep -E '\.deb$' \
|
||||||
|
| grep -Ev 'dkms|dracut')
|
||||||
|
echo "##[endgroup]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_tarball {
|
||||||
|
if [ -n "$REPO" ] ; then
|
||||||
|
./autogen.sh
|
||||||
|
./configure --with-config=srpm
|
||||||
|
make dist
|
||||||
|
mkdir -p /tmp/repo/releases
|
||||||
|
# The tarball name is based off of 'Version' field in the META file.
|
||||||
|
mv *.tar.gz /tmp/repo/releases/
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Debug: show kernel cmdline
|
||||||
|
if [ -f /proc/cmdline ] ; then
|
||||||
|
cat /proc/cmdline || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set our hostname to our OS name and version number. Specifically, we set the
|
||||||
|
# major and minor number so that when we query the Build Host field in the RPMs
|
||||||
|
# we build, we can see what specific version of Fedora/Almalinux we were using
|
||||||
|
# to build them. This is helpful for matching up KMOD versions.
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
#
|
||||||
|
# rhel8.10
|
||||||
|
# almalinux9.5
|
||||||
|
# fedora42
|
||||||
|
source /etc/os-release
|
||||||
|
if which hostnamectl &> /dev/null ; then
|
||||||
|
# Fedora 42+ use hostnamectl
|
||||||
|
sudo hostnamectl set-hostname "$ID$VERSION_ID"
|
||||||
|
sudo hostnamectl set-hostname --pretty "$ID$VERSION_ID"
|
||||||
|
else
|
||||||
|
sudo hostname "$ID$VERSION_ID"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# save some sysinfo
|
||||||
|
uname -a > /var/tmp/uname.txt
|
||||||
|
|
||||||
|
cd $HOME/zfs
|
||||||
|
export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
|
||||||
|
|
||||||
|
extra=""
|
||||||
|
if [ -n "$ENABLE_DEBUG" ] ; then
|
||||||
|
extra="--enable-debug"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# build
|
||||||
|
case "$OS" in
|
||||||
|
freebsd*)
|
||||||
|
freebsd "$extra"
|
||||||
|
;;
|
||||||
|
alma*|centos*)
|
||||||
|
rpm_build_and_install "--with-spec=redhat $extra"
|
||||||
|
;;
|
||||||
|
fedora*)
|
||||||
|
rpm_build_and_install "$extra"
|
||||||
|
|
||||||
|
# Historically, we've always built the release tarballs on Fedora, since
|
||||||
|
# there was one instance long ago where we built them on CentOS 7, and they
|
||||||
|
# didn't work correctly for everyone.
|
||||||
|
if [ -n "$TARBALL" ] ; then
|
||||||
|
build_tarball
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
debian*|ubuntu*)
|
||||||
|
deb_build_and_install "$extra"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
linux "$extra"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
# building the zfs module was ok
|
||||||
|
echo 0 > /var/tmp/build-exitcode.txt
|
||||||
|
|
||||||
|
# reset cloud-init configuration and poweroff
|
||||||
|
if [ -n "$POWEROFF" ] ; then
|
||||||
|
sudo cloud-init clean --logs
|
||||||
|
sync && sleep 2 && sudo poweroff &
|
||||||
|
fi
|
||||||
|
exit 0
|
150
.github/workflows/scripts/qemu-4-build.sh
vendored
150
.github/workflows/scripts/qemu-4-build.sh
vendored
@ -3,151 +3,9 @@
|
|||||||
######################################################################
|
######################################################################
|
||||||
# 4) configure and build openzfs modules
|
# 4) configure and build openzfs modules
|
||||||
######################################################################
|
######################################################################
|
||||||
|
echo "Build modules in QEMU machine"
|
||||||
|
|
||||||
set -eu
|
# Bring our VM back up and copy over ZFS source
|
||||||
|
.github/workflows/scripts/qemu-prepare-for-build.sh
|
||||||
|
|
||||||
function run() {
|
ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-4-build-vm.sh' $@
|
||||||
LOG="/var/tmp/build-stderr.txt"
|
|
||||||
echo "****************************************************"
|
|
||||||
echo "$(date) ($*)"
|
|
||||||
echo "****************************************************"
|
|
||||||
($@ || echo $? > /tmp/rv) 3>&1 1>&2 2>&3 | stdbuf -eL -oL tee -a $LOG
|
|
||||||
if [ -f /tmp/rv ]; then
|
|
||||||
RV=$(cat /tmp/rv)
|
|
||||||
echo "****************************************************"
|
|
||||||
echo "exit with value=$RV ($*)"
|
|
||||||
echo "****************************************************"
|
|
||||||
echo 1 > /var/tmp/build-exitcode.txt
|
|
||||||
exit $RV
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function freebsd() {
|
|
||||||
export MAKE="gmake"
|
|
||||||
echo "##[group]Autogen.sh"
|
|
||||||
run ./autogen.sh
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Configure"
|
|
||||||
run ./configure \
|
|
||||||
--prefix=/usr/local \
|
|
||||||
--with-libintl-prefix=/usr/local \
|
|
||||||
--enable-pyzfs \
|
|
||||||
--enable-debug \
|
|
||||||
--enable-debuginfo
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Build"
|
|
||||||
run gmake -j$(sysctl -n hw.ncpu)
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Install"
|
|
||||||
run sudo gmake install
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
function linux() {
|
|
||||||
echo "##[group]Autogen.sh"
|
|
||||||
run ./autogen.sh
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Configure"
|
|
||||||
run ./configure \
|
|
||||||
--prefix=/usr \
|
|
||||||
--enable-pyzfs \
|
|
||||||
--enable-debug \
|
|
||||||
--enable-debuginfo
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Build"
|
|
||||||
run make -j$(nproc)
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Install"
|
|
||||||
run sudo make install
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
function rpm_build_and_install() {
|
|
||||||
EXTRA_CONFIG="${1:-}"
|
|
||||||
echo "##[group]Autogen.sh"
|
|
||||||
run ./autogen.sh
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Configure"
|
|
||||||
run ./configure --enable-debug --enable-debuginfo $EXTRA_CONFIG
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Build"
|
|
||||||
run make pkg-kmod pkg-utils
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Install"
|
|
||||||
run sudo dnf -y --skip-broken localinstall $(ls *.rpm | grep -v src.rpm)
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function deb_build_and_install() {
|
|
||||||
echo "##[group]Autogen.sh"
|
|
||||||
run ./autogen.sh
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Configure"
|
|
||||||
run ./configure \
|
|
||||||
--prefix=/usr \
|
|
||||||
--enable-pyzfs \
|
|
||||||
--enable-debug \
|
|
||||||
--enable-debuginfo
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Build"
|
|
||||||
run make native-deb-kmod native-deb-utils
|
|
||||||
echo "##[endgroup]"
|
|
||||||
|
|
||||||
echo "##[group]Install"
|
|
||||||
# Do kmod install. Note that when you build the native debs, the
|
|
||||||
# packages themselves are placed in parent directory '../' rather than
|
|
||||||
# in the source directory like the rpms are.
|
|
||||||
run sudo apt-get -y install $(find ../ | grep -E '\.deb$' \
|
|
||||||
| grep -Ev 'dkms|dracut')
|
|
||||||
echo "##[endgroup]"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Debug: show kernel cmdline
|
|
||||||
if [ -f /proc/cmdline ] ; then
|
|
||||||
cat /proc/cmdline || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# save some sysinfo
|
|
||||||
uname -a > /var/tmp/uname.txt
|
|
||||||
|
|
||||||
cd $HOME/zfs
|
|
||||||
export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
|
|
||||||
|
|
||||||
# build
|
|
||||||
case "$1" in
|
|
||||||
freebsd*)
|
|
||||||
freebsd
|
|
||||||
;;
|
|
||||||
alma*|centos*)
|
|
||||||
rpm_build_and_install "--with-spec=redhat"
|
|
||||||
;;
|
|
||||||
fedora*)
|
|
||||||
rpm_build_and_install
|
|
||||||
;;
|
|
||||||
debian*|ubuntu*)
|
|
||||||
deb_build_and_install
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
linux
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# building the zfs module was ok
|
|
||||||
echo 0 > /var/tmp/build-exitcode.txt
|
|
||||||
|
|
||||||
# reset cloud-init configuration and poweroff
|
|
||||||
sudo cloud-init clean --logs
|
|
||||||
sync && sleep 2 && sudo poweroff &
|
|
||||||
exit 0
|
|
||||||
|
78
.github/workflows/scripts/qemu-5-setup.sh
vendored
78
.github/workflows/scripts/qemu-5-setup.sh
vendored
@ -12,37 +12,45 @@ source /var/tmp/env.txt
|
|||||||
# wait for poweroff to succeed
|
# wait for poweroff to succeed
|
||||||
PID=$(pidof /usr/bin/qemu-system-x86_64)
|
PID=$(pidof /usr/bin/qemu-system-x86_64)
|
||||||
tail --pid=$PID -f /dev/null
|
tail --pid=$PID -f /dev/null
|
||||||
sudo virsh undefine openzfs
|
sudo virsh undefine --nvram openzfs
|
||||||
|
|
||||||
|
# cpu pinning
|
||||||
|
CPUSET=("0,1" "2,3")
|
||||||
|
|
||||||
|
# additional options for virt-install
|
||||||
|
OPTS[0]=""
|
||||||
|
OPTS[1]=""
|
||||||
|
|
||||||
# definitions of per operating system
|
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
freebsd*)
|
freebsd*)
|
||||||
VMs=2
|
# FreeBSD needs only 6GiB
|
||||||
CPU=3
|
|
||||||
RAM=6
|
RAM=6
|
||||||
;;
|
;;
|
||||||
|
debian13)
|
||||||
|
RAM=8
|
||||||
|
# Boot Debian 13 with uefi=on and secureboot=off (ZFS Kernel Module not signed)
|
||||||
|
OPTS[0]="--boot"
|
||||||
|
OPTS[1]="firmware=efi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
VMs=2
|
# Linux needs more memory, but can be optimized to share it via KSM
|
||||||
CPU=3
|
RAM=8
|
||||||
RAM=7
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# this can be different for each distro
|
|
||||||
echo "VMs=$VMs" >> $ENV
|
|
||||||
|
|
||||||
# create snapshot we can clone later
|
# create snapshot we can clone later
|
||||||
sudo zfs snapshot zpool/openzfs@now
|
sudo zfs snapshot zpool/openzfs@now
|
||||||
|
|
||||||
# setup the testing vm's
|
# setup the testing vm's
|
||||||
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
PUBKEY=$(cat ~/.ssh/id_ed25519.pub)
|
||||||
for i in $(seq 1 $VMs); do
|
|
||||||
|
|
||||||
|
# start testing VMs
|
||||||
|
for ((i=1; i<=VMs; i++)); do
|
||||||
echo "Creating disk for vm$i..."
|
echo "Creating disk for vm$i..."
|
||||||
DISK="/dev/zvol/zpool/vm$i"
|
DISK="/dev/zvol/zpool/vm$i"
|
||||||
FORMAT="raw"
|
FORMAT="raw"
|
||||||
sudo zfs clone zpool/openzfs@now zpool/vm$i
|
sudo zfs clone zpool/openzfs@now zpool/vm$i-system
|
||||||
sudo zfs create -ps -b 64k -V 80g zpool/vm$i-2
|
sudo zfs create -ps -b 64k -V 64g zpool/vm$i-tests
|
||||||
|
|
||||||
cat <<EOF > /tmp/user-data
|
cat <<EOF > /tmp/user-data
|
||||||
#cloud-config
|
#cloud-config
|
||||||
@ -73,49 +81,57 @@ EOF
|
|||||||
--cpu host-passthrough \
|
--cpu host-passthrough \
|
||||||
--virt-type=kvm --hvm \
|
--virt-type=kvm --hvm \
|
||||||
--vcpus=$CPU,sockets=1 \
|
--vcpus=$CPU,sockets=1 \
|
||||||
|
--cpuset=${CPUSET[$((i-1))]} \
|
||||||
--memory $((1024*RAM)) \
|
--memory $((1024*RAM)) \
|
||||||
--memballoon model=virtio \
|
--memballoon model=virtio \
|
||||||
--graphics none \
|
--graphics none \
|
||||||
--cloud-init user-data=/tmp/user-data \
|
--cloud-init user-data=/tmp/user-data \
|
||||||
--network bridge=virbr0,model=$NIC,mac="52:54:00:83:79:0$i" \
|
--network bridge=virbr0,model=$NIC,mac="52:54:00:83:79:0$i" \
|
||||||
--disk $DISK,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
--disk $DISK-system,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
||||||
--disk $DISK-2,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
--disk $DISK-tests,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \
|
||||||
--import --noautoconsole >/dev/null
|
--import --noautoconsole ${OPTS[0]} ${OPTS[1]}
|
||||||
done
|
done
|
||||||
|
|
||||||
# check the memory state from time to time
|
# generate some memory stats
|
||||||
cat <<EOF > cronjob.sh
|
cat <<EOF > cronjob.sh
|
||||||
# $OS
|
|
||||||
exec 1>>/var/tmp/stats.txt
|
exec 1>>/var/tmp/stats.txt
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
echo "*******************************************************"
|
echo "********************************************************************************"
|
||||||
date
|
|
||||||
uptime
|
uptime
|
||||||
free -m
|
free -m
|
||||||
df -h /mnt/tests
|
|
||||||
zfs list
|
zfs list
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo chmod +x cronjob.sh
|
sudo chmod +x cronjob.sh
|
||||||
sudo mv -f cronjob.sh /root/cronjob.sh
|
sudo mv -f cronjob.sh /root/cronjob.sh
|
||||||
echo '*/5 * * * * /root/cronjob.sh' > crontab.txt
|
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 in $(seq 1 $VMs); do
|
|
||||||
while true; do
|
|
||||||
ssh 2>/dev/null zfs@192.168.122.1$i "uname -a" && break
|
|
||||||
done
|
|
||||||
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 in $(seq 1 $VMs); 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."
|
||||||
|
30
.github/workflows/scripts/qemu-6-tests.sh
vendored
30
.github/workflows/scripts/qemu-6-tests.sh
vendored
@ -21,11 +21,13 @@ function prefix() {
|
|||||||
S=$((DIFF-(M*60)))
|
S=$((DIFF-(M*60)))
|
||||||
|
|
||||||
CTR=$(cat /tmp/ctr)
|
CTR=$(cat /tmp/ctr)
|
||||||
echo $LINE| grep -q "^Test[: ]" && CTR=$((CTR+1)) && echo $CTR > /tmp/ctr
|
echo $LINE| grep -q '^\[.*] Test[: ]' && CTR=$((CTR+1)) && echo $CTR > /tmp/ctr
|
||||||
|
|
||||||
BASE="$HOME/work/zfs/zfs"
|
BASE="$HOME/work/zfs/zfs"
|
||||||
COLOR="$BASE/scripts/zfs-tests-color.sh"
|
COLOR="$BASE/scripts/zfs-tests-color.sh"
|
||||||
CLINE=$(echo $LINE| grep "^Test[ :]" | sed -e 's|/usr/local|/usr|g' \
|
CLINE=$(echo $LINE| grep '^\[.*] Test[: ]' \
|
||||||
|
| sed -e 's|^\[.*] Test|Test|g' \
|
||||||
|
| sed -e 's|/usr/local|/usr|g' \
|
||||||
| sed -e 's| /usr/share/zfs/zfs-tests/tests/| |g' | $COLOR)
|
| sed -e 's| /usr/share/zfs/zfs-tests/tests/| |g' | $COLOR)
|
||||||
if [ -z "$CLINE" ]; then
|
if [ -z "$CLINE" ]; then
|
||||||
printf "vm${ID}: %s\n" "$LINE"
|
printf "vm${ID}: %s\n" "$LINE"
|
||||||
@ -45,7 +47,7 @@ if [ -z ${1:-} ]; then
|
|||||||
echo 0 > /tmp/ctr
|
echo 0 > /tmp/ctr
|
||||||
date "+%s" > /tmp/tsstart
|
date "+%s" > /tmp/tsstart
|
||||||
|
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
IP="192.168.122.1$i"
|
IP="192.168.122.1$i"
|
||||||
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 $CI_TYPE
|
||||||
@ -58,7 +60,7 @@ if [ -z ${1:-} ]; then
|
|||||||
done
|
done
|
||||||
|
|
||||||
# wait for all vm's to finish
|
# wait for all vm's to finish
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
tail --pid=$(cat vm${i}.pid) -f /dev/null
|
tail --pid=$(cat vm${i}.pid) -f /dev/null
|
||||||
pid=$(cat vm${i}log.pid)
|
pid=$(cat vm${i}log.pid)
|
||||||
rm -f vm${i}log.pid
|
rm -f vm${i}log.pid
|
||||||
@ -72,19 +74,31 @@ 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 "$1" in
|
||||||
freebsd*)
|
freebsd*)
|
||||||
|
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
|
||||||
sudo -E ./zfs/scripts/zfs.sh
|
sudo -E ./zfs/scripts/zfs.sh
|
||||||
TDIR="/usr/local/share/zfs"
|
sudo mv -f /var/tmp/*.txt /tmp
|
||||||
|
sudo newfs -U -t -L tmp /dev/vtbd1 >/dev/null
|
||||||
|
sudo mount -o noatime /dev/vtbd1 /var/tmp
|
||||||
|
sudo chmod 1777 /var/tmp
|
||||||
|
sudo mv -f /tmp/*.txt /var/tmp
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# use xfs @ /var/tmp for all distros
|
# use xfs @ /var/tmp for all distros
|
||||||
|
TDIR="/usr/share/zfs"
|
||||||
|
sudo -E modprobe zfs
|
||||||
sudo mv -f /var/tmp/*.txt /tmp
|
sudo mv -f /var/tmp/*.txt /tmp
|
||||||
sudo mkfs.xfs -fq /dev/vdb
|
sudo mkfs.xfs -fq /dev/vdb
|
||||||
sudo mount -o noatime /dev/vdb /var/tmp
|
sudo mount -o noatime /dev/vdb /var/tmp
|
||||||
sudo chmod 1777 /var/tmp
|
sudo chmod 1777 /var/tmp
|
||||||
sudo mv -f /tmp/*.txt /var/tmp
|
sudo mv -f /tmp/*.txt /var/tmp
|
||||||
sudo -E modprobe zfs
|
;;
|
||||||
TDIR="/usr/share/zfs"
|
esac
|
||||||
|
|
||||||
|
# enable io_uring on el9/el10
|
||||||
|
case "$1" in
|
||||||
|
almalinux9|almalinux10|centos-stream*)
|
||||||
|
sudo sysctl kernel.io_uring_disabled=0 > /dev/null
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -97,7 +111,7 @@ fi
|
|||||||
sudo dmesg -c > dmesg-prerun.txt
|
sudo dmesg -c > dmesg-prerun.txt
|
||||||
mount > mount.txt
|
mount > mount.txt
|
||||||
df -h > df-prerun.txt
|
df -h > df-prerun.txt
|
||||||
$TDIR/zfs-tests.sh -vK -s 3GB -T $TAGS
|
$TDIR/zfs-tests.sh -vKO -s 3GB -T $TAGS
|
||||||
RV=$?
|
RV=$?
|
||||||
df -h > df-postrun.txt
|
df -h > df-postrun.txt
|
||||||
echo $RV > tests-exitcode.txt
|
echo $RV > tests-exitcode.txt
|
||||||
|
9
.github/workflows/scripts/qemu-7-prepare.sh
vendored
9
.github/workflows/scripts/qemu-7-prepare.sh
vendored
@ -28,15 +28,16 @@ BASE="$HOME/work/zfs/zfs"
|
|||||||
MERGE="$BASE/.github/workflows/scripts/merge_summary.awk"
|
MERGE="$BASE/.github/workflows/scripts/merge_summary.awk"
|
||||||
|
|
||||||
# catch result files of testings (vm's should be there)
|
# catch result files of testings (vm's should be there)
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
rsync -arL zfs@192.168.122.1$i:$RESPATH/current $RESPATH/vm$i || true
|
rsync -arL zfs@vm$i:$RESPATH/current $RESPATH/vm$i || true
|
||||||
scp zfs@192.168.122.1$i:"/var/tmp/*.txt" $RESPATH/vm$i || true
|
scp zfs@vm$i:"/var/tmp/*.txt" $RESPATH/vm$i || true
|
||||||
|
scp zfs@vm$i:"/var/tmp/*.rpm" $RESPATH/vm$i || true
|
||||||
done
|
done
|
||||||
cp -f /var/tmp/*.txt $RESPATH || true
|
cp -f /var/tmp/*.txt $RESPATH || true
|
||||||
cd $RESPATH
|
cd $RESPATH
|
||||||
|
|
||||||
# prepare result files for summary
|
# prepare result files for summary
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
file="vm$i/build-stderr.txt"
|
file="vm$i/build-stderr.txt"
|
||||||
test -s $file && mv -f $file build-stderr.txt
|
test -s $file && mv -f $file build-stderr.txt
|
||||||
|
|
||||||
|
2
.github/workflows/scripts/qemu-8-summary.sh
vendored
2
.github/workflows/scripts/qemu-8-summary.sh
vendored
@ -45,7 +45,7 @@ fi
|
|||||||
|
|
||||||
echo -e "\nFull logs for download:\n $1\n"
|
echo -e "\nFull logs for download:\n $1\n"
|
||||||
|
|
||||||
for i in $(seq 1 $VMs); do
|
for ((i=1; i<=VMs; i++)); do
|
||||||
rv=$(cat vm$i/tests-exitcode.txt)
|
rv=$(cat vm$i/tests-exitcode.txt)
|
||||||
|
|
||||||
if [ $rv = 0 ]; then
|
if [ $rv = 0 ]; then
|
||||||
|
@ -11,12 +11,10 @@ function output() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function outfile() {
|
function outfile() {
|
||||||
test -s "$1" || return
|
|
||||||
cat "$1" >> "out-$logfile.md"
|
cat "$1" >> "out-$logfile.md"
|
||||||
}
|
}
|
||||||
|
|
||||||
function outfile_plain() {
|
function outfile_plain() {
|
||||||
test -s "$1" || return
|
|
||||||
output "<pre>"
|
output "<pre>"
|
||||||
cat "$1" >> "out-$logfile.md"
|
cat "$1" >> "out-$logfile.md"
|
||||||
output "</pre>"
|
output "</pre>"
|
||||||
@ -45,6 +43,8 @@ if [ ! -f out-1.md ]; then
|
|||||||
tar xf "$tarfile"
|
tar xf "$tarfile"
|
||||||
test -s env.txt || continue
|
test -s env.txt || continue
|
||||||
source env.txt
|
source env.txt
|
||||||
|
# when uname.txt is there, the other files are also ok
|
||||||
|
test -s uname.txt || continue
|
||||||
output "\n## Functional Tests: $OSNAME\n"
|
output "\n## Functional Tests: $OSNAME\n"
|
||||||
outfile_plain uname.txt
|
outfile_plain uname.txt
|
||||||
outfile_plain summary.txt
|
outfile_plain summary.txt
|
||||||
|
8
.github/workflows/scripts/qemu-prepare-for-build.sh
vendored
Executable file
8
.github/workflows/scripts/qemu-prepare-for-build.sh
vendored
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Helper script to run after installing dependencies. This brings the VM back
|
||||||
|
# up and copies over the zfs source directory.
|
||||||
|
echo "Build modules in QEMU machine"
|
||||||
|
sudo virsh start openzfs
|
||||||
|
.github/workflows/scripts/qemu-wait-for-vm.sh vm0
|
||||||
|
rsync -ar $HOME/work/zfs/zfs zfs@vm0:./
|
90
.github/workflows/scripts/qemu-test-repo-vm.sh
vendored
Executable file
90
.github/workflows/scripts/qemu-test-repo-vm.sh
vendored
Executable file
@ -0,0 +1,90 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Do a test install of ZFS from an external repository.
|
||||||
|
#
|
||||||
|
# USAGE:
|
||||||
|
#
|
||||||
|
# ./qemu-test-repo-vm [URL]
|
||||||
|
#
|
||||||
|
# URL: URL to use instead of http://download.zfsonlinux.org
|
||||||
|
# If blank, use the default repo from zfs-release RPM.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
source /etc/os-release
|
||||||
|
OS="$ID"
|
||||||
|
VERSION="$VERSION_ID"
|
||||||
|
|
||||||
|
ALTHOST=""
|
||||||
|
if [ -n "$1" ] ; then
|
||||||
|
ALTHOST="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Write summary to /tmp/repo so our artifacts scripts pick it up
|
||||||
|
mkdir /tmp/repo
|
||||||
|
SUMMARY=/tmp/repo/$OS-$VERSION-summary.txt
|
||||||
|
|
||||||
|
# $1: Repo 'zfs' 'zfs-kmod' 'zfs-testing' 'zfs-testing-kmod'
|
||||||
|
# $2: (optional) Alternate host than 'http://download.zfsonlinux.org' to
|
||||||
|
# install from. Blank means use default from zfs-release RPM.
|
||||||
|
function test_install {
|
||||||
|
repo=$1
|
||||||
|
host=""
|
||||||
|
if [ -n "$2" ] ; then
|
||||||
|
host=$2
|
||||||
|
fi
|
||||||
|
|
||||||
|
args="--disablerepo=zfs --enablerepo=$repo"
|
||||||
|
|
||||||
|
# If we supplied an alternate repo URL, and have not already edited
|
||||||
|
# zfs.repo, then update the repo file.
|
||||||
|
if [ -n "$host" ] && ! grep -q $host /etc/yum.repos.d/zfs.repo ; then
|
||||||
|
sudo sed -i "s;baseurl=http://download.zfsonlinux.org;baseurl=$host;g" /etc/yum.repos.d/zfs.repo
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo dnf -y install $args zfs zfs-test
|
||||||
|
|
||||||
|
# Load modules and create a simple pool as a sanity test.
|
||||||
|
sudo /usr/share/zfs/zfs.sh -r
|
||||||
|
truncate -s 100M /tmp/file
|
||||||
|
sudo zpool create tank /tmp/file
|
||||||
|
sudo zpool status
|
||||||
|
|
||||||
|
# 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')
|
||||||
|
|
||||||
|
echo "$repo $package $baseurl" >> $SUMMARY
|
||||||
|
|
||||||
|
sudo zpool destroy tank
|
||||||
|
sudo rm /tmp/file
|
||||||
|
sudo dnf -y remove zfs
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "##[group]Installing from repo"
|
||||||
|
# The openzfs docs are the authoritative instructions for the install. Use
|
||||||
|
# the specific version of zfs-release RPM it recommends.
|
||||||
|
case $OS in
|
||||||
|
almalinux*)
|
||||||
|
url='https://raw.githubusercontent.com/openzfs/openzfs-docs/refs/heads/master/docs/Getting%20Started/RHEL-based%20distro/index.rst'
|
||||||
|
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 rpm -qi zfs-release
|
||||||
|
test_install zfs $ALTHOST
|
||||||
|
test_install zfs-kmod $ALTHOST
|
||||||
|
test_install zfs-testing $ALTHOST
|
||||||
|
test_install zfs-testing-kmod $ALTHOST
|
||||||
|
;;
|
||||||
|
fedora*)
|
||||||
|
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]+')
|
||||||
|
sudo dnf -y install -y https://zfsonlinux.org/fedora/$name$(rpm --eval "%{dist}").noarch.rpm
|
||||||
|
test_install zfs $ALTHOST
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo "##[endgroup]"
|
||||||
|
|
||||||
|
# Write out a simple version of the summary here. Later on we will collate all
|
||||||
|
# the summaries and put them into a nice table in the workflow Summary page.
|
||||||
|
echo "Summary: "
|
||||||
|
cat $SUMMARY
|
10
.github/workflows/scripts/qemu-wait-for-vm.sh
vendored
Executable file
10
.github/workflows/scripts/qemu-wait-for-vm.sh
vendored
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Wait for a VM to boot up and become active. This is used in a number of our
|
||||||
|
# scripts.
|
||||||
|
#
|
||||||
|
# $1: VM hostname or IP address
|
||||||
|
|
||||||
|
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
||||||
|
ssh 2>/dev/null zfs@$1 "uname -a" && break
|
||||||
|
done
|
32
.github/workflows/scripts/replace-dupes-with-symlinks.sh
vendored
Executable file
32
.github/workflows/scripts/replace-dupes-with-symlinks.sh
vendored
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Recursively go though a directory structure and replace duplicate files with
|
||||||
|
# symlinks. This cuts down our RPM repo size by ~25%.
|
||||||
|
#
|
||||||
|
# replace-dupes-with-symlinks.sh [DIR]
|
||||||
|
#
|
||||||
|
# DIR: Directory to traverse. Defaults to current directory if not specified.
|
||||||
|
#
|
||||||
|
|
||||||
|
src="$1"
|
||||||
|
if [ -z "$src" ] ; then
|
||||||
|
src="."
|
||||||
|
fi
|
||||||
|
|
||||||
|
declare -A db
|
||||||
|
|
||||||
|
pushd "$src"
|
||||||
|
while read line ; do
|
||||||
|
bn="$(basename $line)"
|
||||||
|
if [ -z "${db[$bn]}" ] ; then
|
||||||
|
# First time this file has been seen
|
||||||
|
db[$bn]="$line"
|
||||||
|
else
|
||||||
|
if diff -b "$line" "${db[$bn]}" &>/dev/null ; then
|
||||||
|
# Files are the same, make a symlink
|
||||||
|
rm "$line"
|
||||||
|
ln -sr "${db[$bn]}" "$line"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done <<< "$(find . -type f)"
|
||||||
|
popd
|
151
.github/workflows/zfs-qemu-packages.yml
vendored
Normal file
151
.github/workflows/zfs-qemu-packages.yml
vendored
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
# This workflow is used to build and test RPM packages. It is a
|
||||||
|
# 'workflow_dispatch' workflow, which means it gets run manually.
|
||||||
|
#
|
||||||
|
# The workflow has a dropdown menu with two options:
|
||||||
|
#
|
||||||
|
# Build RPMs - Build release RPMs and tarballs and put them into an artifact
|
||||||
|
# ZIP file. The directory structure used in the ZIP file mirrors
|
||||||
|
# the ZFS yum repo.
|
||||||
|
#
|
||||||
|
# Test repo - Test install the ZFS RPMs from the ZFS repo. On EL distos, this
|
||||||
|
# will do a DKMS and KMOD test install from both the regular and
|
||||||
|
# testing repos. On Fedora, it will do a DKMS install from the
|
||||||
|
# regular repo. All test install results will be displayed in the
|
||||||
|
# Summary page. Note that the workflow provides an optional text
|
||||||
|
# text box where you can specify the full URL to an alternate repo.
|
||||||
|
# If left blank, it will install from the default repo from the
|
||||||
|
# zfs-release RPM (http://download.zfsonlinux.org).
|
||||||
|
#
|
||||||
|
# Most users will never need to use this workflow. It will be used primary by
|
||||||
|
# ZFS admins for building and testing releases.
|
||||||
|
#
|
||||||
|
name: zfs-qemu-packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
test_type:
|
||||||
|
type: choice
|
||||||
|
required: false
|
||||||
|
default: "Build RPMs"
|
||||||
|
description: "Build RPMs or test the repo?"
|
||||||
|
options:
|
||||||
|
- "Build RPMs"
|
||||||
|
- "Test repo"
|
||||||
|
patch_level:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
description: "(optional) patch level number"
|
||||||
|
repo_url:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
description: "(optional) repo URL (blank: use http://download.zfsonlinux.org)"
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
zfs-qemu-packages-jobs:
|
||||||
|
name: qemu-VMs
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora41', 'fedora42']
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- name: Setup QEMU
|
||||||
|
timeout-minutes: 10
|
||||||
|
run: .github/workflows/scripts/qemu-1-setup.sh
|
||||||
|
|
||||||
|
- name: Start build machine
|
||||||
|
timeout-minutes: 10
|
||||||
|
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
timeout-minutes: 20
|
||||||
|
run: |
|
||||||
|
.github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }}
|
||||||
|
|
||||||
|
- name: Build modules or Test repo
|
||||||
|
timeout-minutes: 30
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
if [ "${{ github.event.inputs.test_type }}" == "Test repo" ] ; then
|
||||||
|
# Bring VM back up and copy over zfs source
|
||||||
|
.github/workflows/scripts/qemu-prepare-for-build.sh
|
||||||
|
|
||||||
|
mkdir -p /tmp/repo
|
||||||
|
ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-test-repo-vm.sh' ${{ github.event.inputs.repo_url }}
|
||||||
|
else
|
||||||
|
EXTRA=""
|
||||||
|
if [ -n "${{ github.event.inputs.patch_level }}" ] ; then
|
||||||
|
EXTRA="--patch-level ${{ github.event.inputs.patch_level }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
.github/workflows/scripts/qemu-4-build.sh $EXTRA \
|
||||||
|
--repo --release --dkms --tarball ${{ matrix.os }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Prepare artifacts
|
||||||
|
if: always()
|
||||||
|
timeout-minutes: 10
|
||||||
|
run: |
|
||||||
|
rsync -a zfs@vm0:/tmp/repo /tmp || true
|
||||||
|
.github/workflows/scripts/replace-dupes-with-symlinks.sh /tmp/repo
|
||||||
|
tar -cf ${{ matrix.os }}-repo.tar -C /tmp repo
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
id: artifact-upload
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }}-repo
|
||||||
|
path: ${{ matrix.os }}-repo.tar
|
||||||
|
compression-level: 0
|
||||||
|
retention-days: 2
|
||||||
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
combine_repos:
|
||||||
|
if: always()
|
||||||
|
needs: [zfs-qemu-packages-jobs]
|
||||||
|
name: "Results"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
id: artifact-download
|
||||||
|
if: always()
|
||||||
|
- name: Test Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
for i in $(find . -type f -iname "*.tar") ; do
|
||||||
|
tar -xf $i -C /tmp
|
||||||
|
done
|
||||||
|
tar -cf all-repo.tar -C /tmp repo
|
||||||
|
|
||||||
|
# If we're installing from a repo, print out the summary of the versions
|
||||||
|
# that got installed using Markdown.
|
||||||
|
if [ "${{ github.event.inputs.test_type }}" == "Test repo" ] ; then
|
||||||
|
cd /tmp/repo
|
||||||
|
for i in $(ls *.txt) ; do
|
||||||
|
nicename="$(echo $i | sed 's/.txt//g; s/-/ /g')"
|
||||||
|
echo "### $nicename" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "|repo|RPM|URL|" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY
|
||||||
|
awk '{print "|"$1"|"$2"|"$3"|"}' $i >> $GITHUB_STEP_SUMMARY
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
id: artifact-upload2
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: all-repo
|
||||||
|
path: all-repo.tar
|
||||||
|
compression-level: 0
|
||||||
|
retention-days: 5
|
||||||
|
if-no-files-found: ignore
|
67
.github/workflows/zfs-qemu.yml
vendored
67
.github/workflows/zfs-qemu.yml
vendored
@ -3,6 +3,13 @@ name: zfs-qemu
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
fedora_kernel_ver:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
description: "(optional) Experimental kernel version to install on Fedora (like '6.14' or '6.13.3-0.rc3')"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -22,8 +29,8 @@ 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", "centos-stream9", "debian11", "debian12", "fedora39", "fedora40", "freebsd13", "freebsd13r", "freebsd14", "freebsd14r", "ubuntu20", "ubuntu22", "ubuntu24"]'
|
FULL_OS='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian12", "debian13", "fedora41", "fedora42", "freebsd13-5r", "freebsd14-3s", "freebsd15-0c", "ubuntu22", "ubuntu24"]'
|
||||||
QUICK_OS='["almalinux8", "almalinux9", "debian12", "fedora40", "freebsd13", "freebsd14", "ubuntu24"]'
|
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"
|
ci_type="full"
|
||||||
if ${{ github.event_name == 'pull_request' }}; then
|
if ${{ github.event_name == 'pull_request' }}; then
|
||||||
@ -36,9 +43,18 @@ jobs:
|
|||||||
else
|
else
|
||||||
os_selection="$FULL_OS"
|
os_selection="$FULL_OS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
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"))]')
|
||||||
|
else
|
||||||
|
# Normal case
|
||||||
os_json=$(echo ${os_selection} | jq -c)
|
os_json=$(echo ${os_selection} | jq -c)
|
||||||
echo "os=$os_json" >> $GITHUB_OUTPUT
|
fi
|
||||||
echo "ci_type=$ci_type" >> $GITHUB_OUTPUT
|
|
||||||
|
echo "os=$os_json" | tee -a $GITHUB_OUTPUT
|
||||||
|
echo "ci_type=$ci_type" | tee -a $GITHUB_OUTPUT
|
||||||
|
|
||||||
qemu-vm:
|
qemu-vm:
|
||||||
name: qemu-x86
|
name: qemu-x86
|
||||||
@ -46,10 +62,13 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# all:
|
# rhl: almalinux8, almalinux9, centos-stream9, fedora4x
|
||||||
# os: [almalinux8, almalinux9, archlinux, centos-stream9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15, ubuntu20, ubuntu22, ubuntu24]
|
# debian: debian12, debian13, ubuntu22, ubuntu24
|
||||||
# openzfs:
|
# misc: archlinux, tumbleweed
|
||||||
# os: [almalinux8, almalinux9, centos-stream9, debian11, debian12, fedora39, fedora40, freebsd13, freebsd13r, freebsd14, freebsd14r, ubuntu20, ubuntu22, ubuntu24]
|
# FreeBSD variants of 2025-06:
|
||||||
|
# FreeBSD Release: freebsd13-5r, freebsd14-2r, freebsd14-3r
|
||||||
|
# FreeBSD Stable: freebsd13-5s, freebsd14-3s
|
||||||
|
# FreeBSD Current: freebsd15-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:
|
||||||
@ -58,8 +77,12 @@ jobs:
|
|||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
timeout-minutes: 10
|
timeout-minutes: 20
|
||||||
run: .github/workflows/scripts/qemu-1-setup.sh
|
run: |
|
||||||
|
# Add a timestamp to each line to debug timeouts
|
||||||
|
while IFS=$'\n' read -r line; do
|
||||||
|
echo "$(date +'%H:%M:%S') $line"
|
||||||
|
done < <(.github/workflows/scripts/qemu-1-setup.sh)
|
||||||
|
|
||||||
- name: Start build machine
|
- name: Start build machine
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@ -67,31 +90,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} ${{ github.event.inputs.fedora_kernel_ver }}
|
||||||
echo "Install dependencies in QEMU machine"
|
|
||||||
IP=192.168.122.10
|
|
||||||
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
|
||||||
ssh 2>/dev/null zfs@$IP "uname -a" && break
|
|
||||||
done
|
|
||||||
scp .github/workflows/scripts/qemu-3-deps.sh zfs@$IP:qemu-3-deps.sh
|
|
||||||
PID=`pidof /usr/bin/qemu-system-x86_64`
|
|
||||||
ssh zfs@$IP '$HOME/qemu-3-deps.sh' ${{ matrix.os }}
|
|
||||||
# wait for poweroff to succeed
|
|
||||||
tail --pid=$PID -f /dev/null
|
|
||||||
sleep 5 # avoid this: "error: Domain is already active"
|
|
||||||
rm -f $HOME/.ssh/known_hosts
|
|
||||||
|
|
||||||
- name: Build modules
|
- name: Build modules
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
run: |
|
run: .github/workflows/scripts/qemu-4-build.sh --poweroff --enable-debug ${{ matrix.os }}
|
||||||
echo "Build modules in QEMU machine"
|
|
||||||
sudo virsh start openzfs
|
|
||||||
IP=192.168.122.10
|
|
||||||
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
|
|
||||||
ssh 2>/dev/null zfs@$IP "uname -a" && break
|
|
||||||
done
|
|
||||||
rsync -ar $HOME/work/zfs/zfs zfs@$IP:./
|
|
||||||
ssh zfs@$IP '$HOME/zfs/.github/workflows/scripts/qemu-4-build.sh' ${{ matrix.os }}
|
|
||||||
|
|
||||||
- name: Setup testing machines
|
- name: Setup testing machines
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
26
.github/workflows/zloop.yml
vendored
26
.github/workflows/zloop.yml
vendored
@ -12,7 +12,8 @@ jobs:
|
|||||||
zloop:
|
zloop:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
env:
|
env:
|
||||||
TEST_DIR: /var/tmp/zloop
|
WORK_DIR: /mnt/zloop
|
||||||
|
CORE_DIR: /mnt/zloop/cores
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -20,7 +21,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get purge -y snapd google-chrome-stable firefox
|
sudo apt-get purge -y snapd google-chrome-stable firefox
|
||||||
ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps.sh ubuntu24
|
ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps-vm.sh ubuntu24
|
||||||
- name: Autogen.sh
|
- name: Autogen.sh
|
||||||
run: |
|
run: |
|
||||||
sed -i '/DEBUG_CFLAGS="-Werror"/s/^/#/' config/zfs-build.m4
|
sed -i '/DEBUG_CFLAGS="-Werror"/s/^/#/' config/zfs-build.m4
|
||||||
@ -40,38 +41,37 @@ jobs:
|
|||||||
sudo modprobe zfs
|
sudo modprobe zfs
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p $TEST_DIR
|
sudo truncate -s 256G /mnt/vdev
|
||||||
# run for 10 minutes or at most 6 iterations for a maximum runner
|
sudo zpool create cipool -m $WORK_DIR -O compression=on -o autotrim=on /mnt/vdev
|
||||||
# time of 60 minutes.
|
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -c $CORE_DIR -f $WORK_DIR -- -T 120 -P 60
|
||||||
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -- -T 120 -P 60
|
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
sudo chmod +r -R $TEST_DIR/
|
sudo chmod +r -R $WORK_DIR/
|
||||||
- name: Ztest log
|
- name: Ztest log
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
grep -B10 -A1000 'ASSERT' $TEST_DIR/*/ztest.out || tail -n 1000 $TEST_DIR/*/ztest.out
|
grep -B10 -A1000 'ASSERT' $CORE_DIR/*/ztest.out || tail -n 1000 $CORE_DIR/*/ztest.out
|
||||||
- name: Gdb log
|
- name: Gdb log
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
sed -n '/Backtraces (full)/q;p' $TEST_DIR/*/ztest.gdb
|
sed -n '/Backtraces (full)/q;p' $CORE_DIR/*/ztest.gdb
|
||||||
- name: Zdb log
|
- name: Zdb log
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
cat $TEST_DIR/*/ztest.zdb
|
cat $CORE_DIR/*/ztest.zdb
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Logs
|
name: Logs
|
||||||
path: |
|
path: |
|
||||||
/var/tmp/zloop/*/
|
/mnt/zloop/*/
|
||||||
!/var/tmp/zloop/*/vdev/
|
!/mnt/zloop/cores/*/vdev/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Pool files
|
name: Pool files
|
||||||
path: |
|
path: |
|
||||||
/var/tmp/zloop/*/vdev/
|
/mnt/zloop/cores/*/vdev/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
17
.mailmap
17
.mailmap
@ -23,6 +23,7 @@
|
|||||||
# These maps are making names consistent where they have varied but the email
|
# These maps are making names consistent where they have varied but the email
|
||||||
# address has never changed. In most cases, the full name is in the
|
# address has never changed. In most cases, the full name is in the
|
||||||
# Signed-off-by of a commit with a matching author.
|
# Signed-off-by of a commit with a matching author.
|
||||||
|
Achill Gilgenast <achill@achill.org>
|
||||||
Ahelenia Ziemiańska <nabijaczleweli@gmail.com>
|
Ahelenia Ziemiańska <nabijaczleweli@gmail.com>
|
||||||
Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
|
Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
|
||||||
Alex John <alex@stty.io>
|
Alex John <alex@stty.io>
|
||||||
@ -37,6 +38,7 @@ Crag Wang <crag0715@gmail.com>
|
|||||||
Damian Szuberski <szuberskidamian@gmail.com>
|
Damian Szuberski <szuberskidamian@gmail.com>
|
||||||
Daniel Kolesa <daniel@octaforge.org>
|
Daniel Kolesa <daniel@octaforge.org>
|
||||||
Debabrata Banerjee <dbavatar@gmail.com>
|
Debabrata Banerjee <dbavatar@gmail.com>
|
||||||
|
Diwakar Kristappagari <diwakar-k@hpe.com>
|
||||||
Finix Yan <yanchongwen@hotmail.com>
|
Finix Yan <yanchongwen@hotmail.com>
|
||||||
Gaurav Kumar <gauravk.18@gmail.com>
|
Gaurav Kumar <gauravk.18@gmail.com>
|
||||||
Gionatan Danti <g.danti@assyoma.it>
|
Gionatan Danti <g.danti@assyoma.it>
|
||||||
@ -70,6 +72,8 @@ Rob Norris <robn@despairlabs.com>
|
|||||||
Rob Norris <rob.norris@klarasystems.com>
|
Rob Norris <rob.norris@klarasystems.com>
|
||||||
Sam Lunt <samuel.j.lunt@gmail.com>
|
Sam Lunt <samuel.j.lunt@gmail.com>
|
||||||
Sanjeev Bagewadi <sanjeev.bagewadi@gmail.com>
|
Sanjeev Bagewadi <sanjeev.bagewadi@gmail.com>
|
||||||
|
Sebastian Wuerl <s.wuerl@mailbox.org>
|
||||||
|
SHENGYI HONG <aokblast@FreeBSD.org>
|
||||||
Stoiko Ivanov <github@nomore.at>
|
Stoiko Ivanov <github@nomore.at>
|
||||||
Tamas TEVESZ <ice@extreme.hu>
|
Tamas TEVESZ <ice@extreme.hu>
|
||||||
WHR <msl0000023508@gmail.com>
|
WHR <msl0000023508@gmail.com>
|
||||||
@ -77,8 +81,14 @@ Yanping Gao <yanping.gao@xtaotech.com>
|
|||||||
Youzhong Yang <youzhong@gmail.com>
|
Youzhong Yang <youzhong@gmail.com>
|
||||||
|
|
||||||
# Signed-off-by: overriding Author:
|
# Signed-off-by: overriding Author:
|
||||||
Ryan <errornointernet@envs.net> <error.nointernet@gmail.com>
|
Alexander Ziaee <ziaee@FreeBSD.org> <concussious@runbox.com>
|
||||||
|
Felix Schmidt <felixschmidt20@aol.com> <f.sch.prototype@gmail.com>
|
||||||
|
Olivier Certner <olce@FreeBSD.org> <olce.freebsd@certner.fr>
|
||||||
|
Phil Sutter <phil@nwl.cc> <p.github@nwl.cc>
|
||||||
|
poscat <poscat@poscat.moe> <poscat0x04@outlook.com>
|
||||||
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
||||||
|
Ryan <errornointernet@envs.net> <error.nointernet@gmail.com>
|
||||||
|
Sietse <sietse@wizdom.nu> <uglymotha@wizdom.nu>
|
||||||
Yuxin Wang <yuxinwang9999@gmail.com> <Bi11gates9999@gmail.com>
|
Yuxin Wang <yuxinwang9999@gmail.com> <Bi11gates9999@gmail.com>
|
||||||
Zhenlei Huang <zlei@FreeBSD.org> <zlei.huang@gmail.com>
|
Zhenlei Huang <zlei@FreeBSD.org> <zlei.huang@gmail.com>
|
||||||
|
|
||||||
@ -95,6 +105,7 @@ Tulsi Jain <tulsi.jain@delphix.com> <tulsi.jain@Tulsi-Jains-MacBook-Pro.local>
|
|||||||
# Mappings from Github no-reply addresses
|
# Mappings from Github no-reply addresses
|
||||||
ajs124 <git@ajs124.de> <ajs124@users.noreply.github.com>
|
ajs124 <git@ajs124.de> <ajs124@users.noreply.github.com>
|
||||||
Alek Pinchuk <apinchuk@axcient.com> <alek-p@users.noreply.github.com>
|
Alek Pinchuk <apinchuk@axcient.com> <alek-p@users.noreply.github.com>
|
||||||
|
Aleksandr Liber <aleksandr.liber@perforce.com> <61714074+AleksandrLiber@users.noreply.github.com>
|
||||||
Alexander Lobakin <alobakin@pm.me> <solbjorn@users.noreply.github.com>
|
Alexander Lobakin <alobakin@pm.me> <solbjorn@users.noreply.github.com>
|
||||||
Alexey Smirnoff <fling@member.fsf.org> <fling-@users.noreply.github.com>
|
Alexey Smirnoff <fling@member.fsf.org> <fling-@users.noreply.github.com>
|
||||||
Allen Holl <allen.m.holl@gmail.com> <65494904+allen-4@users.noreply.github.com>
|
Allen Holl <allen.m.holl@gmail.com> <65494904+allen-4@users.noreply.github.com>
|
||||||
@ -131,10 +142,12 @@ Fedor Uporov <fuporov.vstack@gmail.com> <60701163+fuporovvStack@users.noreply.gi
|
|||||||
Felix Dörre <felix@dogcraft.de> <felixdoerre@users.noreply.github.com>
|
Felix Dörre <felix@dogcraft.de> <felixdoerre@users.noreply.github.com>
|
||||||
Felix Neumärker <xdch47@posteo.de> <34678034+xdch47@users.noreply.github.com>
|
Felix Neumärker <xdch47@posteo.de> <34678034+xdch47@users.noreply.github.com>
|
||||||
Finix Yan <yancw@info2soft.com> <Finix1979@users.noreply.github.com>
|
Finix Yan <yancw@info2soft.com> <Finix1979@users.noreply.github.com>
|
||||||
|
Friedrich Weber <f.weber@proxmox.com> <56110206+frwbr@users.noreply.github.com>
|
||||||
Gaurav Kumar <gauravk.18@gmail.com> <gaurkuma@users.noreply.github.com>
|
Gaurav Kumar <gauravk.18@gmail.com> <gaurkuma@users.noreply.github.com>
|
||||||
George Gaydarov <git@gg7.io> <gg7@users.noreply.github.com>
|
George Gaydarov <git@gg7.io> <gg7@users.noreply.github.com>
|
||||||
Georgy Yakovlev <gyakovlev@gentoo.org> <168902+gyakovlev@users.noreply.github.com>
|
Georgy Yakovlev <gyakovlev@gentoo.org> <168902+gyakovlev@users.noreply.github.com>
|
||||||
Gerardwx <gerardw@alum.mit.edu> <Gerardwx@users.noreply.github.com>
|
Gerardwx <gerardw@alum.mit.edu> <Gerardwx@users.noreply.github.com>
|
||||||
|
Germano Massullo <germano.massullo@gmail.com> <Germano0@users.noreply.github.com>
|
||||||
Gian-Carlo DeFazio <defazio1@llnl.gov> <defaziogiancarlo@users.noreply.github.com>
|
Gian-Carlo DeFazio <defazio1@llnl.gov> <defaziogiancarlo@users.noreply.github.com>
|
||||||
Giuseppe Di Natale <dinatale2@llnl.gov> <dinatale2@users.noreply.github.com>
|
Giuseppe Di Natale <dinatale2@llnl.gov> <dinatale2@users.noreply.github.com>
|
||||||
Hajo Möller <dasjoe@gmail.com> <dasjoe@users.noreply.github.com>
|
Hajo Möller <dasjoe@gmail.com> <dasjoe@users.noreply.github.com>
|
||||||
@ -154,6 +167,7 @@ John Ramsden <johnramsden@riseup.net> <johnramsden@users.noreply.github.com>
|
|||||||
Jonathon Fernyhough <jonathon@m2x.dev> <559369+jonathonf@users.noreply.github.com>
|
Jonathon Fernyhough <jonathon@m2x.dev> <559369+jonathonf@users.noreply.github.com>
|
||||||
Jose Luis Duran <jlduran@gmail.com> <jlduran@users.noreply.github.com>
|
Jose Luis Duran <jlduran@gmail.com> <jlduran@users.noreply.github.com>
|
||||||
Justin Hibbits <chmeeedalf@gmail.com> <chmeeedalf@users.noreply.github.com>
|
Justin Hibbits <chmeeedalf@gmail.com> <chmeeedalf@users.noreply.github.com>
|
||||||
|
Kaitlin Hoang <kthoang@amazon.com> <khoang98@users.noreply.github.com>
|
||||||
Kevin Greene <kevin.greene@delphix.com> <104801862+kxgreene@users.noreply.github.com>
|
Kevin Greene <kevin.greene@delphix.com> <104801862+kxgreene@users.noreply.github.com>
|
||||||
Kevin Jin <lostking2008@hotmail.com> <33590050+jxdking@users.noreply.github.com>
|
Kevin Jin <lostking2008@hotmail.com> <33590050+jxdking@users.noreply.github.com>
|
||||||
Kevin P. Fleming <kevin@km6g.us> <kpfleming@users.noreply.github.com>
|
Kevin P. Fleming <kevin@km6g.us> <kpfleming@users.noreply.github.com>
|
||||||
@ -205,6 +219,7 @@ Torsten Wörtwein <twoertwein@gmail.com> <twoertwein@users.noreply.github.com>
|
|||||||
Tulsi Jain <tulsi.jain@delphix.com> <TulsiJain@users.noreply.github.com>
|
Tulsi Jain <tulsi.jain@delphix.com> <TulsiJain@users.noreply.github.com>
|
||||||
Václav Skála <skala@vshosting.cz> <33496485+vaclavskala@users.noreply.github.com>
|
Václav Skála <skala@vshosting.cz> <33496485+vaclavskala@users.noreply.github.com>
|
||||||
Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com> <88050553+vaibhav-delphix@users.noreply.github.com>
|
Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com> <88050553+vaibhav-delphix@users.noreply.github.com>
|
||||||
|
Vandana Rungta <vrungta@amazon.com> <46906819+vandanarungta@users.noreply.github.com>
|
||||||
Violet Purcell <vimproved@inventati.org> <66446404+vimproved@users.noreply.github.com>
|
Violet Purcell <vimproved@inventati.org> <66446404+vimproved@users.noreply.github.com>
|
||||||
Vipin Kumar Verma <vipin.verma@hpe.com> <75025470+vermavipinkumar@users.noreply.github.com>
|
Vipin Kumar Verma <vipin.verma@hpe.com> <75025470+vermavipinkumar@users.noreply.github.com>
|
||||||
Wolfgang Bumiller <w.bumiller@proxmox.com> <Blub@users.noreply.github.com>
|
Wolfgang Bumiller <w.bumiller@proxmox.com> <Blub@users.noreply.github.com>
|
||||||
|
41
AUTHORS
41
AUTHORS
@ -10,6 +10,7 @@ PAST MAINTAINERS:
|
|||||||
CONTRIBUTORS:
|
CONTRIBUTORS:
|
||||||
|
|
||||||
Aaron Fineman <abyxcos@gmail.com>
|
Aaron Fineman <abyxcos@gmail.com>
|
||||||
|
Achill Gilgenast <achill@achill.org>
|
||||||
Adam D. Moss <c@yotes.com>
|
Adam D. Moss <c@yotes.com>
|
||||||
Adam Leventhal <ahl@delphix.com>
|
Adam Leventhal <ahl@delphix.com>
|
||||||
Adam Stevko <adam.stevko@gmail.com>
|
Adam Stevko <adam.stevko@gmail.com>
|
||||||
@ -29,6 +30,7 @@ CONTRIBUTORS:
|
|||||||
Alejandro Colomar <Colomar.6.4.3@GMail.com>
|
Alejandro Colomar <Colomar.6.4.3@GMail.com>
|
||||||
Alejandro R. Sedeño <asedeno@mit.edu>
|
Alejandro R. Sedeño <asedeno@mit.edu>
|
||||||
Alek Pinchuk <alek@nexenta.com>
|
Alek Pinchuk <alek@nexenta.com>
|
||||||
|
Aleksandr Liber <aleksandr.liber@perforce.com>
|
||||||
Aleksa Sarai <cyphar@cyphar.com>
|
Aleksa Sarai <cyphar@cyphar.com>
|
||||||
Alexander Eremin <a.eremin@nexenta.com>
|
Alexander Eremin <a.eremin@nexenta.com>
|
||||||
Alexander Lobakin <alobakin@pm.me>
|
Alexander Lobakin <alobakin@pm.me>
|
||||||
@ -36,6 +38,7 @@ CONTRIBUTORS:
|
|||||||
Alexander Pyhalov <apyhalov@gmail.com>
|
Alexander Pyhalov <apyhalov@gmail.com>
|
||||||
Alexander Richardson <Alexander.Richardson@cl.cam.ac.uk>
|
Alexander Richardson <Alexander.Richardson@cl.cam.ac.uk>
|
||||||
Alexander Stetsenko <ams@nexenta.com>
|
Alexander Stetsenko <ams@nexenta.com>
|
||||||
|
Alexander Ziaee <ziaee@FreeBSD.org>
|
||||||
Alex Braunegg <alex.braunegg@gmail.com>
|
Alex Braunegg <alex.braunegg@gmail.com>
|
||||||
Alexey Shvetsov <alexxy@gentoo.org>
|
Alexey Shvetsov <alexxy@gentoo.org>
|
||||||
Alexey Smirnoff <fling@member.fsf.org>
|
Alexey Smirnoff <fling@member.fsf.org>
|
||||||
@ -57,6 +60,7 @@ CONTRIBUTORS:
|
|||||||
Andreas Buschmann <andreas.buschmann@tech.net.de>
|
Andreas Buschmann <andreas.buschmann@tech.net.de>
|
||||||
Andreas Dilger <adilger@intel.com>
|
Andreas Dilger <adilger@intel.com>
|
||||||
Andreas Vögele <andreas@andreasvoegele.com>
|
Andreas Vögele <andreas@andreasvoegele.com>
|
||||||
|
Andres <a-d-j-i@users.noreply.github.com>
|
||||||
Andrew Barnes <barnes333@gmail.com>
|
Andrew Barnes <barnes333@gmail.com>
|
||||||
Andrew Hamilton <ahamilto@tjhsst.edu>
|
Andrew Hamilton <ahamilto@tjhsst.edu>
|
||||||
Andrew Innes <andrew.c12@gmail.com>
|
Andrew Innes <andrew.c12@gmail.com>
|
||||||
@ -70,6 +74,7 @@ CONTRIBUTORS:
|
|||||||
Andrey Prokopenko <job@terem.fr>
|
Andrey Prokopenko <job@terem.fr>
|
||||||
Andrey Vesnovaty <andrey.vesnovaty@gmail.com>
|
Andrey Vesnovaty <andrey.vesnovaty@gmail.com>
|
||||||
Andriy Gapon <avg@freebsd.org>
|
Andriy Gapon <avg@freebsd.org>
|
||||||
|
Andriy Tkachuk <andriy.tkachuk@seagate.com>
|
||||||
Andy Bakun <github@thwartedefforts.org>
|
Andy Bakun <github@thwartedefforts.org>
|
||||||
Andy Fiddaman <omnios@citrus-it.co.uk>
|
Andy Fiddaman <omnios@citrus-it.co.uk>
|
||||||
Aniruddha Shankar <k@191a.net>
|
Aniruddha Shankar <k@191a.net>
|
||||||
@ -80,6 +85,7 @@ CONTRIBUTORS:
|
|||||||
Arne Jansen <arne@die-jansens.de>
|
Arne Jansen <arne@die-jansens.de>
|
||||||
Aron Xu <happyaron.xu@gmail.com>
|
Aron Xu <happyaron.xu@gmail.com>
|
||||||
Arshad Hussain <arshad.hussain@aeoncomputing.com>
|
Arshad Hussain <arshad.hussain@aeoncomputing.com>
|
||||||
|
Artem <artem.vlasenko@ossrevival.org>
|
||||||
Arun KV <arun.kv@datacore.com>
|
Arun KV <arun.kv@datacore.com>
|
||||||
Arvind Sankar <nivedita@alum.mit.edu>
|
Arvind Sankar <nivedita@alum.mit.edu>
|
||||||
Attila Fülöp <attila@fueloep.org>
|
Attila Fülöp <attila@fueloep.org>
|
||||||
@ -117,6 +123,7 @@ CONTRIBUTORS:
|
|||||||
Caleb James DeLisle <calebdelisle@lavabit.com>
|
Caleb James DeLisle <calebdelisle@lavabit.com>
|
||||||
Cameron Harr <harr1@llnl.gov>
|
Cameron Harr <harr1@llnl.gov>
|
||||||
Cao Xuewen <cao.xuewen@zte.com.cn>
|
Cao Xuewen <cao.xuewen@zte.com.cn>
|
||||||
|
Carl George <carlwgeorge@gmail.com>
|
||||||
Carlo Landmeter <clandmeter@gmail.com>
|
Carlo Landmeter <clandmeter@gmail.com>
|
||||||
Carlos Alberto Lopez Perez <clopez@igalia.com>
|
Carlos Alberto Lopez Perez <clopez@igalia.com>
|
||||||
Cedric Maunoury <cedric.maunoury@gmail.com>
|
Cedric Maunoury <cedric.maunoury@gmail.com>
|
||||||
@ -197,6 +204,7 @@ CONTRIBUTORS:
|
|||||||
Dimitri John Ledkov <xnox@ubuntu.com>
|
Dimitri John Ledkov <xnox@ubuntu.com>
|
||||||
Dimitry Andric <dimitry@andric.com>
|
Dimitry Andric <dimitry@andric.com>
|
||||||
Dirkjan Bussink <d.bussink@gmail.com>
|
Dirkjan Bussink <d.bussink@gmail.com>
|
||||||
|
Diwakar Kristappagari <diwakar-k@hpe.com>
|
||||||
Dmitry Khasanov <pik4ez@gmail.com>
|
Dmitry Khasanov <pik4ez@gmail.com>
|
||||||
Dominic Pearson <dsp@technoanimal.net>
|
Dominic Pearson <dsp@technoanimal.net>
|
||||||
Dominik Hassler <hadfl@omniosce.org>
|
Dominik Hassler <hadfl@omniosce.org>
|
||||||
@ -226,10 +234,12 @@ CONTRIBUTORS:
|
|||||||
Fedor Uporov <fuporov.vstack@gmail.com>
|
Fedor Uporov <fuporov.vstack@gmail.com>
|
||||||
Felix Dörre <felix@dogcraft.de>
|
Felix Dörre <felix@dogcraft.de>
|
||||||
Felix Neumärker <xdch47@posteo.de>
|
Felix Neumärker <xdch47@posteo.de>
|
||||||
|
Felix Schmidt <felixschmidt20@aol.com>
|
||||||
Feng Sun <loyou85@gmail.com>
|
Feng Sun <loyou85@gmail.com>
|
||||||
Finix Yan <yancw@info2soft.com>
|
Finix Yan <yancw@info2soft.com>
|
||||||
Francesco Mazzoli <f@mazzo.li>
|
Francesco Mazzoli <f@mazzo.li>
|
||||||
Frederik Wessels <wessels147@gmail.com>
|
Frederik Wessels <wessels147@gmail.com>
|
||||||
|
Friedrich Weber <f.weber@proxmox.com>
|
||||||
Frédéric Vanniere <f.vanniere@planet-work.com>
|
Frédéric Vanniere <f.vanniere@planet-work.com>
|
||||||
Gabriel A. Devenyi <gdevenyi@gmail.com>
|
Gabriel A. Devenyi <gdevenyi@gmail.com>
|
||||||
Garrett D'Amore <garrett@nexenta.com>
|
Garrett D'Amore <garrett@nexenta.com>
|
||||||
@ -245,6 +255,7 @@ CONTRIBUTORS:
|
|||||||
George Wilson <gwilson@delphix.com>
|
George Wilson <gwilson@delphix.com>
|
||||||
Georgy Yakovlev <ya@sysdump.net>
|
Georgy Yakovlev <ya@sysdump.net>
|
||||||
Gerardwx <gerardw@alum.mit.edu>
|
Gerardwx <gerardw@alum.mit.edu>
|
||||||
|
Germano Massullo <germano.massullo@gmail.com>
|
||||||
Gian-Carlo DeFazio <defazio1@llnl.gov>
|
Gian-Carlo DeFazio <defazio1@llnl.gov>
|
||||||
Gionatan Danti <g.danti@assyoma.it>
|
Gionatan Danti <g.danti@assyoma.it>
|
||||||
Giuseppe Di Natale <guss80@gmail.com>
|
Giuseppe Di Natale <guss80@gmail.com>
|
||||||
@ -282,12 +293,14 @@ CONTRIBUTORS:
|
|||||||
Igor K <igor@dilos.org>
|
Igor K <igor@dilos.org>
|
||||||
Igor Kozhukhov <ikozhukhov@gmail.com>
|
Igor Kozhukhov <ikozhukhov@gmail.com>
|
||||||
Igor Lvovsky <ilvovsky@gmail.com>
|
Igor Lvovsky <ilvovsky@gmail.com>
|
||||||
|
Igor Ostapenko <pm@igoro.pro>
|
||||||
ilbsmart <wgqimut@gmail.com>
|
ilbsmart <wgqimut@gmail.com>
|
||||||
Ilkka Sovanto <github@ilkka.kapsi.fi>
|
Ilkka Sovanto <github@ilkka.kapsi.fi>
|
||||||
illiliti <illiliti@protonmail.com>
|
illiliti <illiliti@protonmail.com>
|
||||||
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 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>
|
||||||
Jake Howard <git@theorangeone.net>
|
Jake Howard <git@theorangeone.net>
|
||||||
@ -295,6 +308,7 @@ CONTRIBUTORS:
|
|||||||
James H <james@kagisoft.co.uk>
|
James H <james@kagisoft.co.uk>
|
||||||
James Lee <jlee@thestaticvoid.com>
|
James Lee <jlee@thestaticvoid.com>
|
||||||
James Pan <jiaming.pan@yahoo.com>
|
James Pan <jiaming.pan@yahoo.com>
|
||||||
|
James Reilly <jreilly1821@gmail.com>
|
||||||
James Wah <james@laird-wah.net>
|
James Wah <james@laird-wah.net>
|
||||||
Jan Engelhardt <jengelh@inai.de>
|
Jan Engelhardt <jengelh@inai.de>
|
||||||
Jan Kryl <jan.kryl@nexenta.com>
|
Jan Kryl <jan.kryl@nexenta.com>
|
||||||
@ -306,6 +320,7 @@ CONTRIBUTORS:
|
|||||||
Jason Lee <jasonlee@lanl.gov>
|
Jason Lee <jasonlee@lanl.gov>
|
||||||
Jason Zaman <jasonzaman@gmail.com>
|
Jason Zaman <jasonzaman@gmail.com>
|
||||||
Javen Wu <wu.javen@gmail.com>
|
Javen Wu <wu.javen@gmail.com>
|
||||||
|
Jaydeep Kshirsagar <jkshirsagar@maxlinear.com>
|
||||||
Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
|
Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
|
||||||
Jeff Dike <jdike@akamai.com>
|
Jeff Dike <jdike@akamai.com>
|
||||||
Jeremy Faulkner <gldisater@gmail.com>
|
Jeremy Faulkner <gldisater@gmail.com>
|
||||||
@ -313,10 +328,12 @@ CONTRIBUTORS:
|
|||||||
Jeremy Jones <jeremy@delphix.com>
|
Jeremy Jones <jeremy@delphix.com>
|
||||||
Jeremy Visser <jeremy.visser@gmail.com>
|
Jeremy Visser <jeremy.visser@gmail.com>
|
||||||
Jerry Jelinek <jerry.jelinek@joyent.com>
|
Jerry Jelinek <jerry.jelinek@joyent.com>
|
||||||
|
Jerzy Kołosowski <jerzy@kolosowscy.pl>
|
||||||
Jessica Clarke <jrtc27@jrtc27.com>
|
Jessica Clarke <jrtc27@jrtc27.com>
|
||||||
Jinshan Xiong <jinshan.xiong@intel.com>
|
Jinshan Xiong <jinshan.xiong@intel.com>
|
||||||
Jitendra Patidar <jitendra.patidar@nutanix.com>
|
Jitendra Patidar <jitendra.patidar@nutanix.com>
|
||||||
JK Dingwall <james@dingwall.me.uk>
|
JK Dingwall <james@dingwall.me.uk>
|
||||||
|
Joel Low <joel@joelsplace.sg>
|
||||||
Joe Stein <joe.stein@delphix.com>
|
Joe Stein <joe.stein@delphix.com>
|
||||||
John-Mark Gurney <jmg@funkthat.com>
|
John-Mark Gurney <jmg@funkthat.com>
|
||||||
John Albietz <inthecloud247@gmail.com>
|
John Albietz <inthecloud247@gmail.com>
|
||||||
@ -365,6 +382,7 @@ CONTRIBUTORS:
|
|||||||
Kevin Jin <lostking2008@hotmail.com>
|
Kevin Jin <lostking2008@hotmail.com>
|
||||||
Kevin P. Fleming <kevin@km6g.us>
|
Kevin P. Fleming <kevin@km6g.us>
|
||||||
Kevin Tanguy <kevin.tanguy@ovh.net>
|
Kevin Tanguy <kevin.tanguy@ovh.net>
|
||||||
|
khoang98 <khoang98@users.noreply.github.com>
|
||||||
KireinaHoro <i@jsteward.moe>
|
KireinaHoro <i@jsteward.moe>
|
||||||
Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
|
Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
|
||||||
Kleber Tarcísio <klebertarcisio@yahoo.com.br>
|
Kleber Tarcísio <klebertarcisio@yahoo.com.br>
|
||||||
@ -372,6 +390,7 @@ CONTRIBUTORS:
|
|||||||
Kohsuke Kawaguchi <kk@kohsuke.org>
|
Kohsuke Kawaguchi <kk@kohsuke.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>
|
||||||
Kristof Provost <github@sigsegv.be>
|
Kristof Provost <github@sigsegv.be>
|
||||||
Krzysztof Piecuch <piecuch@kpiecuch.pl>
|
Krzysztof Piecuch <piecuch@kpiecuch.pl>
|
||||||
Kyle Blatter <kyleblatter@llnl.gov>
|
Kyle Blatter <kyleblatter@llnl.gov>
|
||||||
@ -423,6 +442,7 @@ CONTRIBUTORS:
|
|||||||
Mathieu Velten <matmaul@gmail.com>
|
Mathieu Velten <matmaul@gmail.com>
|
||||||
Matt Fiddaman <github@m.fiddaman.uk>
|
Matt Fiddaman <github@m.fiddaman.uk>
|
||||||
Matthew Ahrens <matt@delphix.com>
|
Matthew Ahrens <matt@delphix.com>
|
||||||
|
Matthew Heller <matthew.f.heller@gmail.com>
|
||||||
Matthew Thode <mthode@mthode.org>
|
Matthew Thode <mthode@mthode.org>
|
||||||
Matthias Blankertz <matthias@blankertz.org>
|
Matthias Blankertz <matthias@blankertz.org>
|
||||||
Matt Johnston <matt@fugro-fsi.com.au>
|
Matt Johnston <matt@fugro-fsi.com.au>
|
||||||
@ -436,6 +456,7 @@ CONTRIBUTORS:
|
|||||||
Max Zettlmeißl <max@zettlmeissl.de>
|
Max Zettlmeißl <max@zettlmeissl.de>
|
||||||
Md Islam <mdnahian@outlook.com>
|
Md Islam <mdnahian@outlook.com>
|
||||||
megari <megari@iki.fi>
|
megari <megari@iki.fi>
|
||||||
|
Meriel Luna Mittelbach <lunarlambda@gmail.com>
|
||||||
Michael D Labriola <michael.d.labriola@gmail.com>
|
Michael D Labriola <michael.d.labriola@gmail.com>
|
||||||
Michael Franzl <michael@franzl.name>
|
Michael Franzl <michael@franzl.name>
|
||||||
Michael Gebetsroither <michael@mgeb.org>
|
Michael Gebetsroither <michael@mgeb.org>
|
||||||
@ -451,6 +472,7 @@ CONTRIBUTORS:
|
|||||||
Mike Swanson <mikeonthecomputer@gmail.com>
|
Mike Swanson <mikeonthecomputer@gmail.com>
|
||||||
Milan Jurik <milan.jurik@xylab.cz>
|
Milan Jurik <milan.jurik@xylab.cz>
|
||||||
Minsoo Choo <minsoochoo0122@proton.me>
|
Minsoo Choo <minsoochoo0122@proton.me>
|
||||||
|
mnrx <mnrx@users.noreply.github.com>
|
||||||
Mohamed Tawfik <m_tawfik@aucegypt.edu>
|
Mohamed Tawfik <m_tawfik@aucegypt.edu>
|
||||||
Morgan Jones <mjones@rice.edu>
|
Morgan Jones <mjones@rice.edu>
|
||||||
Moritz Maxeiner <moritz@ucworks.org>
|
Moritz Maxeiner <moritz@ucworks.org>
|
||||||
@ -476,12 +498,13 @@ CONTRIBUTORS:
|
|||||||
Olaf Faaland <faaland1@llnl.gov>
|
Olaf Faaland <faaland1@llnl.gov>
|
||||||
Oleg Drokin <green@linuxhacker.ru>
|
Oleg Drokin <green@linuxhacker.ru>
|
||||||
Oleg Stepura <oleg@stepura.com>
|
Oleg Stepura <oleg@stepura.com>
|
||||||
Olivier Certner <olce.freebsd@certner.fr>
|
Olivier Certner <olce@FreeBSD.org>
|
||||||
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
||||||
omni <omni+vagant@hack.org>
|
omni <omni+vagant@hack.org>
|
||||||
Orivej Desh <orivej@gmx.fr>
|
Orivej Desh <orivej@gmx.fr>
|
||||||
Pablo Correa Gómez <ablocorrea@hotmail.com>
|
Pablo Correa Gómez <ablocorrea@hotmail.com>
|
||||||
Palash Gandhi <pbg4930@rit.edu>
|
Palash Gandhi <pbg4930@rit.edu>
|
||||||
|
Patrick Fasano <patrick@patrickfasano.com>
|
||||||
Patrick Mooney <pmooney@pfmooney.com>
|
Patrick Mooney <pmooney@pfmooney.com>
|
||||||
Patrik Greco <sikevux@sikevux.se>
|
Patrik Greco <sikevux@sikevux.se>
|
||||||
Paul B. Henson <henson@acm.org>
|
Paul B. Henson <henson@acm.org>
|
||||||
@ -493,6 +516,7 @@ CONTRIBUTORS:
|
|||||||
Pawel Jakub Dawidek <pjd@FreeBSD.org>
|
Pawel Jakub Dawidek <pjd@FreeBSD.org>
|
||||||
Pedro Giffuni <pfg@freebsd.org>
|
Pedro Giffuni <pfg@freebsd.org>
|
||||||
Peng <peng.hse@xtaotech.com>
|
Peng <peng.hse@xtaotech.com>
|
||||||
|
Peng Liu <littlenewton6@gmail.com>
|
||||||
Peter Ashford <ashford@accs.com>
|
Peter Ashford <ashford@accs.com>
|
||||||
Peter Dave Hello <hsu@peterdavehello.org>
|
Peter Dave Hello <hsu@peterdavehello.org>
|
||||||
Peter Doherty <peterd@acranox.org>
|
Peter Doherty <peterd@acranox.org>
|
||||||
@ -502,15 +526,18 @@ CONTRIBUTORS:
|
|||||||
Philip Pokorny <ppokorny@penguincomputing.com>
|
Philip Pokorny <ppokorny@penguincomputing.com>
|
||||||
Philipp Riederer <pt@philipptoelke.de>
|
Philipp Riederer <pt@philipptoelke.de>
|
||||||
Phil Kauffman <philip@kauffman.me>
|
Phil Kauffman <philip@kauffman.me>
|
||||||
|
Phil Sutter <phil@nwl.cc>
|
||||||
Ping Huang <huangping@smartx.com>
|
Ping Huang <huangping@smartx.com>
|
||||||
Piotr Kubaj <pkubaj@anongoth.pl>
|
Piotr Kubaj <pkubaj@anongoth.pl>
|
||||||
Piotr P. Stefaniak <pstef@freebsd.org>
|
Piotr P. Stefaniak <pstef@freebsd.org>
|
||||||
|
poscat <poscat@poscat.moe>
|
||||||
Prakash Surya <prakash.surya@delphix.com>
|
Prakash Surya <prakash.surya@delphix.com>
|
||||||
Prasad Joshi <prasadjoshi124@gmail.com>
|
Prasad Joshi <prasadjoshi124@gmail.com>
|
||||||
privb0x23 <privb0x23@users.noreply.github.com>
|
privb0x23 <privb0x23@users.noreply.github.com>
|
||||||
P.SCH <p88@yahoo.com>
|
P.SCH <p88@yahoo.com>
|
||||||
Qiuhao Chen <chenqiuhao1997@gmail.com>
|
Qiuhao Chen <chenqiuhao1997@gmail.com>
|
||||||
Quartz <yyhran@163.com>
|
Quartz <yyhran@163.com>
|
||||||
|
Quentin Thébault <quentin.thebault@defenso.fr>
|
||||||
Quentin Zdanis <zdanisq@gmail.com>
|
Quentin Zdanis <zdanisq@gmail.com>
|
||||||
Rafael Kitover <rkitover@gmail.com>
|
Rafael Kitover <rkitover@gmail.com>
|
||||||
RageLtMan <sempervictus@users.noreply.github.com>
|
RageLtMan <sempervictus@users.noreply.github.com>
|
||||||
@ -519,6 +546,7 @@ CONTRIBUTORS:
|
|||||||
Remy Blank <remy.blank@pobox.com>
|
Remy Blank <remy.blank@pobox.com>
|
||||||
renelson <bnelson@nelsonbe.com>
|
renelson <bnelson@nelsonbe.com>
|
||||||
Reno Reckling <e-github@wthack.de>
|
Reno Reckling <e-github@wthack.de>
|
||||||
|
René Wirnata <rene.wirnata@pandascience.net>
|
||||||
Ricardo M. Correia <ricardo.correia@oracle.com>
|
Ricardo M. Correia <ricardo.correia@oracle.com>
|
||||||
Riccardo Schirone <rschirone91@gmail.com>
|
Riccardo Schirone <rschirone91@gmail.com>
|
||||||
Richard Allen <belperite@gmail.com>
|
Richard Allen <belperite@gmail.com>
|
||||||
@ -562,6 +590,8 @@ CONTRIBUTORS:
|
|||||||
Scot W. Stevenson <scot.stevenson@gmail.com>
|
Scot W. Stevenson <scot.stevenson@gmail.com>
|
||||||
Sean Eric Fagan <sef@ixsystems.com>
|
Sean Eric Fagan <sef@ixsystems.com>
|
||||||
Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||||
|
Sebastian Pauka <me@spauka.se>
|
||||||
|
Sebastian Wuerl <s.wuerl@mailbox.org>
|
||||||
Sebastien Roy <seb@delphix.com>
|
Sebastien Roy <seb@delphix.com>
|
||||||
Sen Haerens <sen@senhaerens.be>
|
Sen Haerens <sen@senhaerens.be>
|
||||||
Serapheim Dimitropoulos <serapheim@delphix.com>
|
Serapheim Dimitropoulos <serapheim@delphix.com>
|
||||||
@ -573,8 +603,11 @@ CONTRIBUTORS:
|
|||||||
Shaun Tancheff <shaun@aeonazure.com>
|
Shaun Tancheff <shaun@aeonazure.com>
|
||||||
Shawn Bayern <sbayern@law.fsu.edu>
|
Shawn Bayern <sbayern@law.fsu.edu>
|
||||||
Shengqi Chen <harry-chen@outlook.com>
|
Shengqi Chen <harry-chen@outlook.com>
|
||||||
|
SHENGYI HONG <aokblast@FreeBSD.org>
|
||||||
Shen Yan <shenyanxxxy@qq.com>
|
Shen Yan <shenyanxxxy@qq.com>
|
||||||
|
Sietse <sietse@wizdom.nu>
|
||||||
Simon Guest <simon.guest@tesujimath.org>
|
Simon Guest <simon.guest@tesujimath.org>
|
||||||
|
Simon Howard <fraggle@soulsphere.org>
|
||||||
Simon Klinkert <simon.klinkert@gmail.com>
|
Simon Klinkert <simon.klinkert@gmail.com>
|
||||||
Sowrabha Gopal <sowrabha.gopal@delphix.com>
|
Sowrabha Gopal <sowrabha.gopal@delphix.com>
|
||||||
Spencer Kinny <spencerkinny1995@gmail.com>
|
Spencer Kinny <spencerkinny1995@gmail.com>
|
||||||
@ -596,6 +629,7 @@ CONTRIBUTORS:
|
|||||||
Stéphane Lesimple <speed47_github@speed47.net>
|
Stéphane Lesimple <speed47_github@speed47.net>
|
||||||
Suman Chakravartula <schakrava@gmail.com>
|
Suman Chakravartula <schakrava@gmail.com>
|
||||||
Sydney Vanda <sydney.m.vanda@intel.com>
|
Sydney Vanda <sydney.m.vanda@intel.com>
|
||||||
|
Syed Shahrukh Hussain <syed.shahrukh@ossrevival.org>
|
||||||
Sören Tempel <soeren+git@soeren-tempel.net>
|
Sören Tempel <soeren+git@soeren-tempel.net>
|
||||||
Tamas TEVESZ <ice@extreme.hu>
|
Tamas TEVESZ <ice@extreme.hu>
|
||||||
Teodor Spæren <teodor_spaeren@riseup.net>
|
Teodor Spæren <teodor_spaeren@riseup.net>
|
||||||
@ -613,9 +647,12 @@ CONTRIBUTORS:
|
|||||||
timor <timor.dd@googlemail.com>
|
timor <timor.dd@googlemail.com>
|
||||||
Timothy Day <tday141@gmail.com>
|
Timothy Day <tday141@gmail.com>
|
||||||
Tim Schumacher <timschumi@gmx.de>
|
Tim Schumacher <timschumi@gmx.de>
|
||||||
|
Tim Smith <tim@mondoo.com>
|
||||||
Tino Reichardt <milky-zfs@mcmilk.de>
|
Tino Reichardt <milky-zfs@mcmilk.de>
|
||||||
|
tleydxdy <shironeko.github@tesaguri.club>
|
||||||
Tobin Harding <me@tobin.cc>
|
Tobin Harding <me@tobin.cc>
|
||||||
Todd Seidelmann <seidelma@users.noreply.github.com>
|
Todd Seidelmann <seidelma@users.noreply.github.com>
|
||||||
|
Todd Zullinger <tmz@pobox.com>
|
||||||
Tom Caputi <tcaputi@datto.com>
|
Tom Caputi <tcaputi@datto.com>
|
||||||
Tom Matthews <tom@axiom-partners.com>
|
Tom Matthews <tom@axiom-partners.com>
|
||||||
Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
|
Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
|
||||||
@ -629,6 +666,7 @@ CONTRIBUTORS:
|
|||||||
Trevor Bautista <trevrb@trevrb.net>
|
Trevor Bautista <trevrb@trevrb.net>
|
||||||
Trey Dockendorf <treydock@gmail.com>
|
Trey Dockendorf <treydock@gmail.com>
|
||||||
Troels Nørgaard <tnn@tradeshift.com>
|
Troels Nørgaard <tnn@tradeshift.com>
|
||||||
|
tstabrawa <tstabrawa@users.noreply.github.com>
|
||||||
Tulsi Jain <tulsi.jain@delphix.com>
|
Tulsi Jain <tulsi.jain@delphix.com>
|
||||||
Turbo Fredriksson <turbo@bayour.com>
|
Turbo Fredriksson <turbo@bayour.com>
|
||||||
Tyler J. Stachecki <stachecki.tyler@gmail.com>
|
Tyler J. Stachecki <stachecki.tyler@gmail.com>
|
||||||
@ -636,6 +674,7 @@ CONTRIBUTORS:
|
|||||||
Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com>
|
Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com>
|
||||||
Valmiky Arquissandas <kayvlim@gmail.com>
|
Valmiky Arquissandas <kayvlim@gmail.com>
|
||||||
Val Packett <val@packett.cool>
|
Val Packett <val@packett.cool>
|
||||||
|
Vandana Rungta <vrungta@amazon.com>
|
||||||
Vince van Oosten <techhazard@codeforyouand.me>
|
Vince van Oosten <techhazard@codeforyouand.me>
|
||||||
Violet Purcell <vimproved@inventati.org>
|
Violet Purcell <vimproved@inventati.org>
|
||||||
Vipin Kumar Verma <vipin.verma@hpe.com>
|
Vipin Kumar Verma <vipin.verma@hpe.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.3.0
|
Version: 2.4.99
|
||||||
Release: rc1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 6.11
|
Linux-Maximum: 6.17
|
||||||
Linux-Minimum: 4.18
|
Linux-Minimum: 4.18
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
CLEANFILES =
|
CLEANFILES =
|
||||||
dist_noinst_DATA =
|
dist_noinst_DATA =
|
||||||
INSTALL_DATA_HOOKS =
|
INSTALL_DATA_HOOKS =
|
||||||
|
INSTALL_EXEC_HOOKS =
|
||||||
ALL_LOCAL =
|
ALL_LOCAL =
|
||||||
CLEAN_LOCAL =
|
CLEAN_LOCAL =
|
||||||
CHECKS = shellcheck checkbashisms
|
CHECKS = shellcheck checkbashisms
|
||||||
@ -71,6 +72,9 @@ all: gitrev
|
|||||||
PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
|
PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
|
||||||
install-data-hook: $(INSTALL_DATA_HOOKS)
|
install-data-hook: $(INSTALL_DATA_HOOKS)
|
||||||
|
|
||||||
|
PHONY += install-exec-hook $(INSTALL_EXEC_HOOKS)
|
||||||
|
install-exec-hook: $(INSTALL_EXEC_HOOKS)
|
||||||
|
|
||||||
PHONY += maintainer-clean-local
|
PHONY += maintainer-clean-local
|
||||||
maintainer-clean-local:
|
maintainer-clean-local:
|
||||||
-$(RM) $(GITREV)
|
-$(RM) $(GITREV)
|
||||||
@ -112,6 +116,10 @@ commitcheck:
|
|||||||
${top_srcdir}/scripts/commitcheck.sh; \
|
${top_srcdir}/scripts/commitcheck.sh; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
CHECKS += spdxcheck
|
||||||
|
spdxcheck:
|
||||||
|
$(AM_V_at)$(top_srcdir)/scripts/spdxcheck.pl
|
||||||
|
|
||||||
if HAVE_PARALLEL
|
if HAVE_PARALLEL
|
||||||
cstyle_line = -print0 | parallel -X0 ${top_srcdir}/scripts/cstyle.pl -cpP {}
|
cstyle_line = -print0 | parallel -X0 ${top_srcdir}/scripts/cstyle.pl -cpP {}
|
||||||
else
|
else
|
||||||
|
@ -28,7 +28,7 @@ Two release branches are maintained for OpenZFS, they are:
|
|||||||
Minor changes to support these distribution kernels will be applied as
|
Minor changes to support these distribution kernels will be applied as
|
||||||
needed. New kernel versions released after the OpenZFS LTS release are
|
needed. New kernel versions released after the OpenZFS LTS release are
|
||||||
not supported. LTS releases will receive patches for at least 2 years.
|
not supported. LTS releases will receive patches for at least 2 years.
|
||||||
The current LTS release is OpenZFS 2.1.
|
The current LTS release is OpenZFS 2.2.
|
||||||
|
|
||||||
* OpenZFS current - Tracks the newest MAJOR.MINOR release. This branch
|
* OpenZFS current - Tracks the newest MAJOR.MINOR release. This branch
|
||||||
includes support for the latest OpenZFS features and recently releases
|
includes support for the latest OpenZFS features and recently releases
|
||||||
|
@ -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)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env @PYTHON_SHEBANG@
|
#!/usr/bin/env @PYTHON_SHEBANG@
|
||||||
|
# SPDX-License-Identifier: CDDL-1.0
|
||||||
#
|
#
|
||||||
# Print out statistics for all cached dmu buffers. This information
|
# Print out statistics for all cached dmu buffers. This information
|
||||||
# is available through the dbufs kstat and may be post-processed as
|
# is available through the dbufs kstat and may be post-processed as
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env @PYTHON_SHEBANG@
|
#!/usr/bin/env @PYTHON_SHEBANG@
|
||||||
|
# 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
|
||||||
@ -55,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
|
||||||
|
|
||||||
@ -170,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"],
|
||||||
@ -186,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"],
|
||||||
@ -197,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"],
|
||||||
@ -260,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 = {}
|
||||||
@ -347,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)
|
||||||
@ -365,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"]
|
||||||
@ -734,13 +736,14 @@ def calculate():
|
|||||||
v[group["percent"]] if v[group["percent"]] > 0 else 0
|
v[group["percent"]] if v[group["percent"]] > 0 else 0
|
||||||
|
|
||||||
if l2exist:
|
if l2exist:
|
||||||
|
l2asize = cur["l2_asize"]
|
||||||
v["l2hits"] = d["l2_hits"] / sint
|
v["l2hits"] = d["l2_hits"] / sint
|
||||||
v["l2miss"] = d["l2_misses"] / sint
|
v["l2miss"] = d["l2_misses"] / sint
|
||||||
v["l2read"] = v["l2hits"] + v["l2miss"]
|
v["l2read"] = v["l2hits"] + v["l2miss"]
|
||||||
v["l2hit%"] = 100 * v["l2hits"] / v["l2read"] if v["l2read"] > 0 else 0
|
v["l2hit%"] = 100 * v["l2hits"] / v["l2read"] if v["l2read"] > 0 else 0
|
||||||
|
|
||||||
v["l2miss%"] = 100 - v["l2hit%"] if v["l2read"] > 0 else 0
|
v["l2miss%"] = 100 - v["l2hit%"] if v["l2read"] > 0 else 0
|
||||||
v["l2asize"] = cur["l2_asize"]
|
v["l2asize"] = l2asize
|
||||||
v["l2size"] = cur["l2_size"]
|
v["l2size"] = cur["l2_size"]
|
||||||
v["l2bytes"] = d["l2_read_bytes"] / sint
|
v["l2bytes"] = d["l2_read_bytes"] / sint
|
||||||
v["l2wbytes"] = d["l2_write_bytes"] / sint
|
v["l2wbytes"] = d["l2_write_bytes"] / sint
|
||||||
@ -750,11 +753,11 @@ def calculate():
|
|||||||
v["l2mru"] = cur["l2_mru_asize"]
|
v["l2mru"] = cur["l2_mru_asize"]
|
||||||
v["l2data"] = cur["l2_bufc_data_asize"]
|
v["l2data"] = cur["l2_bufc_data_asize"]
|
||||||
v["l2meta"] = cur["l2_bufc_metadata_asize"]
|
v["l2meta"] = cur["l2_bufc_metadata_asize"]
|
||||||
v["l2pref%"] = 100 * v["l2pref"] / v["l2asize"]
|
v["l2pref%"] = 100 * v["l2pref"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2mfu%"] = 100 * v["l2mfu"] / v["l2asize"]
|
v["l2mfu%"] = 100 * v["l2mfu"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2mru%"] = 100 * v["l2mru"] / v["l2asize"]
|
v["l2mru%"] = 100 * v["l2mru"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2data%"] = 100 * v["l2data"] / v["l2asize"]
|
v["l2data%"] = 100 * v["l2data"] / l2asize if l2asize > 0 else 0
|
||||||
v["l2meta%"] = 100 * v["l2meta"] / v["l2asize"]
|
v["l2meta%"] = 100 * v["l2meta"] / l2asize if l2asize > 0 else 0
|
||||||
|
|
||||||
v["grow"] = 0 if cur["arc_no_grow"] else 1
|
v["grow"] = 0 if cur["arc_no_grow"] else 1
|
||||||
v["need"] = cur["arc_need_free"]
|
v["need"] = cur["arc_need_free"]
|
||||||
@ -764,6 +767,7 @@ def calculate():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
global sint
|
global sint
|
||||||
global count
|
global count
|
||||||
global hdr_intr
|
global hdr_intr
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 Ben Rockwood <benr@cuddletech.com>,
|
# Copyright (c) 2008 Ben Rockwood <benr@cuddletech.com>,
|
||||||
# Copyright (c) 2010 Martin Matuska <mm@FreeBSD.org>,
|
# Copyright (c) 2010 Martin Matuska <mm@FreeBSD.org>,
|
||||||
@ -33,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
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -160,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:
|
||||||
@ -438,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)
|
||||||
@ -558,6 +559,7 @@ def section_arc(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
compressed_size = arc_stats['compressed_size']
|
compressed_size = arc_stats['compressed_size']
|
||||||
|
uncompressed_size = arc_stats['uncompressed_size']
|
||||||
overhead_size = arc_stats['overhead_size']
|
overhead_size = arc_stats['overhead_size']
|
||||||
bonus_size = arc_stats['bonus_size']
|
bonus_size = arc_stats['bonus_size']
|
||||||
dnode_size = arc_stats['dnode_size']
|
dnode_size = arc_stats['dnode_size']
|
||||||
@ -662,10 +664,7 @@ def section_arc(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
print('ARC hash breakdown:')
|
print('ARC hash breakdown:')
|
||||||
prt_i1('Elements max:', f_hits(arc_stats['hash_elements_max']))
|
prt_i1('Elements:', f_hits(arc_stats['hash_elements']))
|
||||||
prt_i2('Elements current:',
|
|
||||||
f_perc(arc_stats['hash_elements'], arc_stats['hash_elements_max']),
|
|
||||||
f_hits(arc_stats['hash_elements']))
|
|
||||||
prt_i1('Collisions:', f_hits(arc_stats['hash_collisions']))
|
prt_i1('Collisions:', f_hits(arc_stats['hash_collisions']))
|
||||||
|
|
||||||
prt_i1('Chain max:', f_hits(arc_stats['hash_chain_max']))
|
prt_i1('Chain max:', f_hits(arc_stats['hash_chain_max']))
|
||||||
@ -673,6 +672,8 @@ def section_arc(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
print('ARC misc:')
|
print('ARC misc:')
|
||||||
|
prt_i2('Uncompressed size:', f_perc(uncompressed_size, compressed_size),
|
||||||
|
f_bytes(uncompressed_size))
|
||||||
prt_i1('Memory throttles:', arc_stats['memory_throttle_count'])
|
prt_i1('Memory throttles:', arc_stats['memory_throttle_count'])
|
||||||
prt_i1('Memory direct reclaims:', arc_stats['memory_direct_count'])
|
prt_i1('Memory direct reclaims:', arc_stats['memory_direct_count'])
|
||||||
prt_i1('Memory indirect reclaims:', arc_stats['memory_indirect_count'])
|
prt_i1('Memory indirect reclaims:', arc_stats['memory_indirect_count'])
|
586
cmd/zdb/zdb.c
586
cmd/zdb/zdb.c
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -28,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 */
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -47,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
|
||||||
@ -67,19 +66,19 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
const lr_create_t *lrc = arg;
|
const lr_create_t *lrc = arg;
|
||||||
const _lr_create_t *lr = &lrc->lr_create;
|
const _lr_create_t *lr = &lrc->lr_create;
|
||||||
time_t crtime = lr->lr_crtime[0];
|
time_t crtime = lr->lr_crtime[0];
|
||||||
char *name, *link;
|
const char *name, *link;
|
||||||
lr_attr_t *lrattr;
|
lr_attr_t *lrattr;
|
||||||
|
|
||||||
name = (char *)(lr + 1);
|
name = (const char *)&lrc->lr_data[0];
|
||||||
|
|
||||||
if (lr->lr_common.lrc_txtype == TX_CREATE_ATTR ||
|
if (lr->lr_common.lrc_txtype == TX_CREATE_ATTR ||
|
||||||
lr->lr_common.lrc_txtype == TX_MKDIR_ATTR) {
|
lr->lr_common.lrc_txtype == TX_MKDIR_ATTR) {
|
||||||
lrattr = (lr_attr_t *)(lr + 1);
|
lrattr = (lr_attr_t *)&lrc->lr_data[0];
|
||||||
name += ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
|
name += ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txtype == TX_SYMLINK) {
|
if (txtype == TX_SYMLINK) {
|
||||||
link = name + strlen(name) + 1;
|
link = (const char *)&lrc->lr_data[strlen(name) + 1];
|
||||||
(void) printf("%s%s -> %s\n", tab_prefix, name, link);
|
(void) printf("%s%s -> %s\n", tab_prefix, name, link);
|
||||||
} else if (txtype != TX_MKXATTR) {
|
} else if (txtype != TX_MKXATTR) {
|
||||||
(void) printf("%s%s\n", tab_prefix, name);
|
(void) printf("%s%s\n", tab_prefix, name);
|
||||||
@ -104,7 +103,7 @@ zil_prt_rec_remove(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
const lr_remove_t *lr = arg;
|
const lr_remove_t *lr = arg;
|
||||||
|
|
||||||
(void) printf("%sdoid %llu, name %s\n", tab_prefix,
|
(void) printf("%sdoid %llu, name %s\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_doid, (char *)(lr + 1));
|
(u_longlong_t)lr->lr_doid, (const char *)&lr->lr_data[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -115,7 +114,7 @@ zil_prt_rec_link(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
|
|
||||||
(void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix,
|
(void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
|
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
|
||||||
(char *)(lr + 1));
|
(const char *)&lr->lr_data[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -124,8 +123,8 @@ zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
(void) zilog, (void) txtype;
|
(void) zilog, (void) txtype;
|
||||||
const lr_rename_t *lrr = arg;
|
const lr_rename_t *lrr = arg;
|
||||||
const _lr_rename_t *lr = &lrr->lr_rename;
|
const _lr_rename_t *lr = &lrr->lr_rename;
|
||||||
char *snm = (char *)(lr + 1);
|
const char *snm = (const char *)&lrr->lr_data[0];
|
||||||
char *tnm = snm + strlen(snm) + 1;
|
const char *tnm = (const char *)&lrr->lr_data[strlen(snm) + 1];
|
||||||
|
|
||||||
(void) printf("%ssdoid %llu, tdoid %llu\n", tab_prefix,
|
(void) printf("%ssdoid %llu, tdoid %llu\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_sdoid, (u_longlong_t)lr->lr_tdoid);
|
(u_longlong_t)lr->lr_sdoid, (u_longlong_t)lr->lr_tdoid);
|
||||||
@ -175,7 +174,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
|
|
||||||
if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
|
if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
|
||||||
(void) printf("%shas blkptr, %s\n", tab_prefix,
|
(void) printf("%shas blkptr, %s\n", tab_prefix,
|
||||||
!BP_IS_HOLE(bp) && BP_GET_LOGICAL_BIRTH(bp) >=
|
!BP_IS_HOLE(bp) && BP_GET_BIRTH(bp) >=
|
||||||
spa_min_claim_txg(zilog->zl_spa) ?
|
spa_min_claim_txg(zilog->zl_spa) ?
|
||||||
"will claim" : "won't claim");
|
"will claim" : "won't claim");
|
||||||
print_log_bp(bp, tab_prefix);
|
print_log_bp(bp, tab_prefix);
|
||||||
@ -188,7 +187,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
(void) printf("%s<hole>\n", tab_prefix);
|
(void) printf("%s<hole>\n", tab_prefix);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (BP_GET_LOGICAL_BIRTH(bp) < zilog->zl_header->zh_claim_txg) {
|
if (BP_GET_BIRTH(bp) < zilog->zl_header->zh_claim_txg) {
|
||||||
(void) printf("%s<block already committed>\n",
|
(void) printf("%s<block already committed>\n",
|
||||||
tab_prefix);
|
tab_prefix);
|
||||||
return;
|
return;
|
||||||
@ -211,7 +210,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
|
|
||||||
/* data is stored after the end of the lr_write record */
|
/* data is stored after the end of the lr_write record */
|
||||||
data = abd_alloc(lr->lr_length, B_FALSE);
|
data = abd_alloc(lr->lr_length, B_FALSE);
|
||||||
abd_copy_from_buf(data, lr + 1, lr->lr_length);
|
abd_copy_from_buf(data, &lr->lr_data[0], lr->lr_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) printf("%s", tab_prefix);
|
(void) printf("%s", tab_prefix);
|
||||||
@ -239,7 +238,7 @@ zil_prt_rec_write_enc(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
|
|
||||||
if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
|
if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
|
||||||
(void) printf("%shas blkptr, %s\n", tab_prefix,
|
(void) printf("%shas blkptr, %s\n", tab_prefix,
|
||||||
!BP_IS_HOLE(bp) && BP_GET_LOGICAL_BIRTH(bp) >=
|
!BP_IS_HOLE(bp) && BP_GET_BIRTH(bp) >=
|
||||||
spa_min_claim_txg(zilog->zl_spa) ?
|
spa_min_claim_txg(zilog->zl_spa) ?
|
||||||
"will claim" : "won't claim");
|
"will claim" : "won't claim");
|
||||||
print_log_bp(bp, tab_prefix);
|
print_log_bp(bp, tab_prefix);
|
||||||
@ -309,7 +308,7 @@ zil_prt_rec_setsaxattr(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
(void) zilog, (void) txtype;
|
(void) zilog, (void) txtype;
|
||||||
const lr_setsaxattr_t *lr = arg;
|
const lr_setsaxattr_t *lr = arg;
|
||||||
|
|
||||||
char *name = (char *)(lr + 1);
|
const char *name = (const char *)&lr->lr_data[0];
|
||||||
(void) printf("%sfoid %llu\n", tab_prefix,
|
(void) printf("%sfoid %llu\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_foid);
|
(u_longlong_t)lr->lr_foid);
|
||||||
|
|
||||||
@ -318,7 +317,7 @@ zil_prt_rec_setsaxattr(zilog_t *zilog, int txtype, const void *arg)
|
|||||||
(void) printf("%sXAT_VALUE NULL\n", tab_prefix);
|
(void) printf("%sXAT_VALUE NULL\n", tab_prefix);
|
||||||
} else {
|
} else {
|
||||||
(void) printf("%sXAT_VALUE ", tab_prefix);
|
(void) printf("%sXAT_VALUE ", tab_prefix);
|
||||||
char *val = name + (strlen(name) + 1);
|
const char *val = (const char *)&lr->lr_data[strlen(name) + 1];
|
||||||
for (int i = 0; i < lr->lr_size; i++) {
|
for (int i = 0; i < lr->lr_size; i++) {
|
||||||
(void) printf("%c", *val);
|
(void) printf("%c", *val);
|
||||||
val++;
|
val++;
|
||||||
@ -475,7 +474,7 @@ print_log_block(zilog_t *zilog, const blkptr_t *bp, void *arg,
|
|||||||
|
|
||||||
if (claim_txg != 0)
|
if (claim_txg != 0)
|
||||||
claim = "already claimed";
|
claim = "already claimed";
|
||||||
else if (BP_GET_LOGICAL_BIRTH(bp) >= spa_min_claim_txg(zilog->zl_spa))
|
else if (BP_GET_BIRTH(bp) >= spa_min_claim_txg(zilog->zl_spa))
|
||||||
claim = "will claim";
|
claim = "will claim";
|
||||||
else
|
else
|
||||||
claim = "won't claim";
|
claim = "won't claim";
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -133,11 +134,13 @@ zfs_agent_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *arg)
|
|||||||
* of blkid cache and L2ARC VDEV does not contain pool guid in its
|
* of blkid cache and L2ARC VDEV does not contain pool guid in its
|
||||||
* blkid, so this is a special case for L2ARC VDEV.
|
* blkid, so this is a special case for L2ARC VDEV.
|
||||||
*/
|
*/
|
||||||
else if (gsp->gs_vdev_guid != 0 && gsp->gs_devid == NULL &&
|
else if (gsp->gs_vdev_guid != 0 &&
|
||||||
nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID, &vdev_guid) == 0 &&
|
nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID, &vdev_guid) == 0 &&
|
||||||
gsp->gs_vdev_guid == vdev_guid) {
|
gsp->gs_vdev_guid == vdev_guid) {
|
||||||
|
if (gsp->gs_devid == NULL) {
|
||||||
(void) nvlist_lookup_string(nvl, ZPOOL_CONFIG_DEVID,
|
(void) nvlist_lookup_string(nvl, ZPOOL_CONFIG_DEVID,
|
||||||
&gsp->gs_devid);
|
&gsp->gs_devid);
|
||||||
|
}
|
||||||
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_EXPANSION_TIME,
|
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_EXPANSION_TIME,
|
||||||
&gsp->gs_vdev_expandtime);
|
&gsp->gs_vdev_expandtime);
|
||||||
return (B_TRUE);
|
return (B_TRUE);
|
||||||
@ -155,22 +158,28 @@ zfs_agent_iter_pool(zpool_handle_t *zhp, void *arg)
|
|||||||
/*
|
/*
|
||||||
* For each vdev in this pool, look for a match by devid
|
* For each vdev in this pool, look for a match by devid
|
||||||
*/
|
*/
|
||||||
if ((config = zpool_get_config(zhp, NULL)) != NULL) {
|
boolean_t found = B_FALSE;
|
||||||
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
uint64_t pool_guid;
|
||||||
&nvl) == 0) {
|
|
||||||
(void) zfs_agent_iter_vdev(zhp, nvl, gsp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* if a match was found then grab the pool guid
|
|
||||||
*/
|
|
||||||
if (gsp->gs_vdev_guid && gsp->gs_devid) {
|
|
||||||
(void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
|
|
||||||
&gsp->gs_pool_guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Get pool configuration and extract pool GUID */
|
||||||
|
if ((config = zpool_get_config(zhp, NULL)) == NULL ||
|
||||||
|
nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
|
||||||
|
&pool_guid) != 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
/* Skip this pool if we're looking for a specific pool */
|
||||||
|
if (gsp->gs_pool_guid != 0 && pool_guid != gsp->gs_pool_guid)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nvl) == 0)
|
||||||
|
found = zfs_agent_iter_vdev(zhp, nvl, gsp);
|
||||||
|
|
||||||
|
if (found && gsp->gs_pool_guid == 0)
|
||||||
|
gsp->gs_pool_guid = pool_guid;
|
||||||
|
|
||||||
|
out:
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
return (gsp->gs_devid != NULL && gsp->gs_vdev_guid != 0);
|
return (found);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -232,11 +241,9 @@ zfs_agent_post_event(const char *class, const char *subclass, nvlist_t *nvl)
|
|||||||
* For multipath, spare and l2arc devices ZFS_EV_VDEV_GUID or
|
* For multipath, spare and l2arc devices ZFS_EV_VDEV_GUID or
|
||||||
* ZFS_EV_POOL_GUID may be missing so find them.
|
* ZFS_EV_POOL_GUID may be missing so find them.
|
||||||
*/
|
*/
|
||||||
if (devid == NULL || pool_guid == 0 || vdev_guid == 0) {
|
|
||||||
if (devid == NULL)
|
|
||||||
search.gs_vdev_guid = vdev_guid;
|
|
||||||
else
|
|
||||||
search.gs_devid = devid;
|
search.gs_devid = devid;
|
||||||
|
search.gs_vdev_guid = vdev_guid;
|
||||||
|
search.gs_pool_guid = pool_guid;
|
||||||
zpool_iter(g_zfs_hdl, zfs_agent_iter_pool, &search);
|
zpool_iter(g_zfs_hdl, zfs_agent_iter_pool, &search);
|
||||||
if (devid == NULL)
|
if (devid == NULL)
|
||||||
devid = search.gs_devid;
|
devid = search.gs_devid;
|
||||||
@ -245,7 +252,6 @@ zfs_agent_post_event(const char *class, const char *subclass, nvlist_t *nvl)
|
|||||||
if (vdev_guid == 0)
|
if (vdev_guid == 0)
|
||||||
vdev_guid = search.gs_vdev_guid;
|
vdev_guid = search.gs_vdev_guid;
|
||||||
devtype = search.gs_vdev_type;
|
devtype = search.gs_vdev_type;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We want to avoid reporting "remove" events coming from
|
* We want to avoid reporting "remove" events coming from
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -214,6 +215,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
|
|||||||
vdev_stat_t *vs;
|
vdev_stat_t *vs;
|
||||||
char **lines = NULL;
|
char **lines = NULL;
|
||||||
int lines_cnt = 0;
|
int lines_cnt = 0;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the persistent path, typically under the '/dev/disk/by-id' or
|
* Get the persistent path, typically under the '/dev/disk/by-id' or
|
||||||
@ -405,17 +407,17 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nvlist_lookup_string(vdev, "new_devid", &new_devid);
|
nvlist_lookup_string(vdev, "new_devid", &new_devid);
|
||||||
|
|
||||||
if (is_mpath_wholedisk) {
|
if (is_mpath_wholedisk) {
|
||||||
/* Don't label device mapper or multipath disks. */
|
/* Don't label device mapper or multipath disks. */
|
||||||
zed_log_msg(LOG_INFO,
|
zed_log_msg(LOG_INFO,
|
||||||
" it's a multipath wholedisk, don't label");
|
" it's a multipath wholedisk, don't label");
|
||||||
if (zpool_prepare_disk(zhp, vdev, "autoreplace", &lines,
|
rc = zpool_prepare_disk(zhp, vdev, "autoreplace", &lines,
|
||||||
&lines_cnt) != 0) {
|
&lines_cnt);
|
||||||
|
if (rc != 0) {
|
||||||
zed_log_msg(LOG_INFO,
|
zed_log_msg(LOG_INFO,
|
||||||
" zpool_prepare_disk: could not "
|
" zpool_prepare_disk: could not "
|
||||||
"prepare '%s' (%s)", fullpath,
|
"prepare '%s' (%s), path '%s', rc = %d", fullpath,
|
||||||
libzfs_error_description(g_zfshdl));
|
libzfs_error_description(g_zfshdl), path, rc);
|
||||||
if (lines_cnt > 0) {
|
if (lines_cnt > 0) {
|
||||||
zed_log_msg(LOG_INFO,
|
zed_log_msg(LOG_INFO,
|
||||||
" zfs_prepare_disk output:");
|
" zfs_prepare_disk output:");
|
||||||
@ -446,12 +448,13 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
|
|||||||
* If this is a request to label a whole disk, then attempt to
|
* If this is a request to label a whole disk, then attempt to
|
||||||
* write out the label.
|
* write out the label.
|
||||||
*/
|
*/
|
||||||
if (zpool_prepare_and_label_disk(g_zfshdl, zhp, leafname,
|
rc = zpool_prepare_and_label_disk(g_zfshdl, zhp, leafname,
|
||||||
vdev, "autoreplace", &lines, &lines_cnt) != 0) {
|
vdev, "autoreplace", &lines, &lines_cnt);
|
||||||
|
if (rc != 0) {
|
||||||
zed_log_msg(LOG_WARNING,
|
zed_log_msg(LOG_WARNING,
|
||||||
" zpool_prepare_and_label_disk: could not "
|
" zpool_prepare_and_label_disk: could not "
|
||||||
"label '%s' (%s)", leafname,
|
"label '%s' (%s), rc = %d", leafname,
|
||||||
libzfs_error_description(g_zfshdl));
|
libzfs_error_description(g_zfshdl), rc);
|
||||||
if (lines_cnt > 0) {
|
if (lines_cnt > 0) {
|
||||||
zed_log_msg(LOG_INFO,
|
zed_log_msg(LOG_INFO,
|
||||||
" zfs_prepare_disk output:");
|
" zfs_prepare_disk output:");
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -403,6 +404,7 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
|
|||||||
(state == VDEV_STATE_REMOVED || state == VDEV_STATE_FAULTED))) {
|
(state == VDEV_STATE_REMOVED || state == VDEV_STATE_FAULTED))) {
|
||||||
const char *devtype;
|
const char *devtype;
|
||||||
char *devname;
|
char *devname;
|
||||||
|
boolean_t skip_removal = B_FALSE;
|
||||||
|
|
||||||
if (nvlist_lookup_string(nvl, FM_EREPORT_PAYLOAD_ZFS_VDEV_TYPE,
|
if (nvlist_lookup_string(nvl, FM_EREPORT_PAYLOAD_ZFS_VDEV_TYPE,
|
||||||
&devtype) == 0) {
|
&devtype) == 0) {
|
||||||
@ -440,18 +442,28 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
|
|||||||
nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS,
|
nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS,
|
||||||
(uint64_t **)&vs, &c);
|
(uint64_t **)&vs, &c);
|
||||||
|
|
||||||
|
if (vs->vs_state == VDEV_STATE_OFFLINE)
|
||||||
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If state removed is requested for already removed vdev,
|
* If state removed is requested for already removed vdev,
|
||||||
* its a loopback event from spa_async_remove(). Just
|
* its a loopback event from spa_async_remove(). Just
|
||||||
* ignore it.
|
* ignore it.
|
||||||
*/
|
*/
|
||||||
if (vs->vs_state == VDEV_STATE_REMOVED &&
|
if ((vs->vs_state == VDEV_STATE_REMOVED &&
|
||||||
state == VDEV_STATE_REMOVED)
|
state == VDEV_STATE_REMOVED)) {
|
||||||
|
if (strcmp(class, "resource.fs.zfs.removed") == 0 &&
|
||||||
|
nvlist_exists(nvl, "by_kernel")) {
|
||||||
|
skip_removal = B_TRUE;
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove the vdev since device is unplugged */
|
/* Remove the vdev since device is unplugged */
|
||||||
int remove_status = 0;
|
int remove_status = 0;
|
||||||
if (l2arc || (strcmp(class, "resource.fs.zfs.removed") == 0)) {
|
if (!skip_removal && (l2arc ||
|
||||||
|
(strcmp(class, "resource.fs.zfs.removed") == 0))) {
|
||||||
remove_status = zpool_vdev_remove_wanted(zhp, devname);
|
remove_status = zpool_vdev_remove_wanted(zhp, devname);
|
||||||
fmd_hdl_debug(hdl, "zpool_vdev_remove_wanted '%s'"
|
fmd_hdl_debug(hdl, "zpool_vdev_remove_wanted '%s'"
|
||||||
", err:%d", devname, libzfs_errno(zhdl));
|
", err:%d", devname, libzfs_errno(zhdl));
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -9,18 +9,18 @@ dist_zedexec_SCRIPTS = \
|
|||||||
%D%/all-debug.sh \
|
%D%/all-debug.sh \
|
||||||
%D%/all-syslog.sh \
|
%D%/all-syslog.sh \
|
||||||
%D%/data-notify.sh \
|
%D%/data-notify.sh \
|
||||||
%D%/deadman-slot_off.sh \
|
%D%/deadman-sync-slot_off.sh \
|
||||||
%D%/generic-notify.sh \
|
%D%/generic-notify.sh \
|
||||||
%D%/pool_import-led.sh \
|
%D%/pool_import-sync-led.sh \
|
||||||
%D%/resilver_finish-notify.sh \
|
%D%/resilver_finish-notify.sh \
|
||||||
%D%/resilver_finish-start-scrub.sh \
|
%D%/resilver_finish-start-scrub.sh \
|
||||||
%D%/scrub_finish-notify.sh \
|
%D%/scrub_finish-notify.sh \
|
||||||
%D%/statechange-led.sh \
|
%D%/statechange-sync-led.sh \
|
||||||
%D%/statechange-notify.sh \
|
%D%/statechange-notify.sh \
|
||||||
%D%/statechange-slot_off.sh \
|
%D%/statechange-sync-slot_off.sh \
|
||||||
%D%/trim_finish-notify.sh \
|
%D%/trim_finish-notify.sh \
|
||||||
%D%/vdev_attach-led.sh \
|
%D%/vdev_attach-sync-led.sh \
|
||||||
%D%/vdev_clear-led.sh
|
%D%/vdev_clear-sync-led.sh
|
||||||
|
|
||||||
nodist_zedexec_SCRIPTS = \
|
nodist_zedexec_SCRIPTS = \
|
||||||
%D%/history_event-zfs-list-cacher.sh
|
%D%/history_event-zfs-list-cacher.sh
|
||||||
@ -30,17 +30,17 @@ SUBSTFILES += $(nodist_zedexec_SCRIPTS)
|
|||||||
zedconfdefaults = \
|
zedconfdefaults = \
|
||||||
all-syslog.sh \
|
all-syslog.sh \
|
||||||
data-notify.sh \
|
data-notify.sh \
|
||||||
deadman-slot_off.sh \
|
deadman-sync-slot_off.sh \
|
||||||
history_event-zfs-list-cacher.sh \
|
history_event-zfs-list-cacher.sh \
|
||||||
pool_import-led.sh \
|
pool_import-sync-led.sh \
|
||||||
resilver_finish-notify.sh \
|
resilver_finish-notify.sh \
|
||||||
resilver_finish-start-scrub.sh \
|
resilver_finish-start-scrub.sh \
|
||||||
scrub_finish-notify.sh \
|
scrub_finish-notify.sh \
|
||||||
statechange-led.sh \
|
statechange-sync-led.sh \
|
||||||
statechange-notify.sh \
|
statechange-notify.sh \
|
||||||
statechange-slot_off.sh \
|
statechange-sync-slot_off.sh \
|
||||||
vdev_attach-led.sh \
|
vdev_attach-sync-led.sh \
|
||||||
vdev_clear-led.sh
|
vdev_clear-sync-led.sh
|
||||||
|
|
||||||
dist_noinst_DATA += %D%/README
|
dist_noinst_DATA += %D%/README
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
statechange-led.sh
|
|
1
cmd/zed/zed.d/pool_import-sync-led.sh
Symbolic link
1
cmd/zed/zed.d/pool_import-sync-led.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
statechange-sync-led.sh
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# SPDX-License-Identifier: CDDL-1.0
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
#
|
#
|
||||||
# CDDL HEADER START
|
# CDDL HEADER START
|
||||||
|
@ -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
|
@ -283,6 +283,11 @@ zed_notify_email()
|
|||||||
if [ "${ZED_EMAIL_OPTS%@SUBJECT@*}" = "${ZED_EMAIL_OPTS}" ] ; then
|
if [ "${ZED_EMAIL_OPTS%@SUBJECT@*}" = "${ZED_EMAIL_OPTS}" ] ; then
|
||||||
# inject subject header
|
# inject subject header
|
||||||
printf "Subject: %s\n" "${subject}"
|
printf "Subject: %s\n" "${subject}"
|
||||||
|
# The following empty line is needed to separate the header from the
|
||||||
|
# body of the message. Otherwise programs like sendmail will skip
|
||||||
|
# everything up to the first empty line (or wont send an email at
|
||||||
|
# all) and will still exit with exit code 0
|
||||||
|
printf "\n"
|
||||||
fi
|
fi
|
||||||
# output message
|
# output message
|
||||||
cat "${pathname}"
|
cat "${pathname}"
|
||||||
@ -436,8 +441,9 @@ zed_notify_slack_webhook()
|
|||||||
"${pathname}")"
|
"${pathname}")"
|
||||||
|
|
||||||
# Construct the JSON message for posting.
|
# Construct the JSON message for posting.
|
||||||
|
# shellcheck disable=SC2016
|
||||||
#
|
#
|
||||||
msg_json="$(printf '{"text": "*%s*\\n%s"}' "${subject}" "${msg_body}" )"
|
msg_json="$(printf '{"text": "*%s*\\n```%s```"}' "${subject}" "${msg_body}" )"
|
||||||
|
|
||||||
# Send the POST request and check for errors.
|
# Send the POST request and check for errors.
|
||||||
#
|
#
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -139,7 +140,8 @@ dev_event_nvlist(struct udev_device *dev)
|
|||||||
* is /dev/sda.
|
* is /dev/sda.
|
||||||
*/
|
*/
|
||||||
struct udev_device *parent_dev = udev_device_get_parent(dev);
|
struct udev_device *parent_dev = udev_device_get_parent(dev);
|
||||||
if ((value = udev_device_get_sysattr_value(parent_dev, "size"))
|
if (parent_dev != NULL &&
|
||||||
|
(value = udev_device_get_sysattr_value(parent_dev, "size"))
|
||||||
!= NULL) {
|
!= NULL) {
|
||||||
uint64_t numval = DEV_BSIZE;
|
uint64_t numval = DEV_BSIZE;
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
@ -109,7 +110,7 @@ zed_event_fini(struct zed_conf *zcp)
|
|||||||
static void
|
static void
|
||||||
_bump_event_queue_length(void)
|
_bump_event_queue_length(void)
|
||||||
{
|
{
|
||||||
int zzlm = -1, wr;
|
int zzlm, wr;
|
||||||
char qlen_buf[12] = {0}; /* parameter is int => max "-2147483647\n" */
|
char qlen_buf[12] = {0}; /* parameter is int => max "-2147483647\n" */
|
||||||
long int qlen, orig_qlen;
|
long int qlen, orig_qlen;
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
@ -195,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)) {
|
||||||
|
if (do_pause)
|
||||||
pause();
|
pause();
|
||||||
else if (errno != EINTR)
|
} 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;
|
||||||
@ -277,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,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.
|
||||||
@ -367,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);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED).
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -36,6 +37,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/debug.h>
|
#include <sys/debug.h>
|
||||||
|
#include <dirent.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
@ -120,6 +122,7 @@ static int zfs_do_change_key(int argc, char **argv);
|
|||||||
static int zfs_do_project(int argc, char **argv);
|
static int zfs_do_project(int argc, char **argv);
|
||||||
static int zfs_do_version(int argc, char **argv);
|
static int zfs_do_version(int argc, char **argv);
|
||||||
static int zfs_do_redact(int argc, char **argv);
|
static int zfs_do_redact(int argc, char **argv);
|
||||||
|
static int zfs_do_rewrite(int argc, char **argv);
|
||||||
static int zfs_do_wait(int argc, char **argv);
|
static int zfs_do_wait(int argc, char **argv);
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
@ -192,6 +195,7 @@ typedef enum {
|
|||||||
HELP_CHANGE_KEY,
|
HELP_CHANGE_KEY,
|
||||||
HELP_VERSION,
|
HELP_VERSION,
|
||||||
HELP_REDACT,
|
HELP_REDACT,
|
||||||
|
HELP_REWRITE,
|
||||||
HELP_JAIL,
|
HELP_JAIL,
|
||||||
HELP_UNJAIL,
|
HELP_UNJAIL,
|
||||||
HELP_WAIT,
|
HELP_WAIT,
|
||||||
@ -226,7 +230,7 @@ static zfs_command_t command_table[] = {
|
|||||||
{ "promote", zfs_do_promote, HELP_PROMOTE },
|
{ "promote", zfs_do_promote, HELP_PROMOTE },
|
||||||
{ "rename", zfs_do_rename, HELP_RENAME },
|
{ "rename", zfs_do_rename, HELP_RENAME },
|
||||||
{ "bookmark", zfs_do_bookmark, HELP_BOOKMARK },
|
{ "bookmark", zfs_do_bookmark, HELP_BOOKMARK },
|
||||||
{ "program", zfs_do_channel_program, HELP_CHANNEL_PROGRAM },
|
{ "diff", zfs_do_diff, HELP_DIFF },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
{ "list", zfs_do_list, HELP_LIST },
|
{ "list", zfs_do_list, HELP_LIST },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
@ -248,27 +252,31 @@ static zfs_command_t command_table[] = {
|
|||||||
{ NULL },
|
{ NULL },
|
||||||
{ "send", zfs_do_send, HELP_SEND },
|
{ "send", zfs_do_send, HELP_SEND },
|
||||||
{ "receive", zfs_do_receive, HELP_RECEIVE },
|
{ "receive", zfs_do_receive, HELP_RECEIVE },
|
||||||
|
{ "redact", zfs_do_redact, HELP_REDACT },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
{ "allow", zfs_do_allow, HELP_ALLOW },
|
{ "allow", zfs_do_allow, HELP_ALLOW },
|
||||||
{ NULL },
|
|
||||||
{ "unallow", zfs_do_unallow, HELP_UNALLOW },
|
{ "unallow", zfs_do_unallow, HELP_UNALLOW },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
{ "hold", zfs_do_hold, HELP_HOLD },
|
{ "hold", zfs_do_hold, HELP_HOLD },
|
||||||
{ "holds", zfs_do_holds, HELP_HOLDS },
|
{ "holds", zfs_do_holds, HELP_HOLDS },
|
||||||
{ "release", zfs_do_release, HELP_RELEASE },
|
{ "release", zfs_do_release, HELP_RELEASE },
|
||||||
{ "diff", zfs_do_diff, HELP_DIFF },
|
{ NULL },
|
||||||
{ "load-key", zfs_do_load_key, HELP_LOAD_KEY },
|
{ "load-key", zfs_do_load_key, HELP_LOAD_KEY },
|
||||||
{ "unload-key", zfs_do_unload_key, HELP_UNLOAD_KEY },
|
{ "unload-key", zfs_do_unload_key, HELP_UNLOAD_KEY },
|
||||||
{ "change-key", zfs_do_change_key, HELP_CHANGE_KEY },
|
{ "change-key", zfs_do_change_key, HELP_CHANGE_KEY },
|
||||||
{ "redact", zfs_do_redact, HELP_REDACT },
|
{ NULL },
|
||||||
|
{ "program", zfs_do_channel_program, HELP_CHANNEL_PROGRAM },
|
||||||
|
{ "rewrite", zfs_do_rewrite, HELP_REWRITE },
|
||||||
{ "wait", zfs_do_wait, HELP_WAIT },
|
{ "wait", zfs_do_wait, HELP_WAIT },
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
|
{ NULL },
|
||||||
{ "jail", zfs_do_jail, HELP_JAIL },
|
{ "jail", zfs_do_jail, HELP_JAIL },
|
||||||
{ "unjail", zfs_do_unjail, HELP_UNJAIL },
|
{ "unjail", zfs_do_unjail, HELP_UNJAIL },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
{ NULL },
|
||||||
{ "zone", zfs_do_zone, HELP_ZONE },
|
{ "zone", zfs_do_zone, HELP_ZONE },
|
||||||
{ "unzone", zfs_do_unzone, HELP_UNZONE },
|
{ "unzone", zfs_do_unzone, HELP_UNZONE },
|
||||||
#endif
|
#endif
|
||||||
@ -431,6 +439,9 @@ get_usage(zfs_help_t idx)
|
|||||||
case HELP_REDACT:
|
case HELP_REDACT:
|
||||||
return (gettext("\tredact <snapshot> <bookmark> "
|
return (gettext("\tredact <snapshot> <bookmark> "
|
||||||
"<redaction_snapshot> ...\n"));
|
"<redaction_snapshot> ...\n"));
|
||||||
|
case HELP_REWRITE:
|
||||||
|
return (gettext("\trewrite [-Prvx] [-o <offset>] [-l <length>] "
|
||||||
|
"<directory|file ...>\n"));
|
||||||
case HELP_JAIL:
|
case HELP_JAIL:
|
||||||
return (gettext("\tjail <jailid|jailname> <filesystem>\n"));
|
return (gettext("\tjail <jailid|jailname> <filesystem>\n"));
|
||||||
case HELP_UNJAIL:
|
case HELP_UNJAIL:
|
||||||
@ -500,7 +511,7 @@ usage_prop_cb(int prop, void *cb)
|
|||||||
{
|
{
|
||||||
FILE *fp = cb;
|
FILE *fp = cb;
|
||||||
|
|
||||||
(void) fprintf(fp, "\t%-15s ", zfs_prop_to_name(prop));
|
(void) fprintf(fp, "\t%-22s ", zfs_prop_to_name(prop));
|
||||||
|
|
||||||
if (zfs_prop_readonly(prop))
|
if (zfs_prop_readonly(prop))
|
||||||
(void) fprintf(fp, " NO ");
|
(void) fprintf(fp, " NO ");
|
||||||
@ -561,40 +572,40 @@ usage(boolean_t requested)
|
|||||||
(void) fprintf(fp, "%s",
|
(void) fprintf(fp, "%s",
|
||||||
gettext("\nThe following properties are supported:\n"));
|
gettext("\nThe following properties are supported:\n"));
|
||||||
|
|
||||||
(void) fprintf(fp, "\n\t%-14s %s %s %s\n\n",
|
(void) fprintf(fp, "\n\t%-21s %s %s %s\n\n",
|
||||||
"PROPERTY", "EDIT", "INHERIT", "VALUES");
|
"PROPERTY", "EDIT", "INHERIT", "VALUES");
|
||||||
|
|
||||||
/* Iterate over all properties */
|
/* Iterate over all properties */
|
||||||
(void) zprop_iter(usage_prop_cb, fp, B_FALSE, B_TRUE,
|
(void) zprop_iter(usage_prop_cb, fp, B_FALSE, B_TRUE,
|
||||||
ZFS_TYPE_DATASET);
|
ZFS_TYPE_DATASET);
|
||||||
|
|
||||||
(void) fprintf(fp, "\t%-15s ", "userused@...");
|
(void) fprintf(fp, "\t%-22s ", "userused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupused@...");
|
(void) fprintf(fp, "\t%-22s ", "groupused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectused@...");
|
(void) fprintf(fp, "\t%-22s ", "projectused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "userobjused@...");
|
(void) fprintf(fp, "\t%-22s ", "userobjused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupobjused@...");
|
(void) fprintf(fp, "\t%-22s ", "groupobjused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectobjused@...");
|
(void) fprintf(fp, "\t%-22s ", "projectobjused@...");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "userquota@...");
|
(void) fprintf(fp, "\t%-22s ", "userquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupquota@...");
|
(void) fprintf(fp, "\t%-22s ", "groupquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectquota@...");
|
(void) fprintf(fp, "\t%-22s ", "projectquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "userobjquota@...");
|
(void) fprintf(fp, "\t%-22s ", "userobjquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "groupobjquota@...");
|
(void) fprintf(fp, "\t%-22s ", "groupobjquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "projectobjquota@...");
|
(void) fprintf(fp, "\t%-22s ", "projectobjquota@...");
|
||||||
(void) fprintf(fp, "YES NO <size> | none\n");
|
(void) fprintf(fp, "YES NO <size> | none\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "written@<snap>");
|
(void) fprintf(fp, "\t%-22s ", "written@<snap>");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
(void) fprintf(fp, "\t%-15s ", "written#<bookmark>");
|
(void) fprintf(fp, "\t%-22s ", "written#<bookmark>");
|
||||||
(void) fprintf(fp, " NO NO <size>\n");
|
(void) fprintf(fp, " NO NO <size>\n");
|
||||||
|
|
||||||
(void) fprintf(fp, gettext("\nSizes are specified in bytes "
|
(void) fprintf(fp, gettext("\nSizes are specified in bytes "
|
||||||
@ -912,26 +923,22 @@ zfs_do_clone(int argc, char **argv)
|
|||||||
return (!!ret);
|
return (!!ret);
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
ASSERT3P(zhp, ==, NULL);
|
ASSERT0P(zhp);
|
||||||
nvlist_free(props);
|
nvlist_free(props);
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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) {
|
||||||
@ -962,6 +969,24 @@ default_volblocksize(zpool_handle_t *zhp, nvlist_t *props)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return (asize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return a default volblocksize for the pool which always uses more than
|
||||||
|
* half of the data sectors. This primarily applies to dRAID which always
|
||||||
|
* writes full stripe widths.
|
||||||
|
*/
|
||||||
|
static uint64_t
|
||||||
|
default_volblocksize(zpool_handle_t *zhp, nvlist_t *props)
|
||||||
|
{
|
||||||
|
uint64_t volblocksize, asize = SPA_MINBLOCKSIZE;
|
||||||
|
|
||||||
|
nvlist_t *config = zpool_get_config(zhp, NULL);
|
||||||
|
|
||||||
|
if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_MAX_ALLOC, &asize) != 0)
|
||||||
|
asize = calculate_volblocksize(config);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate the target volblocksize such that more than half
|
* Calculate the target volblocksize such that more than half
|
||||||
* of the asize is used. The following table is for 4k sectors.
|
* of the asize is used. The following table is for 4k sectors.
|
||||||
@ -1963,9 +1988,8 @@ fill_dataset_info(nvlist_t *list, zfs_handle_t *zhp, boolean_t as_int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type == ZFS_TYPE_SNAPSHOT) {
|
if (type == ZFS_TYPE_SNAPSHOT) {
|
||||||
char *ds, *snap;
|
char *snap = strdup(zfs_get_name(zhp));
|
||||||
ds = snap = strdup(zfs_get_name(zhp));
|
char *ds = strsep(&snap, "@");
|
||||||
ds = strsep(&snap, "@");
|
|
||||||
fnvlist_add_string(list, "dataset", ds);
|
fnvlist_add_string(list, "dataset", ds);
|
||||||
fnvlist_add_string(list, "snapshot_name", snap);
|
fnvlist_add_string(list, "snapshot_name", snap);
|
||||||
free(ds);
|
free(ds);
|
||||||
@ -2008,8 +2032,7 @@ get_callback(zfs_handle_t *zhp, void *data)
|
|||||||
nvlist_t *user_props = zfs_get_user_props(zhp);
|
nvlist_t *user_props = zfs_get_user_props(zhp);
|
||||||
zprop_list_t *pl = cbp->cb_proplist;
|
zprop_list_t *pl = cbp->cb_proplist;
|
||||||
nvlist_t *propval;
|
nvlist_t *propval;
|
||||||
nvlist_t *item, *d, *props;
|
nvlist_t *item, *d = NULL, *props = NULL;
|
||||||
item = d = props = NULL;
|
|
||||||
const char *strval;
|
const char *strval;
|
||||||
const char *sourceval;
|
const char *sourceval;
|
||||||
boolean_t received = is_recvd_column(cbp);
|
boolean_t received = is_recvd_column(cbp);
|
||||||
@ -2162,6 +2185,7 @@ zfs_do_get(int argc, char **argv)
|
|||||||
cb.cb_type = ZFS_TYPE_DATASET;
|
cb.cb_type = ZFS_TYPE_DATASET;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
@ -2984,7 +3008,8 @@ us_type2str(unsigned field_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
|
userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space,
|
||||||
|
uint64_t default_quota)
|
||||||
{
|
{
|
||||||
us_cbdata_t *cb = (us_cbdata_t *)arg;
|
us_cbdata_t *cb = (us_cbdata_t *)arg;
|
||||||
zfs_userquota_prop_t prop = cb->cb_prop;
|
zfs_userquota_prop_t prop = cb->cb_prop;
|
||||||
@ -3140,7 +3165,7 @@ userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
|
|||||||
prop == ZFS_PROP_PROJECTUSED) {
|
prop == ZFS_PROP_PROJECTUSED) {
|
||||||
propname = "used";
|
propname = "used";
|
||||||
if (!nvlist_exists(props, "quota"))
|
if (!nvlist_exists(props, "quota"))
|
||||||
(void) nvlist_add_uint64(props, "quota", 0);
|
(void) nvlist_add_uint64(props, "quota", default_quota);
|
||||||
} else if (prop == ZFS_PROP_USERQUOTA || prop == ZFS_PROP_GROUPQUOTA ||
|
} else if (prop == ZFS_PROP_USERQUOTA || prop == ZFS_PROP_GROUPQUOTA ||
|
||||||
prop == ZFS_PROP_PROJECTQUOTA) {
|
prop == ZFS_PROP_PROJECTQUOTA) {
|
||||||
propname = "quota";
|
propname = "quota";
|
||||||
@ -3149,8 +3174,10 @@ userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
|
|||||||
} else if (prop == ZFS_PROP_USEROBJUSED ||
|
} else if (prop == ZFS_PROP_USEROBJUSED ||
|
||||||
prop == ZFS_PROP_GROUPOBJUSED || prop == ZFS_PROP_PROJECTOBJUSED) {
|
prop == ZFS_PROP_GROUPOBJUSED || prop == ZFS_PROP_PROJECTOBJUSED) {
|
||||||
propname = "objused";
|
propname = "objused";
|
||||||
if (!nvlist_exists(props, "objquota"))
|
if (!nvlist_exists(props, "objquota")) {
|
||||||
(void) nvlist_add_uint64(props, "objquota", 0);
|
(void) nvlist_add_uint64(props, "objquota",
|
||||||
|
default_quota);
|
||||||
|
}
|
||||||
} else if (prop == ZFS_PROP_USEROBJQUOTA ||
|
} else if (prop == ZFS_PROP_USEROBJQUOTA ||
|
||||||
prop == ZFS_PROP_GROUPOBJQUOTA ||
|
prop == ZFS_PROP_GROUPOBJQUOTA ||
|
||||||
prop == ZFS_PROP_PROJECTOBJQUOTA) {
|
prop == ZFS_PROP_PROJECTOBJQUOTA) {
|
||||||
@ -3760,8 +3787,13 @@ collect_dataset(zfs_handle_t *zhp, list_cbdata_t *cb)
|
|||||||
if (cb->cb_json) {
|
if (cb->cb_json) {
|
||||||
if (pl->pl_prop == ZFS_PROP_NAME)
|
if (pl->pl_prop == ZFS_PROP_NAME)
|
||||||
continue;
|
continue;
|
||||||
|
const char *prop_name;
|
||||||
|
if (pl->pl_prop != ZPROP_USERPROP)
|
||||||
|
prop_name = zfs_prop_to_name(pl->pl_prop);
|
||||||
|
else
|
||||||
|
prop_name = pl->pl_user_prop;
|
||||||
if (zprop_nvlist_one_property(
|
if (zprop_nvlist_one_property(
|
||||||
zfs_prop_to_name(pl->pl_prop), propstr,
|
prop_name, propstr,
|
||||||
sourcetype, source, NULL, props,
|
sourcetype, source, NULL, props,
|
||||||
cb->cb_json_as_int) != 0)
|
cb->cb_json_as_int) != 0)
|
||||||
nomem();
|
nomem();
|
||||||
@ -3852,6 +3884,7 @@ zfs_do_list(int argc, char **argv)
|
|||||||
nvlist_t *data = NULL;
|
nvlist_t *data = NULL;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZFS_OPTION_JSON_NUMS_AS_INT},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
@ -4432,7 +4465,7 @@ zfs_do_rollback(int argc, char **argv)
|
|||||||
if (cb.cb_create > 0)
|
if (cb.cb_create > 0)
|
||||||
min_txg = cb.cb_create;
|
min_txg = cb.cb_create;
|
||||||
|
|
||||||
if ((ret = zfs_iter_snapshots_v2(zhp, 0, rollback_check, &cb,
|
if ((ret = zfs_iter_snapshots_sorted_v2(zhp, 0, rollback_check, &cb,
|
||||||
min_txg, 0)) != 0)
|
min_txg, 0)) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
if ((ret = zfs_iter_bookmarks_v2(zhp, 0, rollback_check, &cb)) != 0)
|
if ((ret = zfs_iter_bookmarks_v2(zhp, 0, rollback_check, &cb)) != 0)
|
||||||
@ -5284,7 +5317,9 @@ 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_ALLOW "allow"
|
#define ZFS_DELEG_PERM_ALLOW "allow"
|
||||||
#define ZFS_DELEG_PERM_USERPROP "userprop"
|
#define ZFS_DELEG_PERM_USERPROP "userprop"
|
||||||
#define ZFS_DELEG_PERM_VSCAN "vscan" /* ??? */
|
#define ZFS_DELEG_PERM_VSCAN "vscan" /* ??? */
|
||||||
@ -5325,6 +5360,7 @@ static zfs_deleg_perm_tab_t zfs_deleg_perm_tbl[] = {
|
|||||||
{ ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
|
{ ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
|
||||||
{ ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
|
{ ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
|
||||||
{ ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
|
{ ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
|
||||||
|
{ ZFS_DELEG_PERM_SEND_RAW, ZFS_DELEG_NOTE_SEND_RAW },
|
||||||
{ ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE },
|
{ ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE },
|
||||||
{ ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
|
{ ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
|
||||||
{ ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
|
{ ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
|
||||||
@ -5857,7 +5893,7 @@ parse_fs_perm_set(fs_perm_set_t *fspset, nvlist_t *nvl)
|
|||||||
static inline const char *
|
static inline const char *
|
||||||
deleg_perm_comment(zfs_deleg_note_t note)
|
deleg_perm_comment(zfs_deleg_note_t note)
|
||||||
{
|
{
|
||||||
const char *str = "";
|
const char *str;
|
||||||
|
|
||||||
/* subcommands */
|
/* subcommands */
|
||||||
switch (note) {
|
switch (note) {
|
||||||
@ -5909,6 +5945,10 @@ deleg_perm_comment(zfs_deleg_note_t note)
|
|||||||
case ZFS_DELEG_NOTE_SEND:
|
case ZFS_DELEG_NOTE_SEND:
|
||||||
str = gettext("");
|
str = gettext("");
|
||||||
break;
|
break;
|
||||||
|
case ZFS_DELEG_NOTE_SEND_RAW:
|
||||||
|
str = gettext("Allow sending ONLY encrypted (raw) replication"
|
||||||
|
"\n\t\t\t\tstreams");
|
||||||
|
break;
|
||||||
case ZFS_DELEG_NOTE_SHARE:
|
case ZFS_DELEG_NOTE_SHARE:
|
||||||
str = gettext("Allows sharing file systems over NFS or SMB"
|
str = gettext("Allows sharing file systems over NFS or SMB"
|
||||||
"\n\t\t\t\tprotocols");
|
"\n\t\t\t\tprotocols");
|
||||||
@ -6838,17 +6878,17 @@ print_holds(boolean_t scripted, int nwidth, int tagwidth, nvlist_t *nvl,
|
|||||||
|
|
||||||
if (scripted) {
|
if (scripted) {
|
||||||
if (parsable) {
|
if (parsable) {
|
||||||
(void) printf("%s\t%s\t%ld\n", zname,
|
(void) printf("%s\t%s\t%lld\n", zname,
|
||||||
tagname, time);
|
tagname, (long long)time);
|
||||||
} else {
|
} else {
|
||||||
(void) printf("%s\t%s\t%s\n", zname,
|
(void) printf("%s\t%s\t%s\n", zname,
|
||||||
tagname, tsbuf);
|
tagname, tsbuf);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (parsable) {
|
if (parsable) {
|
||||||
(void) printf("%-*s %-*s %ld\n",
|
(void) printf("%-*s %-*s %lld\n",
|
||||||
nwidth, zname, tagwidth,
|
nwidth, zname, tagwidth,
|
||||||
tagname, time);
|
tagname, (long long)time);
|
||||||
} else {
|
} else {
|
||||||
(void) printf("%-*s %-*s %s\n",
|
(void) printf("%-*s %-*s %s\n",
|
||||||
nwidth, zname, tagwidth,
|
nwidth, zname, tagwidth,
|
||||||
@ -7436,9 +7476,15 @@ share_mount(int op, int argc, char **argv)
|
|||||||
uint_t nthr;
|
uint_t nthr;
|
||||||
jsobj = data = item = NULL;
|
jsobj = data = item = NULL;
|
||||||
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, op == OP_MOUNT ? ":ajRlvo:Of" : "al"))
|
while ((c = getopt_long(argc, argv,
|
||||||
!= -1) {
|
op == OP_MOUNT ? ":ajRlvo:Of" : "al",
|
||||||
|
op == OP_MOUNT ? long_options : NULL, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
do_all = 1;
|
do_all = 1;
|
||||||
@ -7701,6 +7747,7 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
|
|||||||
struct extmnttab entry;
|
struct extmnttab entry;
|
||||||
const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
|
const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
|
||||||
ino_t path_inode;
|
ino_t path_inode;
|
||||||
|
char *zfs_mntpnt, *entry_mntpnt;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Search for the given (major,minor) pair in the mount table.
|
* Search for the given (major,minor) pair in the mount table.
|
||||||
@ -7742,6 +7789,24 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the filesystem is mounted, check that the mountpoint matches
|
||||||
|
* the one in the mnttab entry w.r.t. provided path. If it doesn't,
|
||||||
|
* then we should not proceed further.
|
||||||
|
*/
|
||||||
|
entry_mntpnt = strdup(entry.mnt_mountp);
|
||||||
|
if (zfs_is_mounted(zhp, &zfs_mntpnt)) {
|
||||||
|
if (strcmp(zfs_mntpnt, entry_mntpnt) != 0) {
|
||||||
|
(void) fprintf(stderr, gettext("cannot %s '%s': "
|
||||||
|
"not an original mountpoint\n"), cmdname, path);
|
||||||
|
free(zfs_mntpnt);
|
||||||
|
free(entry_mntpnt);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
free(zfs_mntpnt);
|
||||||
|
}
|
||||||
|
free(entry_mntpnt);
|
||||||
|
|
||||||
if (op == OP_SHARE) {
|
if (op == OP_SHARE) {
|
||||||
char nfs_mnt_prop[ZFS_MAXPROPLEN];
|
char nfs_mnt_prop[ZFS_MAXPROPLEN];
|
||||||
char smbshare_prop[ZFS_MAXPROPLEN];
|
char smbshare_prop[ZFS_MAXPROPLEN];
|
||||||
@ -8374,8 +8439,14 @@ zfs_do_channel_program(int argc, char **argv)
|
|||||||
boolean_t sync_flag = B_TRUE, json_output = B_FALSE;
|
boolean_t sync_flag = B_TRUE, json_output = B_FALSE;
|
||||||
zpool_handle_t *zhp;
|
zpool_handle_t *zhp;
|
||||||
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, "nt:m:j")) != -1) {
|
while ((c = getopt_long(argc, argv, "nt:m:j", long_options,
|
||||||
|
NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 't':
|
case 't':
|
||||||
case 'm': {
|
case 'm': {
|
||||||
@ -8992,6 +9063,195 @@ zfs_do_project(int argc, char **argv)
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_rewrite_file(const char *path, boolean_t verbose, zfs_rewrite_args_t *args)
|
||||||
|
{
|
||||||
|
int fd, ret = 0;
|
||||||
|
|
||||||
|
fd = open(path, O_WRONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to open %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ioctl(fd, ZFS_IOC_REWRITE, args) < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to rewrite %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
} else if (verbose) {
|
||||||
|
printf("%s\n", path);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_rewrite_dir(const char *path, boolean_t verbose, boolean_t xdev, dev_t dev,
|
||||||
|
zfs_rewrite_args_t *args, nvlist_t *dirs)
|
||||||
|
{
|
||||||
|
struct dirent *ent;
|
||||||
|
DIR *dir;
|
||||||
|
int ret = 0, err;
|
||||||
|
|
||||||
|
dir = opendir(path);
|
||||||
|
if (dir == NULL) {
|
||||||
|
if (errno == ENOENT)
|
||||||
|
return (0);
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to opendir %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t plen = strlen(path) + 1;
|
||||||
|
while ((ent = readdir(dir)) != NULL) {
|
||||||
|
char *fullname;
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
if (ent->d_type != DT_REG && ent->d_type != DT_DIR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (strcmp(ent->d_name, ".") == 0 ||
|
||||||
|
strcmp(ent->d_name, "..") == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (plen + strlen(ent->d_name) >= PATH_MAX) {
|
||||||
|
(void) fprintf(stderr, gettext("path too long %s/%s\n"),
|
||||||
|
path, ent->d_name);
|
||||||
|
ret = ENAMETOOLONG;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (asprintf(&fullname, "%s/%s", path, ent->d_name) == -1) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("failed to allocate memory\n"));
|
||||||
|
ret = ENOMEM;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (xdev) {
|
||||||
|
if (lstat(fullname, &st) < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("failed to stat %s: %s\n"),
|
||||||
|
fullname, strerror(errno));
|
||||||
|
free(fullname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (st.st_dev != dev) {
|
||||||
|
free(fullname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ent->d_type == DT_REG) {
|
||||||
|
err = zfs_rewrite_file(fullname, verbose, args);
|
||||||
|
if (err)
|
||||||
|
ret = err;
|
||||||
|
} else { /* DT_DIR */
|
||||||
|
fnvlist_add_uint64(dirs, fullname, dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(fullname);
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(dir);
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_rewrite_path(const char *path, boolean_t verbose, boolean_t recurse,
|
||||||
|
boolean_t xdev, zfs_rewrite_args_t *args, nvlist_t *dirs)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
if (lstat(path, &st) < 0) {
|
||||||
|
ret = errno;
|
||||||
|
(void) fprintf(stderr, gettext("failed to stat %s: %s\n"),
|
||||||
|
path, strerror(errno));
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (S_ISREG(st.st_mode)) {
|
||||||
|
ret = zfs_rewrite_file(path, verbose, args);
|
||||||
|
} else if (S_ISDIR(st.st_mode) && recurse) {
|
||||||
|
ret = zfs_rewrite_dir(path, verbose, xdev, st.st_dev, args,
|
||||||
|
dirs);
|
||||||
|
}
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zfs_do_rewrite(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int ret = 0, err, c;
|
||||||
|
boolean_t recurse = B_FALSE, verbose = B_FALSE, xdev = B_FALSE;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
usage(B_FALSE);
|
||||||
|
|
||||||
|
zfs_rewrite_args_t args;
|
||||||
|
memset(&args, 0, sizeof (args));
|
||||||
|
|
||||||
|
while ((c = getopt(argc, argv, "Pl:o:rvx")) != -1) {
|
||||||
|
switch (c) {
|
||||||
|
case 'P':
|
||||||
|
args.flags |= ZFS_REWRITE_PHYSICAL;
|
||||||
|
break;
|
||||||
|
case 'l':
|
||||||
|
args.len = strtoll(optarg, NULL, 0);
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
args.off = strtoll(optarg, NULL, 0);
|
||||||
|
break;
|
||||||
|
case 'r':
|
||||||
|
recurse = B_TRUE;
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
verbose = B_TRUE;
|
||||||
|
break;
|
||||||
|
case 'x':
|
||||||
|
xdev = B_TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||||
|
optopt);
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
argv += optind;
|
||||||
|
argc -= optind;
|
||||||
|
if (argc == 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("missing file or directory target(s)\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
nvlist_t *dirs = fnvlist_alloc();
|
||||||
|
for (int i = 0; i < argc; i++) {
|
||||||
|
err = zfs_rewrite_path(argv[i], verbose, recurse, xdev, &args,
|
||||||
|
dirs);
|
||||||
|
if (err)
|
||||||
|
ret = err;
|
||||||
|
}
|
||||||
|
nvpair_t *dir;
|
||||||
|
while ((dir = nvlist_next_nvpair(dirs, NULL)) != NULL) {
|
||||||
|
err = zfs_rewrite_dir(nvpair_name(dir), verbose, xdev,
|
||||||
|
fnvpair_value_uint64(dir), &args, dirs);
|
||||||
|
if (err)
|
||||||
|
ret = err;
|
||||||
|
fnvlist_remove_nvpair(dirs, dir);
|
||||||
|
}
|
||||||
|
fnvlist_free(dirs);
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
zfs_do_wait(int argc, char **argv)
|
zfs_do_wait(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -9083,7 +9343,13 @@ zfs_do_version(int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
||||||
boolean_t json = B_FALSE;
|
boolean_t json = B_FALSE;
|
||||||
while ((c = getopt(argc, argv, "j")) != -1) {
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
while ((c = getopt_long(argc, argv, "j", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'j':
|
case 'j':
|
||||||
json = B_TRUE;
|
json = B_TRUE;
|
||||||
@ -9187,7 +9453,7 @@ main(int argc, char **argv)
|
|||||||
* Special case '-V|--version'
|
* Special case '-V|--version'
|
||||||
*/
|
*/
|
||||||
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
||||||
return (zfs_do_version(argc, argv));
|
return (zfs_version_print() != 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special case 'help'
|
* Special case 'help'
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
346
cmd/zhack.c
346
cmd/zhack.c
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -53,6 +54,7 @@
|
|||||||
#include <sys/dmu_tx.h>
|
#include <sys/dmu_tx.h>
|
||||||
#include <zfeature_common.h>
|
#include <zfeature_common.h>
|
||||||
#include <libzutil.h>
|
#include <libzutil.h>
|
||||||
|
#include <sys/metaslab_impl.h>
|
||||||
|
|
||||||
static importargs_t g_importargs;
|
static importargs_t g_importargs;
|
||||||
static char *g_pool;
|
static char *g_pool;
|
||||||
@ -68,7 +70,8 @@ static __attribute__((noreturn)) void
|
|||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"Usage: zhack [-c cachefile] [-d dir] <subcommand> <args> ...\n"
|
"Usage: zhack [-o tunable] [-c cachefile] [-d dir] <subcommand> "
|
||||||
|
"<args> ...\n"
|
||||||
"where <subcommand> <args> is one of the following:\n"
|
"where <subcommand> <args> is one of the following:\n"
|
||||||
"\n");
|
"\n");
|
||||||
|
|
||||||
@ -92,7 +95,10 @@ usage(void)
|
|||||||
" -c repair corrupted label checksums\n"
|
" -c repair corrupted label checksums\n"
|
||||||
" -u restore the label on a detached device\n"
|
" -u restore the label on a detached device\n"
|
||||||
"\n"
|
"\n"
|
||||||
" <device> : path to vdev\n");
|
" <device> : path to vdev\n"
|
||||||
|
"\n"
|
||||||
|
" metaslab leak <pool>\n"
|
||||||
|
" apply allocation map from zdb to specified pool\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,9 +167,9 @@ zhack_import(char *target, boolean_t readonly)
|
|||||||
|
|
||||||
props = NULL;
|
props = NULL;
|
||||||
if (readonly) {
|
if (readonly) {
|
||||||
VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
|
VERIFY0(nvlist_alloc(&props, NV_UNIQUE_NAME, 0));
|
||||||
VERIFY(nvlist_add_uint64(props,
|
VERIFY0(nvlist_add_uint64(props,
|
||||||
zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0);
|
zpool_prop_to_name(ZPOOL_PROP_READONLY), 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
zfeature_checks_disable = B_TRUE;
|
zfeature_checks_disable = B_TRUE;
|
||||||
@ -217,8 +223,8 @@ dump_obj(objset_t *os, uint64_t obj, const char *name)
|
|||||||
} else {
|
} else {
|
||||||
ASSERT(za->za_integer_length == 1);
|
ASSERT(za->za_integer_length == 1);
|
||||||
char val[1024];
|
char val[1024];
|
||||||
VERIFY(zap_lookup(os, obj, za->za_name,
|
VERIFY0(zap_lookup(os, obj, za->za_name,
|
||||||
1, sizeof (val), val) == 0);
|
1, sizeof (val), val));
|
||||||
(void) printf("\t%s = %s\n", za->za_name, val);
|
(void) printf("\t%s = %s\n", za->za_name, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -362,10 +368,12 @@ feature_incr_sync(void *arg, dmu_tx_t *tx)
|
|||||||
zfeature_info_t *feature = arg;
|
zfeature_info_t *feature = arg;
|
||||||
uint64_t refcount;
|
uint64_t refcount;
|
||||||
|
|
||||||
|
mutex_enter(&spa->spa_feat_stats_lock);
|
||||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||||
feature_sync(spa, feature, refcount + 1, tx);
|
feature_sync(spa, feature, refcount + 1, tx);
|
||||||
spa_history_log_internal(spa, "zhack feature incr", tx,
|
spa_history_log_internal(spa, "zhack feature incr", tx,
|
||||||
"name=%s", feature->fi_guid);
|
"name=%s", feature->fi_guid);
|
||||||
|
mutex_exit(&spa->spa_feat_stats_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -375,10 +383,12 @@ feature_decr_sync(void *arg, dmu_tx_t *tx)
|
|||||||
zfeature_info_t *feature = arg;
|
zfeature_info_t *feature = arg;
|
||||||
uint64_t refcount;
|
uint64_t refcount;
|
||||||
|
|
||||||
|
mutex_enter(&spa->spa_feat_stats_lock);
|
||||||
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
|
||||||
feature_sync(spa, feature, refcount - 1, tx);
|
feature_sync(spa, feature, refcount - 1, tx);
|
||||||
spa_history_log_internal(spa, "zhack feature decr", tx,
|
spa_history_log_internal(spa, "zhack feature decr", tx,
|
||||||
"name=%s", feature->fi_guid);
|
"name=%s", feature->fi_guid);
|
||||||
|
mutex_exit(&spa->spa_feat_stats_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -495,6 +505,186 @@ zhack_do_feature(int argc, char **argv)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean_t
|
||||||
|
strstarts(const char *a, const char *b)
|
||||||
|
{
|
||||||
|
return (strncmp(a, b, strlen(b)) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
metaslab_force_alloc(metaslab_t *msp, uint64_t start, uint64_t size,
|
||||||
|
dmu_tx_t *tx)
|
||||||
|
{
|
||||||
|
ASSERT(msp->ms_disabled);
|
||||||
|
ASSERT(MUTEX_HELD(&msp->ms_lock));
|
||||||
|
uint64_t txg = dmu_tx_get_txg(tx);
|
||||||
|
|
||||||
|
uint64_t off = start;
|
||||||
|
while (off < start + size) {
|
||||||
|
uint64_t ostart, osize;
|
||||||
|
boolean_t found = zfs_range_tree_find_in(msp->ms_allocatable,
|
||||||
|
off, start + size - off, &ostart, &osize);
|
||||||
|
if (!found)
|
||||||
|
break;
|
||||||
|
zfs_range_tree_remove(msp->ms_allocatable, ostart, osize);
|
||||||
|
|
||||||
|
if (zfs_range_tree_is_empty(msp->ms_allocating[txg & TXG_MASK]))
|
||||||
|
vdev_dirty(msp->ms_group->mg_vd, VDD_METASLAB, msp,
|
||||||
|
txg);
|
||||||
|
|
||||||
|
zfs_range_tree_add(msp->ms_allocating[txg & TXG_MASK], ostart,
|
||||||
|
osize);
|
||||||
|
msp->ms_allocating_total += osize;
|
||||||
|
off = ostart + osize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
zhack_do_metaslab_leak(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
char *target;
|
||||||
|
spa_t *spa;
|
||||||
|
|
||||||
|
optind = 1;
|
||||||
|
boolean_t force = B_FALSE;
|
||||||
|
while ((c = getopt(argc, argv, "f")) != -1) {
|
||||||
|
switch (c) {
|
||||||
|
case 'f':
|
||||||
|
force = B_TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
usage();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
argc -= optind;
|
||||||
|
argv += optind;
|
||||||
|
|
||||||
|
if (argc < 1) {
|
||||||
|
(void) fprintf(stderr, "error: missing pool name\n");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
target = argv[0];
|
||||||
|
|
||||||
|
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
||||||
|
spa_config_enter(spa, SCL_VDEV | SCL_ALLOC, FTAG, RW_READER);
|
||||||
|
|
||||||
|
char *line = NULL;
|
||||||
|
size_t cap = 0;
|
||||||
|
|
||||||
|
vdev_t *vd = NULL;
|
||||||
|
metaslab_t *prev = NULL;
|
||||||
|
dmu_tx_t *tx = NULL;
|
||||||
|
while (getline(&line, &cap, stdin) > 0) {
|
||||||
|
if (strstarts(line, "\tvdev ")) {
|
||||||
|
uint64_t vdev_id, ms_shift;
|
||||||
|
if (sscanf(line,
|
||||||
|
"\tvdev %10"PRIu64"\t%*s metaslab shift %4"PRIu64,
|
||||||
|
&vdev_id, &ms_shift) == 1) {
|
||||||
|
VERIFY3U(sscanf(line, "\tvdev %"PRIu64
|
||||||
|
"\t metaslab shift %4"PRIu64,
|
||||||
|
&vdev_id, &ms_shift), ==, 2);
|
||||||
|
}
|
||||||
|
vd = vdev_lookup_top(spa, vdev_id);
|
||||||
|
if (vd == NULL) {
|
||||||
|
fprintf(stderr, "error: no such vdev with "
|
||||||
|
"id %"PRIu64"\n", vdev_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (tx) {
|
||||||
|
dmu_tx_commit(tx);
|
||||||
|
mutex_exit(&prev->ms_lock);
|
||||||
|
metaslab_enable(prev, B_FALSE, B_FALSE);
|
||||||
|
tx = NULL;
|
||||||
|
prev = NULL;
|
||||||
|
}
|
||||||
|
if (vd->vdev_ms_shift != ms_shift) {
|
||||||
|
fprintf(stderr, "error: ms_shift mismatch: %"
|
||||||
|
PRIu64" != %"PRIu64"\n", vd->vdev_ms_shift,
|
||||||
|
ms_shift);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (strstarts(line, "\tmetaslabs ")) {
|
||||||
|
uint64_t ms_count;
|
||||||
|
VERIFY3U(sscanf(line, "\tmetaslabs %"PRIu64, &ms_count),
|
||||||
|
==, 1);
|
||||||
|
ASSERT(vd);
|
||||||
|
if (!force && vd->vdev_ms_count != ms_count) {
|
||||||
|
fprintf(stderr, "error: ms_count mismatch: %"
|
||||||
|
PRIu64" != %"PRIu64"\n", vd->vdev_ms_count,
|
||||||
|
ms_count);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (strstarts(line, "ALLOC:")) {
|
||||||
|
uint64_t start, size;
|
||||||
|
VERIFY3U(sscanf(line, "ALLOC: %"PRIu64" %"PRIu64"\n",
|
||||||
|
&start, &size), ==, 2);
|
||||||
|
|
||||||
|
ASSERT(vd);
|
||||||
|
metaslab_t *cur =
|
||||||
|
vd->vdev_ms[start >> vd->vdev_ms_shift];
|
||||||
|
if (prev != cur) {
|
||||||
|
if (prev) {
|
||||||
|
dmu_tx_commit(tx);
|
||||||
|
mutex_exit(&prev->ms_lock);
|
||||||
|
metaslab_enable(prev, B_FALSE, B_FALSE);
|
||||||
|
}
|
||||||
|
ASSERT(cur);
|
||||||
|
metaslab_disable(cur);
|
||||||
|
mutex_enter(&cur->ms_lock);
|
||||||
|
metaslab_load(cur);
|
||||||
|
prev = cur;
|
||||||
|
tx = dmu_tx_create_dd(
|
||||||
|
spa_get_dsl(vd->vdev_spa)->dp_root_dir);
|
||||||
|
dmu_tx_assign(tx, DMU_TX_WAIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
metaslab_force_alloc(cur, start, size, tx);
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tx) {
|
||||||
|
dmu_tx_commit(tx);
|
||||||
|
mutex_exit(&prev->ms_lock);
|
||||||
|
metaslab_enable(prev, B_FALSE, B_FALSE);
|
||||||
|
tx = NULL;
|
||||||
|
prev = NULL;
|
||||||
|
}
|
||||||
|
if (line)
|
||||||
|
free(line);
|
||||||
|
|
||||||
|
spa_config_exit(spa, SCL_VDEV | SCL_ALLOC, FTAG);
|
||||||
|
spa_close(spa, FTAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zhack_do_metaslab(int argc, char **argv)
|
||||||
|
{
|
||||||
|
char *subcommand;
|
||||||
|
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
if (argc == 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"error: no metaslab operation specified\n");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
subcommand = argv[0];
|
||||||
|
if (strcmp(subcommand, "leak") == 0) {
|
||||||
|
zhack_do_metaslab_leak(argc, argv);
|
||||||
|
} else {
|
||||||
|
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||||
|
subcommand);
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
#define ASHIFT_UBERBLOCK_SHIFT(ashift) \
|
#define ASHIFT_UBERBLOCK_SHIFT(ashift) \
|
||||||
MIN(MAX(ashift, UBERBLOCK_SHIFT), \
|
MIN(MAX(ashift, UBERBLOCK_SHIFT), \
|
||||||
MAX_UBERBLOCK_SHIFT)
|
MAX_UBERBLOCK_SHIFT)
|
||||||
@ -524,6 +714,23 @@ zhack_repair_read_label(const int fd, vdev_label_t *vl,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zhack_repair_get_byteswap(const zio_eck_t *vdev_eck, const int l, int *byteswap)
|
||||||
|
{
|
||||||
|
if (vdev_eck->zec_magic == ZEC_MAGIC) {
|
||||||
|
*byteswap = B_FALSE;
|
||||||
|
} else if (vdev_eck->zec_magic == BSWAP_64((uint64_t)ZEC_MAGIC)) {
|
||||||
|
*byteswap = B_TRUE;
|
||||||
|
} else {
|
||||||
|
(void) fprintf(stderr, "error: label %d: "
|
||||||
|
"Expected the nvlist checksum magic number but instead got "
|
||||||
|
"0x%" PRIx64 "\n",
|
||||||
|
l, vdev_eck->zec_magic);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
zhack_repair_calc_cksum(const int byteswap, void *data, const uint64_t offset,
|
zhack_repair_calc_cksum(const int byteswap, void *data, const uint64_t offset,
|
||||||
const uint64_t abdsize, zio_eck_t *eck, zio_cksum_t *cksum)
|
const uint64_t abdsize, zio_eck_t *eck, zio_cksum_t *cksum)
|
||||||
@ -550,33 +757,10 @@ zhack_repair_calc_cksum(const int byteswap, void *data, const uint64_t offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
zhack_repair_check_label(uberblock_t *ub, const int l, const char **cfg_keys,
|
zhack_repair_get_ashift(nvlist_t *cfg, const int l, uint64_t *ashift)
|
||||||
const size_t cfg_keys_len, nvlist_t *cfg, nvlist_t *vdev_tree_cfg,
|
|
||||||
uint64_t *ashift)
|
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
nvlist_t *vdev_tree_cfg;
|
||||||
if (ub->ub_txg != 0) {
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
"error: label %d: UB TXG of 0 expected, but got %"
|
|
||||||
PRIu64 "\n",
|
|
||||||
l, ub->ub_txg);
|
|
||||||
(void) fprintf(stderr, "It would appear the device was not "
|
|
||||||
"properly removed.\n");
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < cfg_keys_len; i++) {
|
|
||||||
uint64_t val;
|
|
||||||
err = nvlist_lookup_uint64(cfg, cfg_keys[i], &val);
|
|
||||||
if (err) {
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
"error: label %d, %d: "
|
|
||||||
"cannot find nvlist key %s\n",
|
|
||||||
l, i, cfg_keys[i]);
|
|
||||||
return (err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
err = nvlist_lookup_nvlist(cfg,
|
err = nvlist_lookup_nvlist(cfg,
|
||||||
ZPOOL_CONFIG_VDEV_TREE, &vdev_tree_cfg);
|
ZPOOL_CONFIG_VDEV_TREE, &vdev_tree_cfg);
|
||||||
@ -600,7 +784,7 @@ zhack_repair_check_label(uberblock_t *ub, const int l, const char **cfg_keys,
|
|||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: nvlist key %s is zero\n",
|
"error: label %d: nvlist key %s is zero\n",
|
||||||
l, ZPOOL_CONFIG_ASHIFT);
|
l, ZPOOL_CONFIG_ASHIFT);
|
||||||
return (err);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -615,30 +799,35 @@ zhack_repair_undetach(uberblock_t *ub, nvlist_t *cfg, const int l)
|
|||||||
*/
|
*/
|
||||||
if (BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp) != 0) {
|
if (BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp) != 0) {
|
||||||
const uint64_t txg = BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp);
|
const uint64_t txg = BP_GET_LOGICAL_BIRTH(&ub->ub_rootbp);
|
||||||
|
int err;
|
||||||
|
|
||||||
ub->ub_txg = txg;
|
ub->ub_txg = txg;
|
||||||
|
|
||||||
if (nvlist_remove_all(cfg, ZPOOL_CONFIG_CREATE_TXG) != 0) {
|
err = nvlist_remove_all(cfg, ZPOOL_CONFIG_CREATE_TXG);
|
||||||
|
if (err) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: "
|
"error: label %d: "
|
||||||
"Failed to remove pool creation TXG\n",
|
"Failed to remove pool creation TXG\n",
|
||||||
l);
|
l);
|
||||||
return (1);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvlist_remove_all(cfg, ZPOOL_CONFIG_POOL_TXG) != 0) {
|
err = nvlist_remove_all(cfg, ZPOOL_CONFIG_POOL_TXG);
|
||||||
|
if (err) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: Failed to remove pool TXG to "
|
"error: label %d: Failed to remove pool TXG to "
|
||||||
"be replaced.\n",
|
"be replaced.\n",
|
||||||
l);
|
l);
|
||||||
return (1);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvlist_add_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, txg) != 0) {
|
err = nvlist_add_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, txg);
|
||||||
|
if (err) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"error: label %d: "
|
"error: label %d: "
|
||||||
"Failed to add pool TXG of %" PRIu64 "\n",
|
"Failed to add pool TXG of %" PRIu64 "\n",
|
||||||
l, txg);
|
l, txg);
|
||||||
return (1);
|
return (err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -732,6 +921,7 @@ zhack_repair_test_cksum(const int byteswap, void *vdev_data,
|
|||||||
BSWAP_64(ZEC_MAGIC) : ZEC_MAGIC;
|
BSWAP_64(ZEC_MAGIC) : ZEC_MAGIC;
|
||||||
const uint64_t actual_magic = vdev_eck->zec_magic;
|
const uint64_t actual_magic = vdev_eck->zec_magic;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (actual_magic != expected_magic) {
|
if (actual_magic != expected_magic) {
|
||||||
(void) fprintf(stderr, "error: label %d: "
|
(void) fprintf(stderr, "error: label %d: "
|
||||||
"Expected "
|
"Expected "
|
||||||
@ -753,6 +943,36 @@ zhack_repair_test_cksum(const int byteswap, void *vdev_data,
|
|||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
zhack_repair_unpack_cfg(vdev_label_t *vl, const int l, nvlist_t **cfg)
|
||||||
|
{
|
||||||
|
const char *cfg_keys[] = { ZPOOL_CONFIG_VERSION,
|
||||||
|
ZPOOL_CONFIG_POOL_STATE, ZPOOL_CONFIG_GUID };
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = nvlist_unpack(vl->vl_vdev_phys.vp_nvlist,
|
||||||
|
VDEV_PHYS_SIZE - sizeof (zio_eck_t), cfg, 0);
|
||||||
|
if (err) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"error: cannot unpack nvlist label %d\n", l);
|
||||||
|
return (err);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < ARRAY_SIZE(cfg_keys); i++) {
|
||||||
|
uint64_t val;
|
||||||
|
err = nvlist_lookup_uint64(*cfg, cfg_keys[i], &val);
|
||||||
|
if (err) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"error: label %d, %d: "
|
||||||
|
"cannot find nvlist key %s\n",
|
||||||
|
l, i, cfg_keys[i]);
|
||||||
|
return (err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
||||||
vdev_label_t *vl, const uint64_t label_offset, const int l,
|
vdev_label_t *vl, const uint64_t label_offset, const int l,
|
||||||
@ -766,10 +986,7 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
(zio_eck_t *)((char *)(vdev_data) + VDEV_PHYS_SIZE) - 1;
|
(zio_eck_t *)((char *)(vdev_data) + VDEV_PHYS_SIZE) - 1;
|
||||||
const uint64_t vdev_phys_offset =
|
const uint64_t vdev_phys_offset =
|
||||||
label_offset + offsetof(vdev_label_t, vl_vdev_phys);
|
label_offset + offsetof(vdev_label_t, vl_vdev_phys);
|
||||||
const char *cfg_keys[] = { ZPOOL_CONFIG_VERSION,
|
|
||||||
ZPOOL_CONFIG_POOL_STATE, ZPOOL_CONFIG_GUID };
|
|
||||||
nvlist_t *cfg;
|
nvlist_t *cfg;
|
||||||
nvlist_t *vdev_tree_cfg = NULL;
|
|
||||||
uint64_t ashift;
|
uint64_t ashift;
|
||||||
int byteswap;
|
int byteswap;
|
||||||
|
|
||||||
@ -777,18 +994,9 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
if (err)
|
if (err)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (vdev_eck->zec_magic == 0) {
|
err = zhack_repair_get_byteswap(vdev_eck, l, &byteswap);
|
||||||
(void) fprintf(stderr, "error: label %d: "
|
if (err)
|
||||||
"Expected the nvlist checksum magic number to not be zero"
|
|
||||||
"\n",
|
|
||||||
l);
|
|
||||||
(void) fprintf(stderr, "There should already be a checksum "
|
|
||||||
"for the label.\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
byteswap =
|
|
||||||
(vdev_eck->zec_magic == BSWAP_64((uint64_t)ZEC_MAGIC));
|
|
||||||
|
|
||||||
if (byteswap) {
|
if (byteswap) {
|
||||||
byteswap_uint64_array(&vdev_eck->zec_cksum,
|
byteswap_uint64_array(&vdev_eck->zec_cksum,
|
||||||
@ -804,16 +1012,7 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = nvlist_unpack(vl->vl_vdev_phys.vp_nvlist,
|
err = zhack_repair_unpack_cfg(vl, l, &cfg);
|
||||||
VDEV_PHYS_SIZE - sizeof (zio_eck_t), &cfg, 0);
|
|
||||||
if (err) {
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
"error: cannot unpack nvlist label %d\n", l);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = zhack_repair_check_label(ub,
|
|
||||||
l, cfg_keys, ARRAY_SIZE(cfg_keys), cfg, vdev_tree_cfg, &ashift);
|
|
||||||
if (err)
|
if (err)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -821,6 +1020,19 @@ zhack_repair_one_label(const zhack_repair_op_t op, const int fd,
|
|||||||
char *buf;
|
char *buf;
|
||||||
size_t buflen;
|
size_t buflen;
|
||||||
|
|
||||||
|
if (ub->ub_txg != 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"error: label %d: UB TXG of 0 expected, but got %"
|
||||||
|
PRIu64 "\n", l, ub->ub_txg);
|
||||||
|
(void) fprintf(stderr, "It would appear the device was "
|
||||||
|
"not properly detached.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = zhack_repair_get_ashift(cfg, l, &ashift);
|
||||||
|
if (err)
|
||||||
|
return;
|
||||||
|
|
||||||
err = zhack_repair_undetach(ub, cfg, l);
|
err = zhack_repair_undetach(ub, cfg, l);
|
||||||
if (err)
|
if (err)
|
||||||
return;
|
return;
|
||||||
@ -980,7 +1192,7 @@ main(int argc, char **argv)
|
|||||||
dprintf_setup(&argc, argv);
|
dprintf_setup(&argc, argv);
|
||||||
zfs_prop_init();
|
zfs_prop_init();
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "+c:d:")) != -1) {
|
while ((c = getopt(argc, argv, "+c:d:o:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
g_importargs.cachefile = optarg;
|
g_importargs.cachefile = optarg;
|
||||||
@ -989,6 +1201,10 @@ main(int argc, char **argv)
|
|||||||
assert(g_importargs.paths < MAX_NUM_PATHS);
|
assert(g_importargs.paths < MAX_NUM_PATHS);
|
||||||
g_importargs.path[g_importargs.paths++] = optarg;
|
g_importargs.path[g_importargs.paths++] = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'o':
|
||||||
|
if (handle_tunable_option(optarg, B_FALSE) != 0)
|
||||||
|
exit(1);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
@ -1010,6 +1226,8 @@ main(int argc, char **argv)
|
|||||||
rv = zhack_do_feature(argc, argv);
|
rv = zhack_do_feature(argc, argv);
|
||||||
} else if (strcmp(subcommand, "label") == 0) {
|
} else if (strcmp(subcommand, "label") == 0) {
|
||||||
return (zhack_do_label(argc, argv));
|
return (zhack_do_label(argc, argv));
|
||||||
|
} else if (strcmp(subcommand, "metaslab") == 0) {
|
||||||
|
rv = zhack_do_metaslab(argc, argv);
|
||||||
} else {
|
} else {
|
||||||
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||||
subcommand);
|
subcommand);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env @PYTHON_SHEBANG@
|
#!/usr/bin/env @PYTHON_SHEBANG@
|
||||||
|
# SPDX-License-Identifier: CDDL-1.0
|
||||||
#
|
#
|
||||||
# Print out statistics for all zil stats. This information is
|
# Print out statistics for all zil stats. This information is
|
||||||
# available through the zil kstat.
|
# available through the zil kstat.
|
||||||
@ -46,6 +47,7 @@ cols = {
|
|||||||
"cec": [5, 1000, "zil_commit_error_count"],
|
"cec": [5, 1000, "zil_commit_error_count"],
|
||||||
"csc": [5, 1000, "zil_commit_stall_count"],
|
"csc": [5, 1000, "zil_commit_stall_count"],
|
||||||
"cSc": [5, 1000, "zil_commit_suspend_count"],
|
"cSc": [5, 1000, "zil_commit_suspend_count"],
|
||||||
|
"cCc": [5, 1000, "zil_commit_crash_count"],
|
||||||
"ic": [5, 1000, "zil_itx_count"],
|
"ic": [5, 1000, "zil_itx_count"],
|
||||||
"iic": [5, 1000, "zil_itx_indirect_count"],
|
"iic": [5, 1000, "zil_itx_indirect_count"],
|
||||||
"iib": [5, 1024, "zil_itx_indirect_bytes"],
|
"iib": [5, 1024, "zil_itx_indirect_bytes"],
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -22,7 +23,7 @@
|
|||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
|
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
|
||||||
* Copyright (c) 2017, Intel Corporation.
|
* Copyright (c) 2017, Intel Corporation.
|
||||||
* Copyright (c) 2023-2024, Klara Inc.
|
* Copyright (c) 2023-2025, Klara, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -242,6 +243,36 @@ err_to_str(int err)
|
|||||||
return ("[unknown]");
|
return ("[unknown]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *const iotypestrtable[ZINJECT_IOTYPES] = {
|
||||||
|
[ZINJECT_IOTYPE_NULL] = "null",
|
||||||
|
[ZINJECT_IOTYPE_READ] = "read",
|
||||||
|
[ZINJECT_IOTYPE_WRITE] = "write",
|
||||||
|
[ZINJECT_IOTYPE_FREE] = "free",
|
||||||
|
[ZINJECT_IOTYPE_CLAIM] = "claim",
|
||||||
|
[ZINJECT_IOTYPE_FLUSH] = "flush",
|
||||||
|
[ZINJECT_IOTYPE_TRIM] = "trim",
|
||||||
|
[ZINJECT_IOTYPE_ALL] = "all",
|
||||||
|
[ZINJECT_IOTYPE_PROBE] = "probe",
|
||||||
|
};
|
||||||
|
|
||||||
|
static zinject_iotype_t
|
||||||
|
str_to_iotype(const char *arg)
|
||||||
|
{
|
||||||
|
for (uint_t iotype = 0; iotype < ZINJECT_IOTYPES; iotype++)
|
||||||
|
if (iotypestrtable[iotype] != NULL &&
|
||||||
|
strcasecmp(iotypestrtable[iotype], arg) == 0)
|
||||||
|
return (iotype);
|
||||||
|
return (ZINJECT_IOTYPES);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
iotype_to_str(zinject_iotype_t iotype)
|
||||||
|
{
|
||||||
|
if (iotype >= ZINJECT_IOTYPES || iotypestrtable[iotype] == NULL)
|
||||||
|
return ("[unknown]");
|
||||||
|
return (iotypestrtable[iotype]);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print usage message.
|
* Print usage message.
|
||||||
*/
|
*/
|
||||||
@ -404,27 +435,31 @@ print_data_handler(int id, const char *pool, zinject_record_t *record,
|
|||||||
|
|
||||||
if (*count == 0) {
|
if (*count == 0) {
|
||||||
(void) printf("%3s %-15s %-6s %-6s %-8s %3s %-4s "
|
(void) printf("%3s %-15s %-6s %-6s %-8s %3s %-4s "
|
||||||
"%-15s\n", "ID", "POOL", "OBJSET", "OBJECT", "TYPE",
|
"%-15s %-6s %-15s\n", "ID", "POOL", "OBJSET", "OBJECT",
|
||||||
"LVL", "DVAs", "RANGE");
|
"TYPE", "LVL", "DVAs", "RANGE", "MATCH", "INJECT");
|
||||||
(void) printf("--- --------------- ------ "
|
(void) printf("--- --------------- ------ "
|
||||||
"------ -------- --- ---- ---------------\n");
|
"------ -------- --- ---- --------------- "
|
||||||
|
"------ ------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
*count += 1;
|
*count += 1;
|
||||||
|
|
||||||
(void) printf("%3d %-15s %-6llu %-6llu %-8s %-3d 0x%02x ",
|
char rangebuf[32];
|
||||||
id, pool, (u_longlong_t)record->zi_objset,
|
if (record->zi_start == 0 && record->zi_end == -1ULL)
|
||||||
(u_longlong_t)record->zi_object, type_to_name(record->zi_type),
|
snprintf(rangebuf, sizeof (rangebuf), "all");
|
||||||
record->zi_level, record->zi_dvas);
|
|
||||||
|
|
||||||
|
|
||||||
if (record->zi_start == 0 &&
|
|
||||||
record->zi_end == -1ULL)
|
|
||||||
(void) printf("all\n");
|
|
||||||
else
|
else
|
||||||
(void) printf("[%llu, %llu]\n", (u_longlong_t)record->zi_start,
|
snprintf(rangebuf, sizeof (rangebuf), "[%llu, %llu]",
|
||||||
|
(u_longlong_t)record->zi_start,
|
||||||
(u_longlong_t)record->zi_end);
|
(u_longlong_t)record->zi_end);
|
||||||
|
|
||||||
|
|
||||||
|
(void) printf("%3d %-15s %-6llu %-6llu %-8s %-3d 0x%02x %-15s "
|
||||||
|
"%6" PRIu64 " %6" PRIu64 "\n", id, pool,
|
||||||
|
(u_longlong_t)record->zi_objset,
|
||||||
|
(u_longlong_t)record->zi_object, type_to_name(record->zi_type),
|
||||||
|
record->zi_level, record->zi_dvas, rangebuf,
|
||||||
|
record->zi_match_count, record->zi_inject_count);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,10 +467,6 @@ static int
|
|||||||
print_device_handler(int id, const char *pool, zinject_record_t *record,
|
print_device_handler(int id, const char *pool, zinject_record_t *record,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
static const char *iotypestr[] = {
|
|
||||||
"null", "read", "write", "free", "claim", "flush", "trim", "all",
|
|
||||||
};
|
|
||||||
|
|
||||||
int *count = data;
|
int *count = data;
|
||||||
|
|
||||||
if (record->zi_guid == 0 || record->zi_func[0] != '\0')
|
if (record->zi_guid == 0 || record->zi_func[0] != '\0')
|
||||||
@ -445,11 +476,14 @@ print_device_handler(int id, const char *pool, zinject_record_t *record,
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if (*count == 0) {
|
if (*count == 0) {
|
||||||
(void) printf("%3s %-15s %-16s %-5s %-10s %-9s\n",
|
(void) printf("%3s %-15s %-16s %-5s %-10s %-9s "
|
||||||
"ID", "POOL", "GUID", "TYPE", "ERROR", "FREQ");
|
"%-6s %-6s\n",
|
||||||
|
"ID", "POOL", "GUID", "TYPE", "ERROR", "FREQ",
|
||||||
|
"MATCH", "INJECT");
|
||||||
(void) printf(
|
(void) printf(
|
||||||
"--- --------------- ---------------- "
|
"--- --------------- ---------------- "
|
||||||
"----- ---------- ---------\n");
|
"----- ---------- --------- "
|
||||||
|
"------ ------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
*count += 1;
|
*count += 1;
|
||||||
@ -457,9 +491,11 @@ print_device_handler(int id, const char *pool, zinject_record_t *record,
|
|||||||
double freq = record->zi_freq == 0 ? 100.0f :
|
double freq = record->zi_freq == 0 ? 100.0f :
|
||||||
(((double)record->zi_freq) / ZI_PERCENTAGE_MAX) * 100.0f;
|
(((double)record->zi_freq) / ZI_PERCENTAGE_MAX) * 100.0f;
|
||||||
|
|
||||||
(void) printf("%3d %-15s %llx %-5s %-10s %8.4f%%\n", id, pool,
|
(void) printf("%3d %-15s %llx %-5s %-10s %8.4f%% "
|
||||||
(u_longlong_t)record->zi_guid, iotypestr[record->zi_iotype],
|
"%6" PRIu64 " %6" PRIu64 "\n", id, pool,
|
||||||
err_to_str(record->zi_error), freq);
|
(u_longlong_t)record->zi_guid,
|
||||||
|
iotype_to_str(record->zi_iotype), err_to_str(record->zi_error),
|
||||||
|
freq, record->zi_match_count, record->zi_inject_count);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -477,18 +513,26 @@ print_delay_handler(int id, const char *pool, zinject_record_t *record,
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if (*count == 0) {
|
if (*count == 0) {
|
||||||
(void) printf("%3s %-15s %-15s %-15s %s\n",
|
(void) printf("%3s %-15s %-16s %-10s %-5s %-9s "
|
||||||
"ID", "POOL", "DELAY (ms)", "LANES", "GUID");
|
"%-6s %-6s\n",
|
||||||
(void) printf("--- --------------- --------------- "
|
"ID", "POOL", "GUID", "DELAY (ms)", "LANES", "FREQ",
|
||||||
"--------------- ----------------\n");
|
"MATCH", "INJECT");
|
||||||
|
(void) printf("--- --------------- ---------------- "
|
||||||
|
"---------- ----- --------- "
|
||||||
|
"------ ------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
*count += 1;
|
*count += 1;
|
||||||
|
|
||||||
(void) printf("%3d %-15s %-15llu %-15llu %llx\n", id, pool,
|
double freq = record->zi_freq == 0 ? 100.0f :
|
||||||
|
(((double)record->zi_freq) / ZI_PERCENTAGE_MAX) * 100.0f;
|
||||||
|
|
||||||
|
(void) printf("%3d %-15s %llx %10llu %5llu %8.4f%% "
|
||||||
|
"%6" PRIu64 " %6" PRIu64 "\n", id, pool,
|
||||||
|
(u_longlong_t)record->zi_guid,
|
||||||
(u_longlong_t)NSEC2MSEC(record->zi_timer),
|
(u_longlong_t)NSEC2MSEC(record->zi_timer),
|
||||||
(u_longlong_t)record->zi_nlanes,
|
(u_longlong_t)record->zi_nlanes,
|
||||||
(u_longlong_t)record->zi_guid);
|
freq, record->zi_match_count, record->zi_inject_count);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -852,7 +896,7 @@ main(int argc, char **argv)
|
|||||||
int quiet = 0;
|
int quiet = 0;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
int domount = 0;
|
int domount = 0;
|
||||||
int io_type = ZIO_TYPES;
|
int io_type = ZINJECT_IOTYPE_ALL;
|
||||||
int action = VDEV_STATE_UNKNOWN;
|
int action = VDEV_STATE_UNKNOWN;
|
||||||
err_type_t type = TYPE_INVAL;
|
err_type_t type = TYPE_INVAL;
|
||||||
err_type_t label = TYPE_INVAL;
|
err_type_t label = TYPE_INVAL;
|
||||||
@ -1046,19 +1090,8 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
if (strcasecmp(optarg, "read") == 0) {
|
io_type = str_to_iotype(optarg);
|
||||||
io_type = ZIO_TYPE_READ;
|
if (io_type == ZINJECT_IOTYPES) {
|
||||||
} else if (strcasecmp(optarg, "write") == 0) {
|
|
||||||
io_type = ZIO_TYPE_WRITE;
|
|
||||||
} else if (strcasecmp(optarg, "free") == 0) {
|
|
||||||
io_type = ZIO_TYPE_FREE;
|
|
||||||
} else if (strcasecmp(optarg, "claim") == 0) {
|
|
||||||
io_type = ZIO_TYPE_CLAIM;
|
|
||||||
} else if (strcasecmp(optarg, "flush") == 0) {
|
|
||||||
io_type = ZIO_TYPE_FLUSH;
|
|
||||||
} else if (strcasecmp(optarg, "all") == 0) {
|
|
||||||
io_type = ZIO_TYPES;
|
|
||||||
} else {
|
|
||||||
(void) fprintf(stderr, "invalid I/O type "
|
(void) fprintf(stderr, "invalid I/O type "
|
||||||
"'%s': must be 'read', 'write', 'free', "
|
"'%s': must be 'read', 'write', 'free', "
|
||||||
"'claim', 'flush' or 'all'\n", optarg);
|
"'claim', 'flush' or 'all'\n", optarg);
|
||||||
@ -1180,7 +1213,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error == EILSEQ &&
|
if (error == EILSEQ &&
|
||||||
(record.zi_freq == 0 || io_type != ZIO_TYPE_READ)) {
|
(record.zi_freq == 0 || io_type != ZINJECT_IOTYPE_READ)) {
|
||||||
(void) fprintf(stderr, "device corrupt errors require "
|
(void) fprintf(stderr, "device corrupt errors require "
|
||||||
"io type read and a frequency value\n");
|
"io type read and a frequency value\n");
|
||||||
libzfs_fini(g_zfs);
|
libzfs_fini(g_zfs);
|
||||||
@ -1195,9 +1228,9 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (record.zi_nlanes) {
|
if (record.zi_nlanes) {
|
||||||
switch (io_type) {
|
switch (io_type) {
|
||||||
case ZIO_TYPE_READ:
|
case ZINJECT_IOTYPE_READ:
|
||||||
case ZIO_TYPE_WRITE:
|
case ZINJECT_IOTYPE_WRITE:
|
||||||
case ZIO_TYPES:
|
case ZINJECT_IOTYPE_ALL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
(void) fprintf(stderr, "I/O type for a delay "
|
(void) fprintf(stderr, "I/O type for a delay "
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -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
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -87,7 +88,8 @@
|
|||||||
|
|
||||||
typedef struct vdev_disk_db_entry
|
typedef struct vdev_disk_db_entry
|
||||||
{
|
{
|
||||||
char id[24];
|
/* 24 byte name + 1 byte NULL terminator to make GCC happy */
|
||||||
|
char id[25];
|
||||||
int sector_size;
|
int sector_size;
|
||||||
} vdev_disk_db_entry_t;
|
} vdev_disk_db_entry_t;
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -25,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>
|
||||||
@ -51,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 {
|
||||||
@ -61,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
|
||||||
@ -80,32 +83,47 @@ zpool_compare(const void *larg, const void *rarg, void *unused)
|
|||||||
* of known pools.
|
* of known pools.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
add_pool(zpool_handle_t *zhp, void *data)
|
add_pool(zpool_handle_t *zhp, zpool_list_t *zlp)
|
||||||
{
|
{
|
||||||
zpool_list_t *zlp = data;
|
zpool_node_t *node, *new = safe_malloc(sizeof (zpool_node_t));
|
||||||
zpool_node_t *node = safe_malloc(sizeof (zpool_node_t));
|
|
||||||
uu_avl_index_t idx;
|
uu_avl_index_t idx;
|
||||||
|
|
||||||
node->zn_handle = zhp;
|
new->zn_handle = zhp;
|
||||||
uu_avl_node_init(node, &node->zn_avlnode, zlp->zl_pool);
|
uu_avl_node_init(new, &new->zn_avlnode, zlp->zl_pool);
|
||||||
if (uu_avl_find(zlp->zl_avl, node, NULL, &idx) == NULL) {
|
|
||||||
|
node = uu_avl_find(zlp->zl_avl, new, NULL, &idx);
|
||||||
|
if (node == NULL) {
|
||||||
if (zlp->zl_proplist &&
|
if (zlp->zl_proplist &&
|
||||||
zpool_expand_proplist(zhp, zlp->zl_proplist,
|
zpool_expand_proplist(zhp, zlp->zl_proplist,
|
||||||
zlp->zl_type, zlp->zl_literal) != 0) {
|
zlp->zl_type, zlp->zl_literal) != 0) {
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
free(node);
|
free(new);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
uu_avl_insert(zlp->zl_avl, node, idx);
|
new->zn_last_refresh = zlp->zl_last_refresh;
|
||||||
|
uu_avl_insert(zlp->zl_avl, new, idx);
|
||||||
} else {
|
} else {
|
||||||
|
node->zn_last_refresh = zlp->zl_last_refresh;
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
free(node);
|
free(new);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* add_pool(), but always returns 0. This allows zpool_iter() to continue
|
||||||
|
* even if a pool exists in the tree, or we fail to get the properties for
|
||||||
|
* a new one.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
add_pool_cb(zpool_handle_t *zhp, void *data)
|
||||||
|
{
|
||||||
|
(void) add_pool(zhp, data);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a list of pools based on the given arguments. If we're given no
|
* Create a list of pools based on the given arguments. If we're given no
|
||||||
* arguments, then iterate over all pools in the system and add them to the AVL
|
* arguments, then iterate over all pools in the system and add them to the AVL
|
||||||
@ -134,9 +152,10 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, zfs_type_t type,
|
|||||||
zlp->zl_type = type;
|
zlp->zl_type = type;
|
||||||
|
|
||||||
zlp->zl_literal = literal;
|
zlp->zl_literal = literal;
|
||||||
|
zlp->zl_last_refresh = gethrtime();
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
(void) zpool_iter(g_zfs, add_pool, zlp);
|
(void) zpool_iter(g_zfs, add_pool_cb, zlp);
|
||||||
zlp->zl_findall = B_TRUE;
|
zlp->zl_findall = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
@ -158,15 +177,69 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, zfs_type_t type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Search for any new pools, adding them to the list. We only add pools when no
|
* Refresh the state of all pools on the list. Additionally, if no options were
|
||||||
* options were given on the command line. Otherwise, we keep the list fixed as
|
* given on the command line, add any new pools and remove any that are no
|
||||||
* those that were explicitly specified.
|
* longer available.
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
pool_list_update(zpool_list_t *zlp)
|
pool_list_refresh(zpool_list_t *zlp)
|
||||||
{
|
{
|
||||||
if (zlp->zl_findall)
|
zlp->zl_last_refresh = gethrtime();
|
||||||
(void) zpool_iter(g_zfs, add_pool, zlp);
|
|
||||||
|
if (!zlp->zl_findall) {
|
||||||
|
/*
|
||||||
|
* This list is a fixed list of pools, so we must not add
|
||||||
|
* or remove any. Just walk over them and refresh their
|
||||||
|
* state.
|
||||||
|
*/
|
||||||
|
int navail = 0;
|
||||||
|
for (zpool_node_t *node = uu_avl_first(zlp->zl_avl);
|
||||||
|
node != NULL; node = uu_avl_next(zlp->zl_avl, node)) {
|
||||||
|
boolean_t missing;
|
||||||
|
zpool_refresh_stats(node->zn_handle, &missing);
|
||||||
|
navail += !missing;
|
||||||
|
node->zn_last_refresh = zlp->zl_last_refresh;
|
||||||
|
}
|
||||||
|
return (navail);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Search for any new pools and add them to the list. zpool_iter()
|
||||||
|
* will call zpool_refresh_stats() as part of its work, so this has
|
||||||
|
* the side effect of updating all active handles.
|
||||||
|
*/
|
||||||
|
(void) zpool_iter(g_zfs, add_pool_cb, zlp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Walk the list for any that weren't refreshed, and update and remove
|
||||||
|
* them. It's not enough to just skip available ones, as zpool_iter()
|
||||||
|
* won't update them, so they'll still appear active in our list.
|
||||||
|
*/
|
||||||
|
zpool_node_t *node, *next;
|
||||||
|
for (node = uu_avl_first(zlp->zl_avl); node != NULL; node = next) {
|
||||||
|
next = uu_avl_next(zlp->zl_avl, node);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Skip any that were refreshed and are online; they're already
|
||||||
|
* handled.
|
||||||
|
*/
|
||||||
|
if (node->zn_last_refresh == zlp->zl_last_refresh &&
|
||||||
|
zpool_get_state(node->zn_handle) != POOL_STATE_UNAVAIL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Do the refresh ourselves, just in case. */
|
||||||
|
boolean_t missing;
|
||||||
|
zpool_refresh_stats(node->zn_handle, &missing);
|
||||||
|
if (missing) {
|
||||||
|
uu_avl_remove(zlp->zl_avl, node);
|
||||||
|
zpool_close(node->zn_handle);
|
||||||
|
free(node);
|
||||||
|
} else {
|
||||||
|
node->zn_last_refresh = zlp->zl_last_refresh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (uu_avl_numnodes(zlp->zl_avl));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -189,23 +262,6 @@ pool_list_iter(zpool_list_t *zlp, int unavail, zpool_iter_f func,
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Remove the given pool from the list. When running iostat, we want to remove
|
|
||||||
* those pools that no longer exist.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
pool_list_remove(zpool_list_t *zlp, zpool_handle_t *zhp)
|
|
||||||
{
|
|
||||||
zpool_node_t search, *node;
|
|
||||||
|
|
||||||
search.zn_handle = zhp;
|
|
||||||
if ((node = uu_avl_find(zlp->zl_avl, &search, NULL, NULL)) != NULL) {
|
|
||||||
uu_avl_remove(zlp->zl_avl, node);
|
|
||||||
zpool_close(node->zn_handle);
|
|
||||||
free(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free all the handles associated with this list.
|
* Free all the handles associated with this list.
|
||||||
*/
|
*/
|
||||||
@ -378,8 +434,8 @@ process_unique_cmd_columns(vdev_cmd_data_list_t *vcdl)
|
|||||||
static int
|
static int
|
||||||
vdev_process_cmd_output(vdev_cmd_data_t *data, char *line)
|
vdev_process_cmd_output(vdev_cmd_data_t *data, char *line)
|
||||||
{
|
{
|
||||||
char *col = NULL;
|
char *col;
|
||||||
char *val = line;
|
char *val;
|
||||||
char *equals;
|
char *equals;
|
||||||
char **tmp;
|
char **tmp;
|
||||||
|
|
||||||
@ -396,6 +452,7 @@ vdev_process_cmd_output(vdev_cmd_data_t *data, char *line)
|
|||||||
col = line;
|
col = line;
|
||||||
val = equals + 1;
|
val = equals + 1;
|
||||||
} else {
|
} else {
|
||||||
|
col = NULL;
|
||||||
val = line;
|
val = line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -32,8 +33,8 @@
|
|||||||
* Copyright (c) 2017, Intel Corporation.
|
* Copyright (c) 2017, Intel Corporation.
|
||||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||||
* Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
* Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
||||||
* Copyright (c) 2021, 2023, Klara Inc.
|
* Copyright (c) 2021, 2023, 2025, Klara, Inc.
|
||||||
* Copyright [2021] Hewlett Packard Enterprise Development LP
|
* Copyright (c) 2021, 2025 Hewlett Packard Enterprise Development LP.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -455,7 +456,7 @@ get_usage(zpool_help_t idx)
|
|||||||
"<pool> <vdev> ...\n"));
|
"<pool> <vdev> ...\n"));
|
||||||
case HELP_ATTACH:
|
case HELP_ATTACH:
|
||||||
return (gettext("\tattach [-fsw] [-o property=value] "
|
return (gettext("\tattach [-fsw] [-o property=value] "
|
||||||
"<pool> <device> <new-device>\n"));
|
"<pool> <vdev> <new-device>\n"));
|
||||||
case HELP_CLEAR:
|
case HELP_CLEAR:
|
||||||
return (gettext("\tclear [[--power]|[-nF]] <pool> [device]\n"));
|
return (gettext("\tclear [[--power]|[-nF]] <pool> [device]\n"));
|
||||||
case HELP_CREATE:
|
case HELP_CREATE:
|
||||||
@ -509,21 +510,22 @@ get_usage(zpool_help_t idx)
|
|||||||
case HELP_REOPEN:
|
case HELP_REOPEN:
|
||||||
return (gettext("\treopen [-n] <pool>\n"));
|
return (gettext("\treopen [-n] <pool>\n"));
|
||||||
case HELP_INITIALIZE:
|
case HELP_INITIALIZE:
|
||||||
return (gettext("\tinitialize [-c | -s | -u] [-w] <pool> "
|
return (gettext("\tinitialize [-c | -s | -u] [-w] <-a | <pool> "
|
||||||
"[<device> ...]\n"));
|
"[<device> ...]>\n"));
|
||||||
case HELP_SCRUB:
|
case HELP_SCRUB:
|
||||||
return (gettext("\tscrub [-s | -p] [-w] [-e] <pool> ...\n"));
|
return (gettext("\tscrub [-e | -s | -p | -C | -E | -S] [-w] "
|
||||||
|
"<-a | <pool> [<pool> ...]>\n"));
|
||||||
case HELP_RESILVER:
|
case HELP_RESILVER:
|
||||||
return (gettext("\tresilver <pool> ...\n"));
|
return (gettext("\tresilver <pool> ...\n"));
|
||||||
case HELP_TRIM:
|
case HELP_TRIM:
|
||||||
return (gettext("\ttrim [-dw] [-r <rate>] [-c | -s] <pool> "
|
return (gettext("\ttrim [-dw] [-r <rate>] [-c | -s] "
|
||||||
"[<device> ...]\n"));
|
"<-a | <pool> [<device> ...]>\n"));
|
||||||
case HELP_STATUS:
|
case HELP_STATUS:
|
||||||
return (gettext("\tstatus [--power] [-j [--json-int, "
|
return (gettext("\tstatus [-DdegiLPpstvx] "
|
||||||
"--json-flat-vdevs, ...\n"
|
"[-c script1[,script2,...]] ...\n"
|
||||||
"\t --json-pool-key-guid]] [-c [script1,script2,...]] "
|
"\t [-j|--json [--json-flat-vdevs] [--json-int] "
|
||||||
"[-dDegiLpPstvx] ...\n"
|
"[--json-pool-key-guid]] ...\n"
|
||||||
"\t [-T d|u] [pool] [interval [count]]\n"));
|
"\t [-T d|u] [--power] [pool] [interval [count]]\n"));
|
||||||
case HELP_UPGRADE:
|
case HELP_UPGRADE:
|
||||||
return (gettext("\tupgrade\n"
|
return (gettext("\tupgrade\n"
|
||||||
"\tupgrade -v\n"
|
"\tupgrade -v\n"
|
||||||
@ -558,33 +560,6 @@ get_usage(zpool_help_t idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
zpool_collect_leaves(zpool_handle_t *zhp, nvlist_t *nvroot, nvlist_t *res)
|
|
||||||
{
|
|
||||||
uint_t children = 0;
|
|
||||||
nvlist_t **child;
|
|
||||||
uint_t i;
|
|
||||||
|
|
||||||
(void) nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
|
|
||||||
&child, &children);
|
|
||||||
|
|
||||||
if (children == 0) {
|
|
||||||
char *path = zpool_vdev_name(g_zfs, zhp, nvroot,
|
|
||||||
VDEV_NAME_PATH);
|
|
||||||
|
|
||||||
if (strcmp(path, VDEV_TYPE_INDIRECT) != 0 &&
|
|
||||||
strcmp(path, VDEV_TYPE_HOLE) != 0)
|
|
||||||
fnvlist_add_boolean(res, path);
|
|
||||||
|
|
||||||
free(path);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < children; i++) {
|
|
||||||
zpool_collect_leaves(zhp, child[i], res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Callback routine that will print out a pool property value.
|
* Callback routine that will print out a pool property value.
|
||||||
*/
|
*/
|
||||||
@ -777,10 +752,11 @@ usage(boolean_t requested)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool initialize [-c | -s | -u] [-w] <pool> [<vdev> ...]
|
* zpool initialize [-c | -s | -u] [-w] <-a | pool> [<vdev> ...]
|
||||||
* Initialize all unused blocks in the specified vdevs, or all vdevs in the pool
|
* Initialize all unused blocks in the specified vdevs, or all vdevs in the pool
|
||||||
* if none specified.
|
* if none specified.
|
||||||
*
|
*
|
||||||
|
* -a Use all pools.
|
||||||
* -c Cancel. Ends active initializing.
|
* -c Cancel. Ends active initializing.
|
||||||
* -s Suspend. Initializing can then be restarted with no flags.
|
* -s Suspend. Initializing can then be restarted with no flags.
|
||||||
* -u Uninitialize. Clears initialization state.
|
* -u Uninitialize. Clears initialization state.
|
||||||
@ -792,22 +768,26 @@ zpool_do_initialize(int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
char *poolname;
|
char *poolname;
|
||||||
zpool_handle_t *zhp;
|
zpool_handle_t *zhp;
|
||||||
nvlist_t *vdevs;
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
boolean_t wait = B_FALSE;
|
boolean_t wait = B_FALSE;
|
||||||
|
boolean_t initialize_all = B_FALSE;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
{"cancel", no_argument, NULL, 'c'},
|
{"cancel", no_argument, NULL, 'c'},
|
||||||
{"suspend", no_argument, NULL, 's'},
|
{"suspend", no_argument, NULL, 's'},
|
||||||
{"uninit", no_argument, NULL, 'u'},
|
{"uninit", no_argument, NULL, 'u'},
|
||||||
{"wait", no_argument, NULL, 'w'},
|
{"wait", no_argument, NULL, 'w'},
|
||||||
|
{"all", no_argument, NULL, 'a'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
pool_initialize_func_t cmd_type = POOL_INITIALIZE_START;
|
pool_initialize_func_t cmd_type = POOL_INITIALIZE_START;
|
||||||
while ((c = getopt_long(argc, argv, "csuw", long_options,
|
while ((c = getopt_long(argc, argv, "acsuw", long_options,
|
||||||
NULL)) != -1) {
|
NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
case 'a':
|
||||||
|
initialize_all = B_TRUE;
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
if (cmd_type != POOL_INITIALIZE_START &&
|
if (cmd_type != POOL_INITIALIZE_START &&
|
||||||
cmd_type != POOL_INITIALIZE_CANCEL) {
|
cmd_type != POOL_INITIALIZE_CANCEL) {
|
||||||
@ -854,7 +834,18 @@ zpool_do_initialize(int argc, char **argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
if (argc < 1) {
|
initialize_cbdata_t cbdata = {
|
||||||
|
.wait = wait,
|
||||||
|
.cmd_type = cmd_type
|
||||||
|
};
|
||||||
|
|
||||||
|
if (initialize_all && argc > 0) {
|
||||||
|
(void) fprintf(stderr, gettext("-a cannot be combined with "
|
||||||
|
"individual pools or vdevs\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc < 1 && !initialize_all) {
|
||||||
(void) fprintf(stderr, gettext("missing pool name argument\n"));
|
(void) fprintf(stderr, gettext("missing pool name argument\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -866,30 +857,35 @@ zpool_do_initialize(int argc, char **argv)
|
|||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc == 0 && initialize_all) {
|
||||||
|
/* Initilize each pool recursively */
|
||||||
|
err = for_each_pool(argc, argv, B_TRUE, NULL, ZFS_TYPE_POOL,
|
||||||
|
B_FALSE, zpool_initialize_one, &cbdata);
|
||||||
|
return (err);
|
||||||
|
} else if (argc == 1) {
|
||||||
|
/* no individual leaf vdevs specified, initialize the pool */
|
||||||
poolname = argv[0];
|
poolname = argv[0];
|
||||||
zhp = zpool_open(g_zfs, poolname);
|
zhp = zpool_open(g_zfs, poolname);
|
||||||
if (zhp == NULL)
|
if (zhp == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
err = zpool_initialize_one(zhp, &cbdata);
|
||||||
vdevs = fnvlist_alloc();
|
|
||||||
if (argc == 1) {
|
|
||||||
/* no individual leaf vdevs specified, so add them all */
|
|
||||||
nvlist_t *config = zpool_get_config(zhp, NULL);
|
|
||||||
nvlist_t *nvroot = fnvlist_lookup_nvlist(config,
|
|
||||||
ZPOOL_CONFIG_VDEV_TREE);
|
|
||||||
zpool_collect_leaves(zhp, nvroot, vdevs);
|
|
||||||
} else {
|
} else {
|
||||||
|
/* individual leaf vdevs specified, initialize them */
|
||||||
|
poolname = argv[0];
|
||||||
|
zhp = zpool_open(g_zfs, poolname);
|
||||||
|
if (zhp == NULL)
|
||||||
|
return (-1);
|
||||||
|
nvlist_t *vdevs = fnvlist_alloc();
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
fnvlist_add_boolean(vdevs, argv[i]);
|
fnvlist_add_boolean(vdevs, argv[i]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (wait)
|
if (wait)
|
||||||
err = zpool_initialize_wait(zhp, cmd_type, vdevs);
|
err = zpool_initialize_wait(zhp, cmd_type, vdevs);
|
||||||
else
|
else
|
||||||
err = zpool_initialize(zhp, cmd_type, vdevs);
|
err = zpool_initialize(zhp, cmd_type, vdevs);
|
||||||
|
|
||||||
fnvlist_free(vdevs);
|
fnvlist_free(vdevs);
|
||||||
|
}
|
||||||
|
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
|
|
||||||
return (err);
|
return (err);
|
||||||
@ -1786,7 +1782,7 @@ zpool_do_labelclear(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
char vdev[MAXPATHLEN];
|
char vdev[MAXPATHLEN];
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
int c, fd = -1, ret = 0;
|
int c, fd, ret = 0;
|
||||||
nvlist_t *config;
|
nvlist_t *config;
|
||||||
pool_state_t state;
|
pool_state_t state;
|
||||||
boolean_t inuse = B_FALSE;
|
boolean_t inuse = B_FALSE;
|
||||||
@ -5765,24 +5761,6 @@ children:
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
refresh_iostat(zpool_handle_t *zhp, void *data)
|
|
||||||
{
|
|
||||||
iostat_cbdata_t *cb = data;
|
|
||||||
boolean_t missing;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the pool has disappeared, remove it from the list and continue.
|
|
||||||
*/
|
|
||||||
if (zpool_refresh_stats(zhp, &missing) != 0)
|
|
||||||
return (-1);
|
|
||||||
|
|
||||||
if (missing)
|
|
||||||
pool_list_remove(cb->cb_list, zhp);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Callback to print out the iostats for the given pool.
|
* Callback to print out the iostats for the given pool.
|
||||||
*/
|
*/
|
||||||
@ -6155,7 +6133,6 @@ static void
|
|||||||
get_interval_count_filter_guids(int *argc, char **argv, float *interval,
|
get_interval_count_filter_guids(int *argc, char **argv, float *interval,
|
||||||
unsigned long *count, iostat_cbdata_t *cb)
|
unsigned long *count, iostat_cbdata_t *cb)
|
||||||
{
|
{
|
||||||
char **tmpargv = argv;
|
|
||||||
int argc_for_interval = 0;
|
int argc_for_interval = 0;
|
||||||
|
|
||||||
/* Is the last arg an interval value? Or a guid? */
|
/* Is the last arg an interval value? Or a guid? */
|
||||||
@ -6179,7 +6156,7 @@ get_interval_count_filter_guids(int *argc, char **argv, float *interval,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Point to our list of possible intervals */
|
/* Point to our list of possible intervals */
|
||||||
tmpargv = &argv[*argc - argc_for_interval];
|
char **tmpargv = &argv[*argc - argc_for_interval];
|
||||||
|
|
||||||
*argc = *argc - argc_for_interval;
|
*argc = *argc - argc_for_interval;
|
||||||
get_interval_count(&argc_for_interval, tmpargv,
|
get_interval_count(&argc_for_interval, tmpargv,
|
||||||
@ -6364,18 +6341,16 @@ get_namewidth_iostat(zpool_handle_t *zhp, void *data)
|
|||||||
* This command can be tricky because we want to be able to deal with pool
|
* This command can be tricky because we want to be able to deal with pool
|
||||||
* creation/destruction as well as vdev configuration changes. The bulk of this
|
* creation/destruction as well as vdev configuration changes. The bulk of this
|
||||||
* processing is handled by the pool_list_* routines in zpool_iter.c. We rely
|
* processing is handled by the pool_list_* routines in zpool_iter.c. We rely
|
||||||
* on pool_list_update() to detect the addition of new pools. Configuration
|
* on pool_list_refresh() to detect the addition and removal of pools.
|
||||||
* changes are all handled within libzfs.
|
* Configuration changes are all handled within libzfs.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
zpool_do_iostat(int argc, char **argv)
|
zpool_do_iostat(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
int ret;
|
int ret;
|
||||||
int npools;
|
|
||||||
float interval = 0;
|
float interval = 0;
|
||||||
unsigned long count = 0;
|
unsigned long count = 0;
|
||||||
int winheight = 24;
|
|
||||||
zpool_list_t *list;
|
zpool_list_t *list;
|
||||||
boolean_t verbose = B_FALSE;
|
boolean_t verbose = B_FALSE;
|
||||||
boolean_t latency = B_FALSE, l_histo = B_FALSE, rq_histo = B_FALSE;
|
boolean_t latency = B_FALSE, l_histo = B_FALSE, rq_histo = B_FALSE;
|
||||||
@ -6624,10 +6599,24 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int last_npools = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if ((npools = pool_list_count(list)) == 0)
|
/*
|
||||||
|
* Refresh all pools in list, adding or removing pools as
|
||||||
|
* necessary.
|
||||||
|
*/
|
||||||
|
int npools = pool_list_refresh(list);
|
||||||
|
if (npools == 0) {
|
||||||
(void) fprintf(stderr, gettext("no pools available\n"));
|
(void) fprintf(stderr, gettext("no pools available\n"));
|
||||||
else {
|
} else {
|
||||||
|
/*
|
||||||
|
* If the list of pools has changed since last time
|
||||||
|
* around, reset the iteration count to force the
|
||||||
|
* header to be redisplayed.
|
||||||
|
*/
|
||||||
|
if (last_npools != npools)
|
||||||
|
cb.cb_iteration = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is the first iteration and -y was supplied
|
* If this is the first iteration and -y was supplied
|
||||||
* we skip any printing.
|
* we skip any printing.
|
||||||
@ -6635,15 +6624,6 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
boolean_t skip = (omit_since_boot &&
|
boolean_t skip = (omit_since_boot &&
|
||||||
cb.cb_iteration == 0);
|
cb.cb_iteration == 0);
|
||||||
|
|
||||||
/*
|
|
||||||
* Refresh all statistics. This is done as an
|
|
||||||
* explicit step before calculating the maximum name
|
|
||||||
* width, so that any * configuration changes are
|
|
||||||
* properly accounted for.
|
|
||||||
*/
|
|
||||||
(void) pool_list_iter(list, B_FALSE, refresh_iostat,
|
|
||||||
&cb);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterate over all pools to determine the maximum width
|
* Iterate over all pools to determine the maximum width
|
||||||
* for the pool / device name column across all pools.
|
* for the pool / device name column across all pools.
|
||||||
@ -6671,7 +6651,7 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
* even when terminal window has its height
|
* even when terminal window has its height
|
||||||
* changed.
|
* changed.
|
||||||
*/
|
*/
|
||||||
winheight = terminal_height();
|
int winheight = terminal_height();
|
||||||
/*
|
/*
|
||||||
* Are we connected to TTY? If not, headers_once
|
* Are we connected to TTY? If not, headers_once
|
||||||
* should be true, to avoid breaking scripts.
|
* should be true, to avoid breaking scripts.
|
||||||
@ -6734,6 +6714,8 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
|
|
||||||
(void) fflush(stdout);
|
(void) fflush(stdout);
|
||||||
(void) fsleep(interval);
|
(void) fsleep(interval);
|
||||||
|
|
||||||
|
last_npools = npools;
|
||||||
}
|
}
|
||||||
|
|
||||||
pool_list_free(list);
|
pool_list_free(list);
|
||||||
@ -6882,8 +6864,13 @@ collect_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
|
|||||||
if (cb->cb_json) {
|
if (cb->cb_json) {
|
||||||
if (pl->pl_prop == ZPOOL_PROP_NAME)
|
if (pl->pl_prop == ZPOOL_PROP_NAME)
|
||||||
continue;
|
continue;
|
||||||
|
const char *prop_name;
|
||||||
|
if (pl->pl_prop != ZPROP_USERPROP)
|
||||||
|
prop_name = zpool_prop_to_name(pl->pl_prop);
|
||||||
|
else
|
||||||
|
prop_name = pl->pl_user_prop;
|
||||||
(void) zprop_nvlist_one_property(
|
(void) zprop_nvlist_one_property(
|
||||||
zpool_prop_to_name(pl->pl_prop), propstr,
|
prop_name, propstr,
|
||||||
sourcetype, NULL, NULL, props, cb->cb_json_as_int);
|
sourcetype, NULL, NULL, props, cb->cb_json_as_int);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@ -7340,6 +7327,7 @@ zpool_do_list(int argc, char **argv)
|
|||||||
current_prop_type = ZFS_TYPE_POOL;
|
current_prop_type = ZFS_TYPE_POOL;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
||||||
{"json-pool-key-guid", no_argument, NULL,
|
{"json-pool-key-guid", no_argument, NULL,
|
||||||
ZPOOL_OPTION_POOL_KEY_GUID},
|
ZPOOL_OPTION_POOL_KEY_GUID},
|
||||||
@ -7644,7 +7632,7 @@ zpool_do_replace(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool attach [-fsw] [-o property=value] <pool> <device>|<vdev> <new_device>
|
* zpool attach [-fsw] [-o property=value] <pool> <vdev> <new_device>
|
||||||
*
|
*
|
||||||
* -f Force attach, even if <new_device> appears to be in use.
|
* -f Force attach, even if <new_device> appears to be in use.
|
||||||
* -s Use sequential instead of healing reconstruction for resilver.
|
* -s Use sequential instead of healing reconstruction for resilver.
|
||||||
@ -7652,9 +7640,9 @@ zpool_do_replace(int argc, char **argv)
|
|||||||
* -w Wait for resilvering (mirror) or expansion (raidz) to complete
|
* -w Wait for resilvering (mirror) or expansion (raidz) to complete
|
||||||
* before returning.
|
* before returning.
|
||||||
*
|
*
|
||||||
* Attach <new_device> to a <device> or <vdev>, where the vdev can be of type
|
* Attach <new_device> to a <vdev>, where the vdev can be of type
|
||||||
* mirror or raidz. If <device> is not part of a mirror, then <device> will
|
* device, mirror or raidz. If <vdev> is not part of a mirror, then <vdev> will
|
||||||
* be transformed into a mirror of <device> and <new_device>. When a mirror
|
* be transformed into a mirror of <vdev> and <new_device>. When a mirror
|
||||||
* is involved, <new_device> will begin life with a DTL of [0, now], and will
|
* is involved, <new_device> will begin life with a DTL of [0, now], and will
|
||||||
* immediately begin to resilver itself. For the raidz case, a expansion will
|
* immediately begin to resilver itself. For the raidz case, a expansion will
|
||||||
* commence and reflow the raidz data across all the disks including the
|
* commence and reflow the raidz data across all the disks including the
|
||||||
@ -7965,8 +7953,11 @@ zpool_do_online(int argc, char **argv)
|
|||||||
|
|
||||||
poolname = argv[0];
|
poolname = argv[0];
|
||||||
|
|
||||||
if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
|
if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
|
||||||
|
(void) fprintf(stderr, gettext("failed to open pool "
|
||||||
|
"\"%s\""), poolname);
|
||||||
return (1);
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
vdev_state_t oldstate;
|
vdev_state_t oldstate;
|
||||||
@ -7987,12 +7978,15 @@ zpool_do_online(int argc, char **argv)
|
|||||||
&l2cache, NULL);
|
&l2cache, NULL);
|
||||||
if (tgt == NULL) {
|
if (tgt == NULL) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
(void) fprintf(stderr, gettext("couldn't find device "
|
||||||
|
"\"%s\" in pool \"%s\"\n"), argv[i], poolname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
uint_t vsc;
|
uint_t vsc;
|
||||||
oldstate = ((vdev_stat_t *)fnvlist_lookup_uint64_array(tgt,
|
oldstate = ((vdev_stat_t *)fnvlist_lookup_uint64_array(tgt,
|
||||||
ZPOOL_CONFIG_VDEV_STATS, &vsc))->vs_state;
|
ZPOOL_CONFIG_VDEV_STATS, &vsc))->vs_state;
|
||||||
if (zpool_vdev_online(zhp, argv[i], flags, &newstate) == 0) {
|
if ((rc = zpool_vdev_online(zhp, argv[i], flags,
|
||||||
|
&newstate)) == 0) {
|
||||||
if (newstate != VDEV_STATE_HEALTHY) {
|
if (newstate != VDEV_STATE_HEALTHY) {
|
||||||
(void) printf(gettext("warning: device '%s' "
|
(void) printf(gettext("warning: device '%s' "
|
||||||
"onlined, but remains in faulted state\n"),
|
"onlined, but remains in faulted state\n"),
|
||||||
@ -8018,6 +8012,9 @@ zpool_do_online(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
(void) fprintf(stderr, gettext("Failed to online "
|
||||||
|
"\"%s\" in pool \"%s\": %d\n"),
|
||||||
|
argv[i], poolname, rc);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8102,8 +8099,11 @@ zpool_do_offline(int argc, char **argv)
|
|||||||
|
|
||||||
poolname = argv[0];
|
poolname = argv[0];
|
||||||
|
|
||||||
if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
|
if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
|
||||||
|
(void) fprintf(stderr, gettext("failed to open pool "
|
||||||
|
"\"%s\""), poolname);
|
||||||
return (1);
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
uint64_t guid = zpool_vdev_path_to_guid(zhp, argv[i]);
|
uint64_t guid = zpool_vdev_path_to_guid(zhp, argv[i]);
|
||||||
@ -8348,6 +8348,8 @@ zpool_do_reopen(int argc, char **argv)
|
|||||||
typedef struct scrub_cbdata {
|
typedef struct scrub_cbdata {
|
||||||
int cb_type;
|
int cb_type;
|
||||||
pool_scrub_cmd_t cb_scrub_cmd;
|
pool_scrub_cmd_t cb_scrub_cmd;
|
||||||
|
time_t cb_date_start;
|
||||||
|
time_t cb_date_end;
|
||||||
} scrub_cbdata_t;
|
} scrub_cbdata_t;
|
||||||
|
|
||||||
static boolean_t
|
static boolean_t
|
||||||
@ -8391,8 +8393,8 @@ scrub_callback(zpool_handle_t *zhp, void *data)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = zpool_scan(zhp, cb->cb_type, cb->cb_scrub_cmd);
|
err = zpool_scan_range(zhp, cb->cb_type, cb->cb_scrub_cmd,
|
||||||
|
cb->cb_date_start, cb->cb_date_end);
|
||||||
if (err == 0 && zpool_has_checkpoint(zhp) &&
|
if (err == 0 && zpool_has_checkpoint(zhp) &&
|
||||||
cb->cb_type == POOL_SCAN_SCRUB) {
|
cb->cb_type == POOL_SCAN_SCRUB) {
|
||||||
(void) printf(gettext("warning: will not scrub state that "
|
(void) printf(gettext("warning: will not scrub state that "
|
||||||
@ -8410,13 +8412,39 @@ wait_callback(zpool_handle_t *zhp, void *data)
|
|||||||
return (zpool_wait(zhp, *act));
|
return (zpool_wait(zhp, *act));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static time_t
|
||||||
|
date_string_to_sec(const char *timestr, boolean_t rounding)
|
||||||
|
{
|
||||||
|
struct tm tm = {0};
|
||||||
|
int adjustment = rounding ? 1 : 0;
|
||||||
|
|
||||||
|
/* Allow mktime to determine timezone. */
|
||||||
|
tm.tm_isdst = -1;
|
||||||
|
|
||||||
|
if (strptime(timestr, "%Y-%m-%d %H:%M", &tm) == NULL) {
|
||||||
|
if (strptime(timestr, "%Y-%m-%d", &tm) == NULL) {
|
||||||
|
fprintf(stderr, gettext("Failed to parse the date.\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
adjustment *= 24 * 60 * 60;
|
||||||
|
} else {
|
||||||
|
adjustment *= 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (mktime(&tm) + adjustment);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool scrub [-s | -p] [-w] [-e] <pool> ...
|
* zpool scrub [-e | -s | -p | -C | -E | -S] [-w] [-a | <pool> ...]
|
||||||
*
|
*
|
||||||
|
* -a Scrub all pools.
|
||||||
* -e Only scrub blocks in the error log.
|
* -e Only scrub blocks in the error log.
|
||||||
|
* -E End date of scrub.
|
||||||
|
* -S Start date of scrub.
|
||||||
* -s Stop. Stops any in-progress scrub.
|
* -s Stop. Stops any in-progress scrub.
|
||||||
* -p Pause. Pause in-progress scrub.
|
* -p Pause. Pause in-progress scrub.
|
||||||
* -w Wait. Blocks until scrub has completed.
|
* -w Wait. Blocks until scrub has completed.
|
||||||
|
* -C Scrub from last saved txg.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
zpool_do_scrub(int argc, char **argv)
|
zpool_do_scrub(int argc, char **argv)
|
||||||
@ -8428,26 +8456,45 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
|
|
||||||
cb.cb_type = POOL_SCAN_SCRUB;
|
cb.cb_type = POOL_SCAN_SCRUB;
|
||||||
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
||||||
|
cb.cb_date_start = cb.cb_date_end = 0;
|
||||||
|
|
||||||
boolean_t is_error_scrub = B_FALSE;
|
boolean_t is_error_scrub = B_FALSE;
|
||||||
boolean_t is_pause = B_FALSE;
|
boolean_t is_pause = B_FALSE;
|
||||||
boolean_t is_stop = B_FALSE;
|
boolean_t is_stop = B_FALSE;
|
||||||
|
boolean_t is_txg_continue = B_FALSE;
|
||||||
|
boolean_t scrub_all = B_FALSE;
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, "spwe")) != -1) {
|
while ((c = getopt(argc, argv, "aspweCE:S:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
case 'a':
|
||||||
|
scrub_all = B_TRUE;
|
||||||
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
is_error_scrub = B_TRUE;
|
is_error_scrub = B_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'E':
|
||||||
|
/*
|
||||||
|
* Round the date. It's better to scrub more data than
|
||||||
|
* less. This also makes the date inclusive.
|
||||||
|
*/
|
||||||
|
cb.cb_date_end = date_string_to_sec(optarg, B_TRUE);
|
||||||
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
is_stop = B_TRUE;
|
is_stop = B_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'S':
|
||||||
|
cb.cb_date_start = date_string_to_sec(optarg, B_FALSE);
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
is_pause = B_TRUE;
|
is_pause = B_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
wait = B_TRUE;
|
wait = B_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
is_txg_continue = B_TRUE;
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||||
optopt);
|
optopt);
|
||||||
@ -8459,6 +8506,18 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
(void) fprintf(stderr, gettext("invalid option "
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
"combination: -s and -p are mutually exclusive\n"));
|
"combination: -s and -p are mutually exclusive\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
|
} else if (is_pause && is_txg_continue) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
|
"combination: -p and -C are mutually exclusive\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
} else if (is_stop && is_txg_continue) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
|
"combination: -s and -C are mutually exclusive\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
} else if (is_error_scrub && is_txg_continue) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid option "
|
||||||
|
"combination: -e and -C are mutually exclusive\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
} else {
|
} else {
|
||||||
if (is_error_scrub)
|
if (is_error_scrub)
|
||||||
cb.cb_type = POOL_SCAN_ERRORSCRUB;
|
cb.cb_type = POOL_SCAN_ERRORSCRUB;
|
||||||
@ -8467,11 +8526,26 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
cb.cb_scrub_cmd = POOL_SCRUB_PAUSE;
|
cb.cb_scrub_cmd = POOL_SCRUB_PAUSE;
|
||||||
} else if (is_stop) {
|
} else if (is_stop) {
|
||||||
cb.cb_type = POOL_SCAN_NONE;
|
cb.cb_type = POOL_SCAN_NONE;
|
||||||
|
} else if (is_txg_continue) {
|
||||||
|
cb.cb_scrub_cmd = POOL_SCRUB_FROM_LAST_TXG;
|
||||||
} else {
|
} else {
|
||||||
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((cb.cb_date_start != 0 || cb.cb_date_end != 0) &&
|
||||||
|
cb.cb_scrub_cmd != POOL_SCRUB_NORMAL) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid option combination: "
|
||||||
|
"start/end date is available only with normal scrub\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
if (cb.cb_date_start != 0 && cb.cb_date_end != 0 &&
|
||||||
|
cb.cb_date_start > cb.cb_date_end) {
|
||||||
|
(void) fprintf(stderr, gettext("invalid arguments: "
|
||||||
|
"end date has to be later than start date\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if (wait && (cb.cb_type == POOL_SCAN_NONE ||
|
if (wait && (cb.cb_type == POOL_SCAN_NONE ||
|
||||||
cb.cb_scrub_cmd == POOL_SCRUB_PAUSE)) {
|
cb.cb_scrub_cmd == POOL_SCRUB_PAUSE)) {
|
||||||
(void) fprintf(stderr, gettext("invalid option combination: "
|
(void) fprintf(stderr, gettext("invalid option combination: "
|
||||||
@ -8482,7 +8556,7 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
if (argc < 1) {
|
if (argc < 1 && !scrub_all) {
|
||||||
(void) fprintf(stderr, gettext("missing pool name argument\n"));
|
(void) fprintf(stderr, gettext("missing pool name argument\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
@ -8512,6 +8586,7 @@ zpool_do_resilver(int argc, char **argv)
|
|||||||
|
|
||||||
cb.cb_type = POOL_SCAN_RESILVER;
|
cb.cb_type = POOL_SCAN_RESILVER;
|
||||||
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
|
||||||
|
cb.cb_date_start = cb.cb_date_end = 0;
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, "")) != -1) {
|
while ((c = getopt(argc, argv, "")) != -1) {
|
||||||
@ -8536,8 +8611,9 @@ zpool_do_resilver(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool trim [-d] [-r <rate>] [-c | -s] <pool> [<device> ...]
|
* zpool trim [-d] [-r <rate>] [-c | -s] <-a | pool> [<device> ...]
|
||||||
*
|
*
|
||||||
|
* -a Trim all pools.
|
||||||
* -c Cancel. Ends any in-progress trim.
|
* -c Cancel. Ends any in-progress trim.
|
||||||
* -d Secure trim. Requires kernel and device support.
|
* -d Secure trim. Requires kernel and device support.
|
||||||
* -r <rate> Sets the TRIM rate in bytes (per second). Supports
|
* -r <rate> Sets the TRIM rate in bytes (per second). Supports
|
||||||
@ -8554,6 +8630,7 @@ zpool_do_trim(int argc, char **argv)
|
|||||||
{"rate", required_argument, NULL, 'r'},
|
{"rate", required_argument, NULL, 'r'},
|
||||||
{"suspend", no_argument, NULL, 's'},
|
{"suspend", no_argument, NULL, 's'},
|
||||||
{"wait", no_argument, NULL, 'w'},
|
{"wait", no_argument, NULL, 'w'},
|
||||||
|
{"all", no_argument, NULL, 'a'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -8561,11 +8638,16 @@ zpool_do_trim(int argc, char **argv)
|
|||||||
uint64_t rate = 0;
|
uint64_t rate = 0;
|
||||||
boolean_t secure = B_FALSE;
|
boolean_t secure = B_FALSE;
|
||||||
boolean_t wait = B_FALSE;
|
boolean_t wait = B_FALSE;
|
||||||
|
boolean_t trimall = B_FALSE;
|
||||||
|
int error;
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt_long(argc, argv, "cdr:sw", long_options, NULL))
|
while ((c = getopt_long(argc, argv, "acdr:sw", long_options, NULL))
|
||||||
!= -1) {
|
!= -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
case 'a':
|
||||||
|
trimall = B_TRUE;
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
if (cmd_type != POOL_TRIM_START &&
|
if (cmd_type != POOL_TRIM_START &&
|
||||||
cmd_type != POOL_TRIM_CANCEL) {
|
cmd_type != POOL_TRIM_CANCEL) {
|
||||||
@ -8624,7 +8706,18 @@ zpool_do_trim(int argc, char **argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
if (argc < 1) {
|
trimflags_t trim_flags = {
|
||||||
|
.secure = secure,
|
||||||
|
.rate = rate,
|
||||||
|
.wait = wait,
|
||||||
|
};
|
||||||
|
|
||||||
|
trim_cbdata_t cbdata = {
|
||||||
|
.trim_flags = trim_flags,
|
||||||
|
.cmd_type = cmd_type
|
||||||
|
};
|
||||||
|
|
||||||
|
if (argc < 1 && !trimall) {
|
||||||
(void) fprintf(stderr, gettext("missing pool name argument\n"));
|
(void) fprintf(stderr, gettext("missing pool name argument\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -8632,40 +8725,45 @@ zpool_do_trim(int argc, char **argv)
|
|||||||
|
|
||||||
if (wait && (cmd_type != POOL_TRIM_START)) {
|
if (wait && (cmd_type != POOL_TRIM_START)) {
|
||||||
(void) fprintf(stderr, gettext("-w cannot be used with -c or "
|
(void) fprintf(stderr, gettext("-w cannot be used with -c or "
|
||||||
"-s\n"));
|
"-s options\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (trimall && argc > 0) {
|
||||||
|
(void) fprintf(stderr, gettext("-a cannot be combined with "
|
||||||
|
"individual zpools or vdevs\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc == 0 && trimall) {
|
||||||
|
cbdata.trim_flags.fullpool = B_TRUE;
|
||||||
|
/* Trim each pool recursively */
|
||||||
|
error = for_each_pool(argc, argv, B_TRUE, NULL, ZFS_TYPE_POOL,
|
||||||
|
B_FALSE, zpool_trim_one, &cbdata);
|
||||||
|
} else if (argc == 1) {
|
||||||
char *poolname = argv[0];
|
char *poolname = argv[0];
|
||||||
zpool_handle_t *zhp = zpool_open(g_zfs, poolname);
|
zpool_handle_t *zhp = zpool_open(g_zfs, poolname);
|
||||||
if (zhp == NULL)
|
if (zhp == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
trimflags_t trim_flags = {
|
|
||||||
.secure = secure,
|
|
||||||
.rate = rate,
|
|
||||||
.wait = wait,
|
|
||||||
};
|
|
||||||
|
|
||||||
nvlist_t *vdevs = fnvlist_alloc();
|
|
||||||
if (argc == 1) {
|
|
||||||
/* no individual leaf vdevs specified, so add them all */
|
/* no individual leaf vdevs specified, so add them all */
|
||||||
nvlist_t *config = zpool_get_config(zhp, NULL);
|
error = zpool_trim_one(zhp, &cbdata);
|
||||||
nvlist_t *nvroot = fnvlist_lookup_nvlist(config,
|
zpool_close(zhp);
|
||||||
ZPOOL_CONFIG_VDEV_TREE);
|
|
||||||
zpool_collect_leaves(zhp, nvroot, vdevs);
|
|
||||||
trim_flags.fullpool = B_TRUE;
|
|
||||||
} else {
|
} else {
|
||||||
trim_flags.fullpool = B_FALSE;
|
char *poolname = argv[0];
|
||||||
|
zpool_handle_t *zhp = zpool_open(g_zfs, poolname);
|
||||||
|
if (zhp == NULL)
|
||||||
|
return (-1);
|
||||||
|
/* leaf vdevs specified, trim only those */
|
||||||
|
cbdata.trim_flags.fullpool = B_FALSE;
|
||||||
|
nvlist_t *vdevs = fnvlist_alloc();
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
fnvlist_add_boolean(vdevs, argv[i]);
|
fnvlist_add_boolean(vdevs, argv[i]);
|
||||||
}
|
}
|
||||||
}
|
error = zpool_trim(zhp, cbdata.cmd_type, vdevs,
|
||||||
|
&cbdata.trim_flags);
|
||||||
int error = zpool_trim(zhp, cmd_type, vdevs, &trim_flags);
|
|
||||||
|
|
||||||
fnvlist_free(vdevs);
|
fnvlist_free(vdevs);
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
|
}
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
@ -9224,6 +9322,12 @@ vdev_stats_nvlist(zpool_handle_t *zhp, status_cbdata_t *cb, nvlist_t *nv,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cb->cb_print_dio_verify) {
|
||||||
|
nice_num_str_nvlist(vds, "dio_verify_errors",
|
||||||
|
vs->vs_dio_verify_errors, cb->cb_literal,
|
||||||
|
cb->cb_json_as_int, ZFS_NICENUM_1024);
|
||||||
|
}
|
||||||
|
|
||||||
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
|
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
|
||||||
¬present) == 0) {
|
¬present) == 0) {
|
||||||
nice_num_str_nvlist(vds, ZPOOL_CONFIG_NOT_PRESENT,
|
nice_num_str_nvlist(vds, ZPOOL_CONFIG_NOT_PRESENT,
|
||||||
@ -10010,9 +10114,8 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
|||||||
(void) printf(gettext("Removal of %s canceled on %s"),
|
(void) printf(gettext("Removal of %s canceled on %s"),
|
||||||
vdev_name, ctime(&end));
|
vdev_name, ctime(&end));
|
||||||
} else {
|
} else {
|
||||||
uint64_t copied, total, elapsed, mins_left, hours_left;
|
uint64_t copied, total, elapsed, rate, mins_left, hours_left;
|
||||||
double fraction_done;
|
double fraction_done;
|
||||||
uint_t rate;
|
|
||||||
|
|
||||||
assert(prs->prs_state == DSS_SCANNING);
|
assert(prs->prs_state == DSS_SCANNING);
|
||||||
|
|
||||||
@ -10108,9 +10211,8 @@ print_raidz_expand_status(zpool_handle_t *zhp, pool_raidz_expand_stat_t *pres)
|
|||||||
copied_buf, time_buf, ctime((time_t *)&end));
|
copied_buf, time_buf, ctime((time_t *)&end));
|
||||||
} else {
|
} else {
|
||||||
char examined_buf[7], total_buf[7], rate_buf[7];
|
char examined_buf[7], total_buf[7], rate_buf[7];
|
||||||
uint64_t copied, total, elapsed, secs_left;
|
uint64_t copied, total, elapsed, rate, secs_left;
|
||||||
double fraction_done;
|
double fraction_done;
|
||||||
uint_t rate;
|
|
||||||
|
|
||||||
assert(pres->pres_state == DSS_SCANNING);
|
assert(pres->pres_state == DSS_SCANNING);
|
||||||
|
|
||||||
@ -10389,10 +10491,9 @@ print_status_reason(zpool_handle_t *zhp, status_cbdata_t *cbp,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ZPOOL_STATUS_REMOVED_DEV:
|
case ZPOOL_STATUS_REMOVED_DEV:
|
||||||
snprintf(status, ST_SIZE, gettext("One or more devices has "
|
snprintf(status, ST_SIZE, gettext("One or more devices have "
|
||||||
"been removed by the administrator.\n\tSufficient "
|
"been removed.\n\tSufficient replicas exist for the pool "
|
||||||
"replicas exist for the pool to continue functioning in "
|
"to continue functioning in a\n\tdegraded state.\n"));
|
||||||
"a\n\tdegraded state.\n"));
|
|
||||||
snprintf(action, AC_SIZE, gettext("Online the device "
|
snprintf(action, AC_SIZE, gettext("Online the device "
|
||||||
"using zpool online' or replace the device with\n\t'zpool "
|
"using zpool online' or replace the device with\n\t'zpool "
|
||||||
"replace'.\n"));
|
"replace'.\n"));
|
||||||
@ -10664,7 +10765,6 @@ status_callback_json(zpool_handle_t *zhp, void *data)
|
|||||||
uint_t c;
|
uint_t c;
|
||||||
vdev_stat_t *vs;
|
vdev_stat_t *vs;
|
||||||
nvlist_t *item, *d, *load_info, *vds;
|
nvlist_t *item, *d, *load_info, *vds;
|
||||||
item = d = NULL;
|
|
||||||
|
|
||||||
/* If dedup stats were requested, also fetch dedupcached. */
|
/* If dedup stats were requested, also fetch dedupcached. */
|
||||||
if (cbp->cb_dedup_stats > 1)
|
if (cbp->cb_dedup_stats > 1)
|
||||||
@ -10937,28 +11037,30 @@ status_callback(zpool_handle_t *zhp, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool status [-c [script1,script2,...]] [-dDegiLpPstvx] [--power] ...
|
* zpool status [-dDegiLpPstvx] [-c [script1,script2,...]] ...
|
||||||
* [-T d|u] [pool] [interval [count]]
|
* [-j|--json [--json-flat-vdevs] [--json-int] ...
|
||||||
|
* [--json-pool-key-guid]] [--power] [-T d|u] ...
|
||||||
|
* [pool] [interval [count]]
|
||||||
*
|
*
|
||||||
* -c CMD For each vdev, run command CMD
|
* -c CMD For each vdev, run command CMD
|
||||||
* -d Display Direct I/O write verify errors
|
|
||||||
* -D Display dedup status (undocumented)
|
* -D Display dedup status (undocumented)
|
||||||
|
* -d Display Direct I/O write verify errors
|
||||||
* -e Display only unhealthy vdevs
|
* -e Display only unhealthy vdevs
|
||||||
* -g Display guid for individual vdev name.
|
* -g Display guid for individual vdev name.
|
||||||
* -i Display vdev initialization status.
|
* -i Display vdev initialization status.
|
||||||
|
* -j [...] Display output in JSON format
|
||||||
|
* --json-flat-vdevs Display vdevs in flat hierarchy
|
||||||
|
* --json-int Display numbers in integer format instead of string
|
||||||
|
* --json-pool-key-guid Use pool GUID as key for pool objects
|
||||||
* -L Follow links when resolving vdev path name.
|
* -L Follow links when resolving vdev path name.
|
||||||
* -p Display values in parsable (exact) format.
|
|
||||||
* -P Display full path for vdev name.
|
* -P Display full path for vdev name.
|
||||||
|
* -p Display values in parsable (exact) format.
|
||||||
|
* --power Display vdev enclosure slot power status
|
||||||
* -s Display slow IOs column.
|
* -s Display slow IOs column.
|
||||||
* -t Display vdev TRIM status.
|
|
||||||
* -T Display a timestamp in date(1) or Unix format
|
* -T Display a timestamp in date(1) or Unix format
|
||||||
|
* -t Display vdev TRIM status.
|
||||||
* -v Display complete error logs
|
* -v Display complete error logs
|
||||||
* -x Display only pools with potential problems
|
* -x Display only pools with potential problems
|
||||||
* -j Display output in JSON format
|
|
||||||
* --power Display vdev enclosure slot power status
|
|
||||||
* --json-int Display numbers in inteeger format instead of string
|
|
||||||
* --json-flat-vdevs Display vdevs in flat hierarchy
|
|
||||||
* --json-pool-key-guid Use pool GUID as key for pool objects
|
|
||||||
*
|
*
|
||||||
* Describes the health status of all pools or some subset.
|
* Describes the health status of all pools or some subset.
|
||||||
*/
|
*/
|
||||||
@ -10975,6 +11077,7 @@ zpool_do_status(int argc, char **argv)
|
|||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
||||||
{"json-flat-vdevs", no_argument, NULL,
|
{"json-flat-vdevs", no_argument, NULL,
|
||||||
ZPOOL_OPTION_JSON_FLAT_VDEVS},
|
ZPOOL_OPTION_JSON_FLAT_VDEVS},
|
||||||
@ -11285,7 +11388,8 @@ upgrade_enable_all(zpool_handle_t *zhp, int *countp)
|
|||||||
const char *fname = spa_feature_table[i].fi_uname;
|
const char *fname = spa_feature_table[i].fi_uname;
|
||||||
const char *fguid = spa_feature_table[i].fi_guid;
|
const char *fguid = spa_feature_table[i].fi_guid;
|
||||||
|
|
||||||
if (!spa_feature_table[i].fi_zfs_mod_supported)
|
if (!spa_feature_table[i].fi_zfs_mod_supported ||
|
||||||
|
(spa_feature_table[i].fi_flags & ZFEATURE_FLAG_NO_UPGRADE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!nvlist_exists(enabled, fguid) && requested_features[i]) {
|
if (!nvlist_exists(enabled, fguid) && requested_features[i]) {
|
||||||
@ -11440,7 +11544,11 @@ upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg)
|
|||||||
"Note that the pool "
|
"Note that the pool "
|
||||||
"'compatibility' feature can be "
|
"'compatibility' feature can be "
|
||||||
"used to inhibit\nfeature "
|
"used to inhibit\nfeature "
|
||||||
"upgrades.\n\n"));
|
"upgrades.\n\n"
|
||||||
|
"Features marked with (*) are not "
|
||||||
|
"applied automatically on upgrade, "
|
||||||
|
"and\nmust be applied explicitly "
|
||||||
|
"with zpool-set(7).\n\n"));
|
||||||
(void) printf(gettext("POOL "
|
(void) printf(gettext("POOL "
|
||||||
"FEATURE\n"));
|
"FEATURE\n"));
|
||||||
(void) printf(gettext("------"
|
(void) printf(gettext("------"
|
||||||
@ -11454,7 +11562,9 @@ upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg)
|
|||||||
poolfirst = B_FALSE;
|
poolfirst = B_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) printf(gettext(" %s\n"), fname);
|
(void) printf(gettext(" %s%s\n"), fname,
|
||||||
|
spa_feature_table[i].fi_flags &
|
||||||
|
ZFEATURE_FLAG_NO_UPGRADE ? "(*)" : "");
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* If they did "zpool upgrade -a", then we could
|
* If they did "zpool upgrade -a", then we could
|
||||||
@ -12024,6 +12134,11 @@ zpool_do_events_nvprint(nvlist_t *nvl, int depth)
|
|||||||
zfs_valstr_zio_stage(i32, flagstr,
|
zfs_valstr_zio_stage(i32, flagstr,
|
||||||
sizeof (flagstr));
|
sizeof (flagstr));
|
||||||
printf(gettext("0x%x [%s]"), i32, flagstr);
|
printf(gettext("0x%x [%s]"), i32, flagstr);
|
||||||
|
} else if (strcmp(name,
|
||||||
|
FM_EREPORT_PAYLOAD_ZFS_ZIO_TYPE) == 0) {
|
||||||
|
zfs_valstr_zio_type(i32, flagstr,
|
||||||
|
sizeof (flagstr));
|
||||||
|
printf(gettext("0x%x [%s]"), i32, flagstr);
|
||||||
} else if (strcmp(name,
|
} else if (strcmp(name,
|
||||||
FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY) == 0) {
|
FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY) == 0) {
|
||||||
zfs_valstr_zio_priority(i32, flagstr,
|
zfs_valstr_zio_priority(i32, flagstr,
|
||||||
@ -12250,7 +12365,7 @@ zpool_do_events_next(ev_opts_t *opts)
|
|||||||
nvlist_free(nvl);
|
nvlist_free(nvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY(0 == close(zevent_fd));
|
VERIFY0(close(zevent_fd));
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
@ -12583,6 +12698,7 @@ zpool_do_get(int argc, char **argv)
|
|||||||
current_prop_type = cb.cb_type;
|
current_prop_type = cb.cb_type;
|
||||||
|
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
{"json-int", no_argument, NULL, ZPOOL_OPTION_JSON_NUMS_AS_INT},
|
||||||
{"json-pool-key-guid", no_argument, NULL,
|
{"json-pool-key-guid", no_argument, NULL,
|
||||||
ZPOOL_OPTION_POOL_KEY_GUID},
|
ZPOOL_OPTION_POOL_KEY_GUID},
|
||||||
@ -12702,11 +12818,13 @@ found:
|
|||||||
|
|
||||||
if (strcmp(argv[1], "root") == 0)
|
if (strcmp(argv[1], "root") == 0)
|
||||||
vdev = strdup("root-0");
|
vdev = strdup("root-0");
|
||||||
else
|
|
||||||
vdev = strdup(argv[1]);
|
|
||||||
|
|
||||||
/* ... and the rest are vdev names */
|
/* ... and the rest are vdev names */
|
||||||
|
if (vdev == NULL)
|
||||||
|
cb.cb_vdevs.cb_names = argv + 1;
|
||||||
|
else
|
||||||
cb.cb_vdevs.cb_names = &vdev;
|
cb.cb_vdevs.cb_names = &vdev;
|
||||||
|
|
||||||
cb.cb_vdevs.cb_names_count = argc - 1;
|
cb.cb_vdevs.cb_names_count = argc - 1;
|
||||||
cb.cb_type = ZFS_TYPE_VDEV;
|
cb.cb_type = ZFS_TYPE_VDEV;
|
||||||
argc = 1; /* One pool to process */
|
argc = 1; /* One pool to process */
|
||||||
@ -13497,7 +13615,12 @@ zpool_do_version(int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
nvlist_t *jsobj = NULL, *zfs_ver = NULL;
|
||||||
boolean_t json = B_FALSE;
|
boolean_t json = B_FALSE;
|
||||||
while ((c = getopt(argc, argv, "j")) != -1) {
|
|
||||||
|
struct option long_options[] = {
|
||||||
|
{"json", no_argument, NULL, 'j'},
|
||||||
|
};
|
||||||
|
|
||||||
|
while ((c = getopt_long(argc, argv, "j", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'j':
|
case 'j':
|
||||||
json = B_TRUE;
|
json = B_TRUE;
|
||||||
@ -13613,7 +13736,7 @@ main(int argc, char **argv)
|
|||||||
* Special case '-V|--version'
|
* Special case '-V|--version'
|
||||||
*/
|
*/
|
||||||
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
|
||||||
return (zpool_do_version(argc, argv));
|
return (zfs_version_print() != 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special case 'help'
|
* Special case 'help'
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
/*
|
/*
|
||||||
* CDDL HEADER START
|
* CDDL HEADER START
|
||||||
*
|
*
|
||||||
@ -75,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;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user