Hello community,

here is the log from the commit of package growpart for openSUSE:Factory 
checked in at 2018-06-27 10:20:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/growpart (Old)
 and      /work/SRC/openSUSE:Factory/.growpart.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "growpart"

Wed Jun 27 10:20:20 2018 rev:6 rq:618484 version:unknown

Changes:
--------
--- /work/SRC/openSUSE:Factory/growpart/growpart.changes        2018-04-05 
15:33:46.747519050 +0200
+++ /work/SRC/openSUSE:Factory/.growpart.new/growpart.changes   2018-06-27 
10:20:31.302004790 +0200
@@ -1,0 +2,5 @@
+Thu Jun 21 20:28:16 UTC 2018 - [email protected]
+
+- Support btrfs resize, handle ro setup in rootgrow (bsc#1097455, bsc#1098681)
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rootgrow ++++++
--- /var/tmp/diff_new_pack.RB67ur/_old  2018-06-27 10:20:31.877983847 +0200
+++ /var/tmp/diff_new_pack.RB67ur/_new  2018-06-27 10:20:31.877983847 +0200
@@ -11,6 +11,13 @@
         if mount.startswith(device):
             return mount.split(' ')[1]
 
+def is_mount_read_only(mountpoint):
+    for mount in mounts:
+        mount_values = mount.split(' ')
+        if mount_values[1] == mountpoint:
+            mount_opts = mount_values[3].split(',')
+            return 'ro' in mount_opts
+
 def resize_fs(fs_type, device):
     if fs_type.startswith('ext'):
         cmd = 'resize2fs %s' % device
@@ -27,6 +34,29 @@
             'Resizing: "%s"' %cmd
         )
         os.system(cmd)
+    elif fs_type == 'btrfs':
+        mnt_point = get_mount_point(device)
+        # If the volume is read-only, the resize operation will fail even
+        # though it's still probably wanted to do the resize. A feasible
+        # work-around is to use snapper's .snapshots subdir (if exists)
+        # instead of the volume path for the resize operation.
+        if is_mount_read_only(mnt_point):
+            if os.path.isdir('{}/.snapshots'.format(mnt_point)):
+                cmd = 'btrfs filesystem resize max {}/.snapshots'.format(
+                    mnt_point)
+            else:
+                syslog.syslog(
+                    syslog.LOG_ERR,
+                    "cannot resize read-only btrfs without snapshots"
+                )
+                return
+        else:
+            cmd = 'btrfs filesystem resize max {}'.format(mnt_point)
+        syslog.syslog(
+            syslog.LOG_INFO,
+            'Resizing: "%s"' %cmd
+         )
+        os.system(cmd)
 
 
 for mount in mounts:


Reply via email to