bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] opening files with O_NONBLOCK causes problems


From: Eric Blake
Subject: Re: [Bug-tar] opening files with O_NONBLOCK causes problems
Date: Fri, 06 Jan 2012 14:41:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

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   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]