python-blivet/0001-Make-sure-we-mount-the-top-level-subvolume-when-moun.patch
Chenxi Mao a47ebf0c37 Fix remove subvolumes error on brtfs during installation
Current blivet didn't invoke the default subvolume during
brtfs mounting, it lead to the higher level subvolume cannot be removed.

Solution:
Backport upstream patch to fix this issue.
    * 0b672ff4 Make sure we mount the top level subvolume
               when mounting btrfs

Link: 0b672ff452
Reference: bsn#313
Change-Id: If96ad4b7565a332f339734c939e5cf657627d20b
Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
2022-07-28 21:17:08 +08:00

37 lines
1.3 KiB
Diff

From 0b672ff4527ccbb7b7527f1ab2394fa36738b27f Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Thu, 27 Jan 2022 17:53:06 +0100
Subject: [PATCH 1/1] Make sure we mount the top level subvolume when mounting
btrfs
If we don't specify the subvolid=5 we end up mounting the default
subvolume and if it isn't the top volume one, we can't remove
other subvolumes "higher" in the hierarchy.
This makes the installer crash when reinstalling over a preexisting
btrfs installation, for example the default openSUSE installation
where the default subvolume is a post installation snapshot.
Resolves: rhbz#2026205
---
blivet/devices/btrfs.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
index 3b9374fc..6629ba95 100644
--- a/blivet/devices/btrfs.py
+++ b/blivet/devices/btrfs.py
@@ -123,7 +123,8 @@ class BTRFSDevice(StorageDevice):
else:
tmpdir = tempfile.mkdtemp(prefix=self._temp_dir_prefix)
try:
- util.mount(device=fmt.device, mountpoint=tmpdir, fstype=fmt.type)
+ util.mount(device=fmt.device, mountpoint=tmpdir, fstype=fmt.type,
+ options=fmt.mountopts)
except errors.FSError as e:
log.debug("btrfs temp mount failed: %s", e)
raise
--
2.33.0