Issue opening file on NFS read-only mount

N.M. Maclaren nmm1@cam.ac.uk
Wed Nov 13 11:39:00 GMT 2013


On Nov 13 2013, Janne Blomqvist wrote:
>
>Well, if you're curious, the relevant stuff is at
>
>  
> http://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgfortran/io/unix.c;h=8a84ae4eef36ac0d235a71d3350d3524807cfd38;hb=HEAD#l1237

Curious, yes, but I daren't add another activity and write a patch.
This is another case of the fix being easy, but working out what the fix
should be being seriously tricky.

>In particular, when falling back to trying to open with O_RDONLY after
>O_RDWR fails, I think we should mask out O_CREAT as well.

Actually, if ACTION='READ' is present, I think that it should set O_CREAT
only if STATUS='NEW' (and perhaps 'SCRATCH') is set.  The default should
be to NOT set it.  That's important if the file is attached to an 'active'
device (including tapes and sockets), because you often get only one chance
to open the file.

>But yeah, a kernel bug report for failing to handle O_RDONLY|O_CREAT
>is probably warranted as well.

Right.  But, given the insane specification of that combination in
POSIX, God alone knows what that case should do ....  Certainly, Unices
have varied considerably (and I think that even Linux has).


Regards,
Nick Maclaren.



More information about the Fortran mailing list