Skip to content

Commit

Permalink
Do unlock, update_vol_list only for CoW types
Browse files Browse the repository at this point in the history
  • Loading branch information
tasket committed Jun 1, 2024
1 parent 0111947 commit 43d8537
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/wyng
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ class LocalStorage:
def __init__(self, localpath, auuid=None, arch_vols={}, clean=False, sync=False,
require_online=False):

self.stypes = { "tlvm": LvmVolume, "rlnk": ReflinkVolume }
self.stypes = { "tlvm": LvmVolume, "rlnk": ReflinkVolume }
self.rltypes = { "btrfs", "xfs" }

assert len(auuid) > 8
Expand Down Expand Up @@ -1287,7 +1287,7 @@ class LocalStorage:
if require_online and not self.online:
err_out("Local storage is offline: "+repr(localpath)+ol_reason)

if self.online: #Fix: make conditional on send/monitor/receive
if self.online and self.pooltype in ("tlvm","rlnk"):
self.LVolClass = self.stypes[self.pooltype]
self.path = self.path.rstrip("/")+"/"
self.update_vol_list(arch_vols)
Expand Down Expand Up @@ -1363,7 +1363,8 @@ class LocalStorage:
elif self.fstype == "xfs":
pass # possibly file-lock and chmod -r rlnk snapshots
else:
raise ValueError(self.pooltype+" no metadata.")
raise ValueError(f"'{self.pooltype}' pooltype, no metadata.")

self.locked = True
return mark, spath

Expand All @@ -1378,7 +1379,7 @@ class LocalStorage:
if self.fstype == "btrfs":
mark_t = self._btrfs_subvol_snapshot(delete=True)
else:
raise ValueError(self.pooltype+" no metadata.")
if debug: print(f"'{self.pooltype}' pooltype, no metadata.")

self.locked = False
return mark_t
Expand Down Expand Up @@ -4720,7 +4721,7 @@ def cleanup():

# Constants / Globals
prog_name = "wyng"
prog_version = "0.8 beta" ; prog_date = "20240530"
prog_version = "0.8 beta" ; prog_date = "20240531"
format_version = 3 ; debug = False
admin_permission = os.getuid() == 0

Expand Down

0 comments on commit 43d8537

Please sign in to comment.