[Dovecot] AIX and posix_fallocate

Stewart Dean sdean at bard.edu
Thu Jul 30 20:35:47 EEST 2009


I bumped into this a while back, and having IBM support for both AIX and 
the C for AIX V9 compiler, went to the mat on it.  What a pointless 
waste of time; the new IBM increasingly doesn't care about making things 
right.
While IBM has been proclaiming its POSIX compliance, it turned out that 
AIX and the compiler development have been tasked with its 
implementation, such as it maybe, only on the JFS2 filesystem.  Now they 
haven't discontinued JFS FS support, but it's a disinterested, 
neglectful support.  Now in the old IBM, everything, but everything, 
would be tested in n! ways, and everything would work.  In the 
posix_fallocate development, for both AIX and the IBM compiler, 
apparently nobody did nuffin' with it for the old JFS FS...so until I 
raised Hell, the call returned a random value error code.  Which means 
that the design team didn't consider JFS at all; not even to the point 
of documenting non-suppport in JFS.   Their charge was JFS2.
So they figured out a fix: a patch to return a generic something-wrong 
errcode.  I screamed some more.  Their final fix was to return a 
function not supported errcode.  There. Done.  It only took 3-4 months.

FWIW, the patch will be in the mainline Technical level as follows:
"This APAR will be available  53V (AIX 53 TL11 ) and 61H (AIX 61 TL4 )."

Their POSIX compliance position:
> we would like to clarify you on
> below points on posix compliant details in AIX.
>
> Your comment:
> >> Obviously, if you don't support both of AIX's file systems, you are 
> not totally compliant.
>
> Response:
> Unix standards for posix_fallocate( ) function does not state what all 
> filesystems the implementation need to support.
> Having said that AIX implementation of posix_fallocate() only supports 
> JFS2.  Hence not supporting JFS does not
> mean that AIX implementation of posix_fallocate() is not posix 
> compliant. However as stated earlier you can open
> a Design change request for AIX to implement the support of JFS.
>
> Regarding the list of non-posix compliant APIs we do not maintain any 
> separate list nor we have any known issues.
> Developers can get information about APIs from IBM documentation
>         http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp
> and also looking through Open Group standards specification
>         http://www.opengroup.org/onlinepubs/009695399/toc.htm         
Working with the Indian IBM support was intriguing: they were always 
courteous, but they were only interested in fulfilling checklists, not 
in making the product right or necessarily making it work.  They didn't, 
as I have seen elsewhere, declare victory by closing out the trouble 
ticket (PMR in IBMese) without informing you or getting your 
consent....but they would continue talking and doing not much of 
anything until you gave up.

What I now do is to:
1) run configure
2) edit config.h  and put // in front of the HAVE_POSIX_FALLOCATE 
define, like this:

//#define HAVE_POSIX_FALLOCATE

3) then run make as usual


I'm sorry; I should have posted this before, but the whole thing left 
such a bad taste in my mouth all I wanted to do was move on.

S.

Ralf Becker wrote:
> Hi,
>
> AIX's implementation of posix_fallocate is a little bit, let me say,
> peculiar. Attached is a patch to "fix" (=work around) this.
>
> Without you'll see this in the logs:
>
> Jul 28 01:17:41 trevi mail:err|error dovecot: IMAP(beckerr):
>     posix_fallocate() failed: File exists
> Jul 28 01:17:41 trevi mail:err|error dovecot: IMAP(beckerr):
>     file_set_size() failed with mbox file
>     /u/f0/rzuser/beckerr/Mail/Ham: File exists
>
> Funny, isn't it?
>
> This is what it should be:
>
> Jul 28 01:17:41 trevi mail:err|error dovecot: IMAP(beckerr):
>     posix_fallocate() failed: Operation not supported on socket
> Jul 28 01:17:41 trevi mail:err|error dovecot: IMAP(beckerr):
>     file_set_size() failed with mbox file
>     /u/f0/rzuser/beckerr/Mail/Ham: Operation not supported on socket
>
> The problem is, that errno is not correcly set, when posix_fallocate
> returns EOPNOTSUPP (="Operation not supported on socket"). In this
> case the return code has to be checked rather than errno.
>
> When patched dovecot handles err==EOPNOTSUPP the same way like
> errno==EINVAL on Solaris.
>
>
> A note for all AIX Admins:
> Without APAR
>   IZ48778: POSIX_FALLOCATE() FAILS WITH ERROR-25(ENOTTY) resp.
>   IZ46961: POSIX_FALLOCATE() FAILS WITH ERROR-25(ENOTTY)
>            APPLIES TO AIX 5300-06
> you don't even get EOPNOTSUPP: posix_fallocate fails with NOTTY.
> So you have to install one of this fixes to make the patch work.
>
> Ralf
>
>   

-- 
==== Once upon a time, the Internet was a friendly, 
neighbors-helping-neighbors small town, and no one locked their doors. 
Now it's like an apartment in Bed-Stuy: you need three heavy duty 
pick-proof locks, one of those braces that goes from the lock to the 
floor, and bars on the windows.... ==== Stewart Dean, Unix System Admin, 
Bard College, New York 12504 sdean at bard.edu voice: 845-758-7475, fax: 
845-758-7035


More information about the dovecot mailing list