[Top][All Lists]
[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 07:20:06 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
On 01/06/2012 07:10 AM, Joerg Schilling wrote:
>> The question is not why an archiver opens a FIFO file, but what it does
>> after opening a file O_NONBLOCK (the TOCTTOU race is eliminated by
>> switching stat()/open() to open()/fstat() filtering, and once we have
>> ascertained that an open fd is not a FIFO, if we can then use fcntl() to
>> remove the O_NONBLOCK, hopefully that will resolve the situation with DMF).
>
>>From the mail from the OP, this will still trigger the problem as the open
>>will
> already return EWOULDBLOCK instead of fetching the file from the background
> storage.
Huh? From the OP:
openat(AT_FDCWD, "qsub_allocation.patch",
O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC) = 4
...
read(4, 0x654200, 2986) = -1 EAGAIN (Resource
temporarily unavailable)
The open() succeeded, not failing with EWOULDBLOCK. It wasn't until the
read() that things failed, and that was only because there was no
intervening fcntl() on fd 4 to clear the O_NONBLOCK flag.
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Bug-tar] opening files with O_NONBLOCK causes problems, Vitezslav Cizek, 2012/01/05
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Paul Eggert, 2012/01/05
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Kamil Dudka, 2012/01/05
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Paul Eggert, 2012/01/05
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Joerg Schilling, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Eric Blake, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Joerg Schilling, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems,
Eric Blake <=
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Joerg Schilling, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Ron Kerry, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Eric Blake, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Kevin Fox, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Ron Kerry, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Joerg Schilling, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Eric Blake, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Paul Eggert, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Eric Blake, 2012/01/06
- Re: [Bug-tar] opening files with O_NONBLOCK causes problems, Ron Kerry, 2012/01/10