You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nvmeof: add device tracking and disconnect in NodeUnstageVolume
Implement proper disconnect logic in NodeUnstageVolume that only
disconnects controllers when no other volumes are using them.
Changes:
1. Add getDeviceFromStagingPath() to find the Nvme
device for a volume
- Uses findmnt with JSON output for reliable parsing
- Handles both filesystem and block volumes
2. Add getNVMeMountedDevices() to get all
currently mounted NVMe devices
- Single findmnt call scans entire mount table efficiently
- Filters for NVMe-oF CSI staging paths only
- Returns map of mounted devices for quick lookup
3. Update NodeUnstageVolume to call
DisconnectIfLastMount after unmount
- Gets device path from staging path
- Gets list of all mounted NVMe devices
- Passes both to DisconnectIfLastMount for
safe disconnect decision
- Disconnect failures are non-fatal (logged as warnings)
Signed-off-by: gadi-didi <gadi.didi@ibm.com>
0 commit comments