PR0012.html

LSB Problem Report

Problem Report Number 0012 (REJ.0004)
Submitter's Classification Test Suite Problem (TSD)
State Resolved
Resolution Rejected (REJ)
Raised 2002-08-07 19:18
Updated 2002-09-11 17:13
Published 2002-09-11 17:13
Certification Program Linux Standard Base Conformance Release 1.2
Test Suite lsb-runtime IA32 version 1.2.1-1
Test Identification POSIX.os/ioprim/write/T.write 16
Problem Summary partial-write tests on nospace device fail if less than a pagesize free
Problem Text In the write and writev tests, there's a test for a write
that should partially succeed. To set up for this test,
it's expected that filldisc will have mostly filled the
test filesystem-file, and utility function setupnospc fills
it further. However, the Linux kernel will not write less
than a full memory page in the test circumstance (make a
big buffer, try to write or writev the whole thing), so
IA32 and other platforms with a 4k pagesize just succeed,
while Itanium and other platforms with larger pagesizes
will fail to write anything and return ENOSPC, thus
appearing to fail the tests. To be a fair test on Linux,
some heuristic should be applied so that after test setup
is complete, there's slightly more than one page (for the
platform under test) free.
Test Output 10|345 /tset/POSIX.os/ioprim/write/T.write 17:41:45|TC
Start, scenario ref 348-0
15|345 3.3-lite 28|TCM Start
...
400|345 16 1 17:42:52|IC Start
200|345 16 17:42:52|TP Start
520|345 16 00009101 2 1|write() returned -1, expected > 0
520|345 16 00009101 2 2|errno was set to ENOSPC (28)
220|345 16 1 17:42:52|FAIL

And:
10|540 /tset/LSB.os/ioprim/writev_L/T.writev_L 21:45:12|TC
Start, scenario ref 545-0
15|540 3.3-lite 30|TCM Start
...
400|540 16 1 21:46:18|IC Start
200|540 16 21:46:18|TP Start
520|540 16 00014784 2 1|writev() returned -1, expected > 0
520|540 16 00014784 2 2|errno was set to ENOSPC (28)
220|540 16 1 21:46:19|FAIL

Review Information

Review Type TSMA Review
Start Date 2002-08-07 19:18
Last Updated 2002-08-21 16:15
Completed 2002-08-21 16:15
Status Complete
Review Recommendation No Resolution Given
Review Response No resolution is given since this highlights
a difference between Linux behavior and POSIX.

Note also that this problem does not impact IA32
certification.

In POSIX the write() function when there is
less space available for the write() than requested
should write as much data as there is space available,
i.e. do a short write.

POSIX states:
"If a write() requests that more bytes be written than there
is room for (for example, the
process' file size limit or the physical end of a medium),
only as many bytes as there is room for
shall be written. For example, suppose there is space for 20
bytes more in a file before reaching a
limit. A write of 512 bytes will return 20. The next write
of a non-zero number of bytes would give a failure return
(except as noted below)."

The test strategy is designed to work even when there
is no disk space available as it uses a buffer
of allocated data, and intends to overwrite it.

The Linux behavior is that, if there is less space
available than requested, and the write is more than
the PAGESIZE, then no bytes are written, and an ENOSPC
error is returned.

If this behavior is intentional we need to document the
extension over POSIX, and make this an INT against
the specification.

Review Type SA Review
Start Date 2002-08-21 15:15
Last Updated 2002-08-21 17:19
Completed 2002-08-21 17:19
Status Complete
Review Resolution No Resolution Given
Review Conclusion Seems like an implementation bug. Need some additional
time to consult with the kernel peoiple.

Review Type SA Detailed Review
Start Date 2002-08-21 16:24
Last Updated 2002-09-11 16:37
Completed 2002-09-11 16:37
Status Complete
Review Recommendation Rejected (REJ)
Review Response No systems are current running into this although it will
happen for IA64. Sourceforge bugs have been created to
further track these.

 

Copyright 2005, The Free Standards Group, All Rights Reserved