dd iflag/oflag set invalid argument
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Undecided
|
Zhou Yu |
Bug Description
The copy volume function (cinder/
The problem is when this is used for volume clear and the clear method specifies use of the 'zero' option (/dev/zero) setting iflag direct is not a valid option for that input file and results in an erro:
[root@openstack home]# dd if=/dev/zero of=/home/test iflag=direct bs=1M count=100
dd: opening `/dev/zero': Invalid argument
But, oflag is vaild argument.
[root@openstack home]# dd if=/dev/zero of=/home/test oflag=direct bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.367249 s, 286 MB/s
currently,the code is :
# Use O_DIRECT to avoid thrashing the system buffer cache
extra_flags = ['iflag=direct', 'oflag=direct']
# Check whether O_DIRECT is supported
try:
except processutils.
extra_flags = []
I think we should test dd iflag=direct and oflag=direct separately, like this:
# Use O_DIRECT to avoid thrashing the system buffer cache
extra_flags = []
# Check whether O_DIRECT is supported
for flag in ['iflag=direct', 'oflag=direct']:
try:
except processutils.
Changed in cinder: | |
assignee: | nobody → Zhou Yu (vitas-yuzhou) |
Changed in cinder: | |
status: | New → In Progress |
description: | updated |
Changed in cinder: | |
status: | In Progress → Fix Released |
Changed in cinder: | |
milestone: | none → juno-1 |
status: | Fix Committed → Fix Released |
Changed in cinder: | |
milestone: | juno-1 → 2014.2 |
Fix proposed to branch: master /review. openstack. org/93461
Review: https:/