Skip to content

Commit

Permalink
[fs.Linux] Allow dev without /dev/loop... when loop in mnt_options
Browse files Browse the repository at this point in the history
This commit let Linux automatically handle the loop device creation/deletion during mount/umount

So Now following resource is allowed:
    [fs#1]
    type = ext4
    dev = /loopfile1
    mnt = /data1
    mnt_opt = loop,rw

Signed-off-by: Cyril Galibern <cyril.galibern@opensvc.com>
  • Loading branch information
cvaroqui authored and cgalibern committed Nov 23, 2023
1 parent 5c2c71a commit 0d8092d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions opensvc/drivers/resource/fs/linux.py
Expand Up @@ -153,6 +153,8 @@ def is_up(self):
backfile = utilities.devices.linux.loop_to_file(self.device)
if backfile and self.mounts.has_mount(backfile, os.path.realpath(self.mount_point)):
return True
elif os.path.isfile(self.device) and "loop" in self.mount_options.split(","):
return self.mounts.has_mount(self.device, os.path.realpath(self.mount_point))

# might be a mount by label or uuid
for dev in self.sub_devs():
Expand Down

0 comments on commit 0d8092d

Please sign in to comment.