mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
cephfs: fix omap deletion in DeleteSnapshot
The omap is stored with the requested snapshot name not with the subvolume snapshotname. This fix uses the correct snapshot request name to cleanup the omap once the subvolume snapshot is deleted. fixes: #2974 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
1da19680b4
commit
f8bbd2f60f
@ -823,10 +823,10 @@ func (cs *ControllerServer) DeleteSnapshot(
|
|||||||
// success as deletion is complete
|
// success as deletion is complete
|
||||||
return &csi.DeleteSnapshotResponse{}, nil
|
return &csi.DeleteSnapshotResponse{}, nil
|
||||||
case errors.Is(err, cerrors.ErrSnapNotFound):
|
case errors.Is(err, cerrors.ErrSnapNotFound):
|
||||||
err = store.UndoSnapReservation(ctx, volOpt, *sid, sid.FsSnapshotName, cr)
|
err = store.UndoSnapReservation(ctx, volOpt, *sid, sid.RequestName, cr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorLog(ctx, "failed to remove reservation for snapname (%s) with backing snap (%s) (%s)",
|
log.ErrorLog(ctx, "failed to remove reservation for snapname (%s) with backing snap (%s) (%s)",
|
||||||
sid.FsSubvolName, sid.FsSnapshotName, err)
|
sid.RequestName, sid.FsSnapshotName, err)
|
||||||
|
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
@ -836,10 +836,10 @@ func (cs *ControllerServer) DeleteSnapshot(
|
|||||||
// if the error is ErrVolumeNotFound, the subvolume is already deleted
|
// if the error is ErrVolumeNotFound, the subvolume is already deleted
|
||||||
// from backend, Hence undo the omap entries and return success
|
// from backend, Hence undo the omap entries and return success
|
||||||
log.ErrorLog(ctx, "Volume not present")
|
log.ErrorLog(ctx, "Volume not present")
|
||||||
err = store.UndoSnapReservation(ctx, volOpt, *sid, sid.FsSnapshotName, cr)
|
err = store.UndoSnapReservation(ctx, volOpt, *sid, sid.RequestName, cr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorLog(ctx, "failed to remove reservation for snapname (%s) with backing snap (%s) (%s)",
|
log.ErrorLog(ctx, "failed to remove reservation for snapname (%s) with backing snap (%s) (%s)",
|
||||||
sid.FsSubvolName, sid.FsSnapshotName, err)
|
sid.RequestName, sid.FsSnapshotName, err)
|
||||||
|
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
@ -874,7 +874,7 @@ func (cs *ControllerServer) DeleteSnapshot(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
err = store.UndoSnapReservation(ctx, volOpt, *sid, sid.FsSnapshotName, cr)
|
err = store.UndoSnapReservation(ctx, volOpt, *sid, sid.RequestName, cr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorLog(ctx, "failed to remove reservation for snapname (%s) with backing snap (%s) (%s)",
|
log.ErrorLog(ctx, "failed to remove reservation for snapname (%s) with backing snap (%s) (%s)",
|
||||||
sid.RequestName, sid.FsSnapshotName, err)
|
sid.RequestName, sid.FsSnapshotName, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user