On 01/06/2012 01:46 PM, Paul Eggert wrote:
> On 01/06/12 06:32, Ron Kerry wrote:
>> opening with O_NONBLOCK and then using fcntl() to clear the O_NONBLOCK flag 
>> will work in a DMF context.
> 
> OK, I pushed the following patch into the GNU tar master.
> Can you please give it a try on one of the affected hosts?
> I don't have a hierarchical storage manager to play with.
> Thanks.

Paul, I'm a bit worried that your patch falls foul of unspecified
behavior, at the expense of trying to reduce syscalls, by only calling
fcntl() on an EAGAIN error.  I agree that it's more expensive to clear
O_NONBLOCK on every fd, rather than just clearing after an error, but
doing so seems like the safer course to take, so that we aren't relying
on getting a specific read() behavior on a regular file where O_NONBLOCK
actually made a difference, since that is the part that POSIX leaves
unspecified.

But I guess I'm okay waiting for feedback of whether your patch works
across various HSMs with no ill effects elsewhere, before tweaking
things to do the more expensive fcntl() calls on all fds as a premature
pessimisation just to avoid the unspecified read() behaviors.

-- 
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to