From c94e1deff1bde93d4167ceeb9dafc494d12cd60c Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Fri, 10 Jul 2020 11:15:22 -0400 Subject: [PATCH] Update LVM volume extend - do *not* skip fsck when extending - have extend resize the filesystem itself rather than making a separate execution of ``resize2fs`` Closes-bug: #1887694 Change-Id: I67ac549e790322c56d02db4424ec01a5449e6633 --- manila/share/drivers/lvm.py | 3 +-- manila/tests/share/drivers/test_lvm.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/manila/share/drivers/lvm.py b/manila/share/drivers/lvm.py index 3b2eb4f02b..e991e50fe8 100644 --- a/manila/share/drivers/lvm.py +++ b/manila/share/drivers/lvm.py @@ -98,7 +98,7 @@ class LVMMixin(driver.ExecuteMixin): device_name, run_as_root=True) def _extend_container(self, share, device_name, size): - cmd = ['lvextend', '-L', '%sG' % size, '-n', device_name] + cmd = ['lvextend', '-L', '%sG' % size, '-r', device_name] self._try_execute(*cmd, run_as_root=True) def _deallocate_container(self, share_name): @@ -379,7 +379,6 @@ class LVMShareDriver(LVMMixin, driver.ShareDriver): def extend_share(self, share, new_size, share_server=None): device_name = self._get_local_path(share) self._extend_container(share, device_name, new_size) - self._execute('resize2fs', device_name, run_as_root=True) def revert_to_snapshot(self, context, snapshot, share_access_rules, snapshot_access_rules, share_server=None): diff --git a/manila/tests/share/drivers/test_lvm.py b/manila/tests/share/drivers/test_lvm.py index f36d235db4..175e9415fc 100644 --- a/manila/tests/share/drivers/test_lvm.py +++ b/manila/tests/share/drivers/test_lvm.py @@ -467,8 +467,6 @@ class LVMShareDriverTestCase(test.TestCase): self._driver.extend_share(self.share, 3) self._driver._extend_container.assert_called_once_with(self.share, local_path, 3) - self._driver._execute.assert_called_once_with('resize2fs', local_path, - run_as_root=True) def test_ssh_exec_as_root(self): command = ['fake_command'] @@ -491,7 +489,7 @@ class LVMShareDriverTestCase(test.TestCase): 'lvextend', '-L', '3G', - '-n', + '-r', 'device_name', run_as_root=True)