aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-03-25 08:19:31 -0700
committerchrislu <chris.lu@gmail.com>2024-03-25 08:19:31 -0700
commitaed6fdffd29aa700241aceab87211aee5467cd82 (patch)
treea46c7491d8d4448671a3d96394fbf19d48fdd917
parent9ca871af5313475ad9138a2288d71a1bd0843ccd (diff)
downloadseaweedfs-aed6fdffd29aa700241aceab87211aee5467cd82.tar.xz
seaweedfs-aed6fdffd29aa700241aceab87211aee5467cd82.zip
fix nil volume data backend
fix https://github.com/seaweedfs/seaweedfs/issues/5417
-rw-r--r--weed/server/volume_grpc_admin.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/server/volume_grpc_admin.go b/weed/server/volume_grpc_admin.go
index 8cd6ff949..abd39b582 100644
--- a/weed/server/volume_grpc_admin.go
+++ b/weed/server/volume_grpc_admin.go
@@ -236,6 +236,9 @@ func (vs *VolumeServer) VolumeStatus(ctx context.Context, req *volume_server_pb.
if v == nil {
return nil, fmt.Errorf("not found volume id %d", req.VolumeId)
}
+ if v.DataBackend == nil {
+ return nil, fmt.Errorf("volume %d data backend not found", req.VolumeId)
+ }
volumeSize, _, _ := v.DataBackend.GetStat()
resp.IsReadOnly = v.IsReadOnly()