From 92f1ed3ed1fdba8a292dd4f625acd2b23bd6fdec Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 5 Mar 2024 14:22:53 -0500 Subject: [PATCH] Revert "pybind/mgr/volumes: block quiesce for critical .meta file" This reverts commit 16e50abbd42a4b4f740816ba5f60bc259a6a96bf. This flag is no longer necessary as the volumes plugin issues quiesce calls against the data (i.e. root) directory of the subvolume rather than the subvolume directory (with its associated .meta file). Signed-off-by: Patrick Donnelly --- .../fs/operations/versions/subvolume_base.py | 13 ------------- .../volumes/fs/operations/versions/subvolume_v1.py | 3 --- .../volumes/fs/operations/versions/subvolume_v2.py | 3 --- 3 files changed, 19 deletions(-) diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py index a8afcc368073b..8fbe177e5f4b5 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py @@ -69,19 +69,6 @@ class SubvolumeBase(object): def config_path(self): return os.path.join(self.base_path, b".meta") - def mark_meta(self): - """ - Set "ceph.quiesce.block" flag on the .meta file inode. It must remain - available while a subvolume is quiesced in order to allow some - interactions with the subvolume, snapshots in particular. - """ - try: - self.fs.setxattr(self.config_path, 'ceph.quiesce.block', b'1', 0) - except cephfs.InvalidValue: - raise VolumeException(-errno.EINVAL, "invalid value specified for ceph.quiesce.block") - except cephfs.Error as e: - raise VolumeException(-e.args[0], e.args[1]) - @property def legacy_dir(self): return (os.path.join(self.vol_spec.base_dir.encode('utf-8'), diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py index 5f81a63050534..90f35a4c90b39 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py @@ -111,7 +111,6 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate): qpath = subvol_path.decode('utf-8') self.init_config(SubvolumeV1.VERSION, subvolume_type, qpath, initial_state) self.mark_subvolume() - self.mark_meta() except (VolumeException, MetadataMgrException, cephfs.Error) as e: try: log.info("cleaning up subvolume with path: {0}".format(self.subvolname)) @@ -181,7 +180,6 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate): # create directory and set attributes self.fs.mkdirs(subvol_path, attrs.get("mode")) self.mark_subvolume() - self.mark_meta() self.set_attrs(subvol_path, attrs) # persist subvolume metadata and clone source @@ -246,7 +244,6 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate): st = self.fs.stat(subvol_path) # unconditionally mark as subvolume, to handle pre-existing subvolumes without the mark self.mark_subvolume() - self.mark_meta() self.uid = int(st.st_uid) self.gid = int(st.st_gid) diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py index 089d5ae1c0183..55d7f945b7750 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py @@ -189,7 +189,6 @@ class SubvolumeV2(SubvolumeV1): # Create the subvolume metadata file which manages auth-ids if it doesn't exist self.auth_mdata_mgr.create_subvolume_metadata_file(self.group.groupname, self.subvolname) - self.mark_meta() except (VolumeException, MetadataMgrException, cephfs.Error) as e: try: self._remove_on_failure(subvol_path, retained) @@ -244,7 +243,6 @@ class SubvolumeV2(SubvolumeV1): self.metadata_mgr.init(SubvolumeV2.VERSION, subvolume_type.value, qpath, initial_state.value) self.add_clone_source(source_volname, source_subvolume, snapname) self.metadata_mgr.flush() - self.mark_meta() except (VolumeException, MetadataMgrException, cephfs.Error) as e: try: self._remove_on_failure(subvol_path, retained) @@ -302,7 +300,6 @@ class SubvolumeV2(SubvolumeV1): self.metadata_mgr.refresh() # unconditionally mark as subvolume, to handle pre-existing subvolumes without the mark self.mark_subvolume() - self.mark_meta() etype = self.subvol_type if op_type not in self.allowed_ops_by_type(etype): -- 2.39.5