[pbs-devel] [PATCH proxmox-backup v2] datastore: add warning comment to unsafe function
Gabriel Goller
g.goller at proxmox.com
Thu Jul 4 13:20:07 CEST 2024
`list_snapshots_blocking` is unsafe only to imply it's specific behavior.
Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
src/api2/admin/datastore.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 82221c503d16..4a04d9821edd 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -458,7 +458,8 @@ pub async fn list_snapshots(
.map_err(|err| format_err!("failed to await blocking task: {err}"))?
}
-/// This must not run in a main worker thread as it potentially does tons of I/O.
+/// WARNING: Do not run in main worker thread as this potentially does a ton of I/O.
+/// This function has also been marked as `unsafe` to warn about this behavior.
unsafe fn list_snapshots_blocking(
store: String,
ns: Option<BackupNamespace>,
--
2.43.0
More information about the pbs-devel
mailing list