Skip to content

Commit 56a5eeb

Browse files
authored
fix(linstor): print DRBDs open during chain check in RO mode (#116)
Before this change `EMEDIUMTYPE` was not tested, so we only checked the DRBD openers if we attempted a local opening in write mode. As a reminder, `EMEDIUMTYPE` is returned if a local read-only opening is attempted and the volume is open for writing on another machine. Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 7f09400 commit 56a5eeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/linstorvhdutil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ def check_volume_usable():
191191
if e.errno == errno.ENODATA:
192192
time.sleep(2)
193193
continue
194-
if e.errno == errno.EROFS:
195-
util.SMlog('Volume not attachable because RO. Openers: {}'.format(
194+
if e.errno == errno.EROFS or e.errno == errno.EMEDIUMTYPE:
195+
util.SMlog('Volume not attachable because used. Openers: {}'.format(
196196
self._linstor.get_volume_openers(vdi_uuid)
197197
))
198198
raise

0 commit comments

Comments
 (0)