Browse Source

Match Go VolumeDelete: propagate only_empty to delete_volume for defense in depth

The gRPC VolumeDelete handler had a pre-check for only_empty but then
passed false to store.delete_volume(), bypassing the store-level check.
Go passes req.OnlyEmpty directly to DeleteVolume. Now Rust does the same
for defense in depth against TOCTOU races (though the store write lock
makes this unlikely).
rust-volume-server
Chris Lu 3 days ago
parent
commit
40993383b0
  1. 2
      seaweed-volume/src/server/grpc_server.rs

2
seaweed-volume/src/server/grpc_server.rs

@ -653,7 +653,7 @@ impl VolumeServer for VolumeGrpcService {
}
}
store
.delete_volume(vid, false)
.delete_volume(vid, req.only_empty)
.map_err(|e| Status::internal(e.to_string()))?;
Ok(Response::new(volume_server_pb::VolumeDeleteResponse {}))
}

Loading…
Cancel
Save