Pārlūkot izejas kodu

storage/reflink: open in binary mode for loopdev resize ioctl

The default (= text) mode for a loop device which contains a VM image
looked weird, even though it didn't make a difference here because the
dev_io object was never actually read from.
Rusty Bird 4 gadi atpakaļ
vecāks
revīzija
9d5deffb13
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      qubes/storage/reflink.py

+ 1 - 1
qubes/storage/reflink.py

@@ -439,7 +439,7 @@ def _update_loopdev_sizes(img):
                     continue
         except FileNotFoundError:
             continue
-        with open('/dev/' + sys_path.split('/')[3]) as dev_io:
+        with open('/dev/' + sys_path.split('/')[3], 'rb') as dev_io:
             fcntl.ioctl(dev_io.fileno(), LOOP_SET_CAPACITY)
 
 def _attempt_ficlone(src, dst):