Skip to content

Commit b9ad1e5

Browse files
authored
Merge pull request #3710 from mulkieran/stratisd-version-3.7.3
Stratisd version 3.7.3
2 parents e51bf29 + 1c9ee4e commit b9ad1e5

File tree

8 files changed

+62
-4
lines changed

8 files changed

+62
-4
lines changed

.packit.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,21 @@ jobs:
3030
- job: copr_build
3131
trigger: pull_request
3232
targets:
33-
- fedora-all
33+
- fedora-development
34+
35+
- job: copr_build
36+
trigger: pull_request
37+
additional_repos:
38+
- https://dl.fedoraproject.org/pub/fedora/linux/updates/testing/40/Everything/x86_64/
39+
targets:
40+
- fedora-40
41+
42+
- job: copr_build
43+
trigger: pull_request
44+
additional_repos:
45+
- https://dl.fedoraproject.org/pub/fedora/linux/updates/testing/39/Everything/x86_64/
46+
targets:
47+
- fedora-39
3448

3549
- job: tests
3650
identifier: local

CHANGES.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
stratisd 3.7.3
2+
==============
3+
Recommended Rust toolchain version: 1.81.0
4+
Recommended development platform for Python development: Fedora 40
5+
6+
* Cherry-picked commits:
7+
* Allow improper ctypes in bindgen-generated bindings
8+
* Build f40 and f39 copr repos with additional repo
9+
* Tidies
10+
* Change matches macro expansion to assert_matches
11+
112
stratisd 3.7.2
213
==============
314
Recommended Rust toolchain version: 1.81.0

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stratisd"
3-
version = "3.7.2"
3+
version = "3.7.3"
44
authors.workspace = true
55
edition.workspace = true
66
rust-version.workspace = true

src/engine/strat_engine/backstore/backstore.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,18 @@ where
10211021
level: ActionAvailability::NoRequests,
10221022
};
10231023
}
1024+
if let Err(e) = blockdev.reload_crypt_metadata() {
1025+
warn!(
1026+
"Failed to reload on-disk metadata for device {}: {}",
1027+
blockdev.physical_path().display(),
1028+
e,
1029+
);
1030+
return StratisError::RollbackError {
1031+
causal_error: Box::new(causal_error),
1032+
rollback_error: Box::new(e),
1033+
level: ActionAvailability::NoRequests,
1034+
};
1035+
}
10241036
}
10251037

10261038
causal_error
@@ -1332,7 +1344,7 @@ mod tests {
13321344
Ok(false)
13331345
);
13341346

1335-
matches!(
1347+
assert_matches!(
13361348
backstore.bind_clevis(
13371349
"tang",
13381350
&json!({"url": env::var("TANG_URL").expect("TANG_URL env var required"), "stratis:tang:trust_url": true})

src/engine/strat_engine/backstore/blockdev.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ impl StratBlockDev {
364364
self.blksizes
365365
}
366366

367+
/// Reload the crypt metadata from disk and store in the crypt handle if the device is
368+
/// encrypted.
369+
pub fn reload_crypt_metadata(&mut self) -> StratisResult<()> {
370+
match self.underlying_device.crypt_handle_mut() {
371+
Some(handle) => handle.reload_metadata(),
372+
None => Ok(()),
373+
}
374+
}
375+
367376
/// Bind encrypted device using the given clevis configuration.
368377
pub fn bind_clevis(&mut self, pin: &str, clevis_info: &Value) -> StratisResult<()> {
369378
let crypt_handle = self.underlying_device.crypt_handle_mut().ok_or_else(|| {

src/engine/strat_engine/backstore/crypt/handle.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,17 @@ impl CryptHandle {
427427
}
428428
}
429429

430+
/// Reload the required information for Stratis from the LUKS2 metadata.
431+
pub fn reload_metadata(&mut self) -> StratisResult<()> {
432+
match setup_crypt_device(self.luks2_device_path())? {
433+
Some(ref mut device) => {
434+
self.metadata = load_crypt_metadata(device, self.luks2_device_path())?.ok_or_else(|| StratisError::Msg("Found no crypt metadata on this device".to_string()))?;
435+
Ok(())
436+
}
437+
None => Err(StratisError::Msg("Expected device to be an encrypted device but could not acquire handle to crypt device".to_string())),
438+
}
439+
}
440+
430441
/// Get the encryption info for this encrypted device.
431442
pub fn encryption_info(&self) -> &EncryptionInfo {
432443
&self.metadata.encryption_info

src/systemd/bindings.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#![allow(non_upper_case_globals)]
77
#![allow(non_camel_case_types)]
88
#![allow(non_snake_case)]
9+
#![allow(improper_ctypes)]
910
#![allow(clippy::redundant_static_lifetimes)]
1011
#![allow(clippy::unreadable_literal)]
1112
#![allow(clippy::missing_safety_doc)]

0 commit comments

Comments
 (0)