Activity log for bug #1318748

Date Who What changed Old value New value Message
2014-05-12 16:58:10 Zhou Yu bug added bug
2014-05-12 16:59:32 Zhou Yu cinder: assignee Zhou Yu (vitas-yuzhou)
2014-05-13 14:58:32 Zhou Yu cinder: status New In Progress
2014-05-14 08:46:46 Zhou Yu description The copy volume function (cinder/volume/utils:copy_volume()) which is used for clear volume can set iflag and oflag to direct. 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: execute('dd', 'count=0', 'if=%s' % srcstr, 'of=%s' % deststr, *extra_flags, run_as_root=True) except processutils.ProcessExecutionError: 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: execute('dd', 'count=0', 'if=%s' % srcstr, 'of=%s' % destdev, *extra_flags, run_as_root=True) extra_flags .append(flag) except processutils.ProcessExecutionError: pass The copy volume function (cinder/volume/utils:copy_volume()) which is used for clear volume can set iflag and oflag to direct. 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:         execute('dd', 'count=0', 'if=%s' % srcstr, 'of=%s' % deststr,                             *extra_flags, run_as_root=True)     except processutils.ProcessExecutionError:         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:              execute('dd', 'count=0', 'if=%s' % srcstr, 'of=%s' % destdev, flag                               *extra_flags, run_as_root=True)               extra_flags .append(flag)     except processutils.ProcessExecutionError:                 pass
2014-05-21 01:18:38 Zhou Yu cinder: status In Progress Fix Released
2014-05-26 11:22:29 Thierry Carrez cinder: status Fix Released Fix Committed
2014-06-11 20:09:46 Thierry Carrez cinder: status Fix Committed Fix Released
2014-06-11 20:09:46 Thierry Carrez cinder: milestone juno-1
2014-10-16 09:12:09 Thierry Carrez cinder: milestone juno-1 2014.2