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.
This commit is contained in:
Rusty Bird 2019-12-03 18:21:51 +00:00
parent 4cd9e42416
commit 9d5deffb13
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -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):