OpenSolaris

Printable Version Enter a New Search
Bug ID 6661506
Synopsis LTP bug : pwrite04 fails because O_APPEND flag is not handled in similar way in Solaris and Linux
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:brandz
Keywords rtiq_regression
Responsible Engineer Vamsi Krishna
Reported Against snv_83
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_86
Fixed In snv_86
Release Fixed solaris_nevada(snv_86)
Related Bugs 6655660
Submit Date 11-February-2008
Last Update Date 28-March-2008
Description
Running LTP testsuite version 20051005-2 on linux branded zones installed with CentOS release 3.7 during snv_83 ON-PIT test campaign, testcase pwrite04 fails consistently. 

This failure is new to this build and seems to be triggered by the putback of CR 6655660 (pwrite() must ignore the O_APPEND/FAPPEND flag) into nevada gate.

Testcase logs :

LSB_VERSION="1.3"
CentOS release 3.7 (Final)
Kernel Version: 2.4.21
...
<<<test_start>>>
tag=pwrite04 stime=1202437862
cmdline="pwrite04"
contacts=""
analysis=exit
initiation_status="ok"
<<<test_output>>>
pwrite04    1  FAIL  :  file size is 4096 != K4
<<<execution_status>>>
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>

Testcase pwrite04 initially opens a file with O_RDWR | O_CREAT flags and pwrite() into it. After each pwrite() it checks that file size and offset are correct. Finally it closes the file, re-opens it with O_APPEND flag, change the offset at an arbitrary position and pwrite() into it at offset 0. It expects that O_APPEND flag takes precedence over any offset specified by pwrite(). So it looks like the testcase is expecting to see the file size to grow because of the O_APPEND flag but pwrite() actually wrote at the specified offset.

This difference in behavior is more than likely due to CR 6655660 : pwrite() must ignore the O_APPEND/FAPPEND flag. Here is what 6655660 says :

The old SUSv3 pwrite() specification was not perfectly clear about this.
It simply said:

   The pwrite() function shall be equivalent to write(), except that it writes
   into a given position without changing the file pointer.

The draft SUSv4 specification is more clear:

   The pwrite() function shall be equivalent to write(), except that it writes
   into a given position and does not change the file offset (regardless of
   whether O_APPEND is set).

The Solaris pwrite() implementation must change to conform to this specification.
Work Around
N/A
Comments
N/A