nefelim4ag / systemd-swap

Script for creating hybrid swap space from zram swaps, swap files and swap partitions.
GNU General Public License v3.0
550 stars 81 forks source link

Check if path is a subvolume when filesystem is btrfs #181

Closed EnderShadow closed 3 years ago

EnderShadow commented 3 years ago

Fix for issue #180

vilgotf commented 3 years ago

Isn't it better to just modify L171 and add: and path == self.swapfc_path? (Or something like it)

EnderShadow commented 3 years ago

The reason I made the change that I did is becuase get_fs_type() isn't correctly returning whether or not the path is a btrfs subvolume. My change identifies whether or not the path is a btrfs subvolume. The main issue with the code prior to the patch is that it doesn't realize that the path is a subvolume and so it tries to create a subvolume on top of it.

EnderShadow commented 3 years ago

I've updated it so it uses the suggested function instead.