Skip to content

Commit

Permalink
Perform additional fixup wrt CORE ctl device names
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeagherix committed Jul 3, 2024
1 parent bef6b6f commit 754d40f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/middlewared/middlewared/etc_files/scst.conf.mako
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
missing_extents = []
extents_io = {'vdisk_fileio': [], 'vdisk_blockio': []}
for extent in extents.values():
extent['name'] = extent['name'].replace('.', '_').replace('/', '-') # CORE ctl device names are incompatible with SCALE SCST
if extent['locked']:
middleware.logger.debug(
'Skipping generation of extent %r as the underlying resource is locked', extent['name']
Expand All @@ -160,7 +161,6 @@
missing_extents.append(extent['id'])
continue
extent['name'] = extent['name'].replace('.', '_') # CORE ctl device names are incompatible with SCALE SCST
extents_io[extents_io_key].append(extent)
all_extent_names.append(extent['name'])
Expand Down
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/plugins/iscsi_/global_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def resync_lun_size_for_zvol(self, id_):

try:
# CORE ctl device names are incompatible with SCALE SCST
# so (similarly to scst.mako.conf) replace period with underscore
extent_name = extent[0]["name"].replace('.', '_')
# so (similarly to scst.mako.conf) replace period with underscore, slash with dash
extent_name = extent[0]["name"].replace('.', '_').replace('/', '-')
with open(f'/sys/kernel/scst_tgt/devices/{extent_name}/resync_size', 'w') as f:
f.write('1')
except Exception as e:
Expand Down

0 comments on commit 754d40f

Please sign in to comment.