Bug 1535401

Summary: ioprocess writefile with direct=True does not perform direct I/O
Product: [oVirt] ovirt-distribution Reporter: Nir Soffer <nsoffer>
Component: ioprocessAssignee: Nir Soffer <nsoffer>
ioprocess sub component: General QA Contact: Avihai <aefrat>
Status: CLOSED WONTFIX Docs Contact:
Severity: high    
Priority: high CC: ebenahar, lsvaty, tnisan, ylavi
Version: 4.2.1   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-10 15:26:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1535370    

Description Nir Soffer 2018-01-17 10:11:32 UTC
Description of problem:

IOProcessClient.writefile() has a direct flag, set to False by default. When set
to True, the caller expects that ioprocess would use direct I/O (O_DIRECT), and
ioprocess has code to handle this flag, but it code is misplaced so the file is
opened without O_DIRECT, and the call is not doing buffered I/O.

We know about one user of this code - vdsm - and it does not use the direct flag,
but we want to change it to use this flag (see bug 1535370).

Version-Release number of selected component (if applicable):
Any

How reproducible:
Always

Steps to Reproduce:
1. Run ioprocess using strace -f
2. Call IProcessClient.writefile() with direct=True

Actual results:
In strace output we see that file was not opened with O_DIRECT

Expected results:
open file with O_DIRECT when direct is True.

Note: version is wrong, bugzilla does not provide all ioprocess versions.

Comment 1 Nir Soffer 2018-01-21 14:44:43 UTC
Tal, this bug blocks urgent vdsm bug targeted to 4.2.1. Suggesting 4.2.1.

I think both bugs can be deffered to 4.2.2 or later, since using direct I/O for
writing tiny files is not important.

Comment 2 Yaniv Kaul 2018-06-07 09:49:50 UTC
(In reply to Nir Soffer from comment #1)
> Tal, this bug blocks urgent vdsm bug targeted to 4.2.1. Suggesting 4.2.1.
> 
> I think both bugs can be deffered to 4.2.2 or later, since using direct I/O
> for
> writing tiny files is not important.

I think it may miss 4.2.4 as well. Shall we target it to 4.2.5?

Comment 3 Tal Nisan 2018-06-07 15:12:03 UTC
(In reply to Yaniv Kaul from comment #2)
> (In reply to Nir Soffer from comment #1)
> > Tal, this bug blocks urgent vdsm bug targeted to 4.2.1. Suggesting 4.2.1.
> > 
> > I think both bugs can be deffered to 4.2.2 or later, since using direct I/O
> > for
> > writing tiny files is not important.
> 
> I think it may miss 4.2.4 as well. Shall we target it to 4.2.5?

Yes, the patches don't seem like they are going to converge by then

Comment 4 Nir Soffer 2018-06-10 15:26:51 UTC
I'm closing this as there is no need to use direct I/O for writing small files,
and ioprocess should not be used to write files. There is no point in wasting 
time to improve ioprocess to do stuff it should not do.