>+ errmsg("large object descriptor %d was not opened for reading",
>+fd)));
Do we ever reach this error? Because per my understanding
1) if the application didn't call lo_open before lo_read, then file descriptor validation in the beginning of this function should capture it.
2) if the application called lo_open only with write mode should be able to read as well per documentation.
Ok, in the inv_open(), IFS_RDLOCK is set only when explicit READ mode is requested. So, it causes lo_read failure when large-object is opened in WRITE mode? I think documented behavior is more appropriate and post ACL checks for select and update permissions in inv_open(), IFS_RDLOCK flag should be set regardless of mode specified.