Преглед на файлове

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 години
родител
ревизия
9d5deffb13
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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):