* [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
[not found] <1262223199-19062-1-git-send-email-kirill@shutemov.name>
@ 2010-01-19 12:11 ` Juan Quintela
2010-01-19 12:17 ` Kirill A. Shutemov
0 siblings, 1 reply; 7+ messages in thread
From: Juan Quintela @ 2010-01-19 12:11 UTC (permalink / raw)
To: Kirill A. Shutemov; +Cc: qemu-devel
"Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> A variant of write(2) which handles partial write.
>
> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Hi
Have you updated this series? Is there any reason that you know when
they haven't been picked?
I am also interested in getting _FORTIFY_SOURCE=2 wo compile cleanly.
Thanks in advance, Juan.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
2010-01-19 12:11 ` [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full() Juan Quintela
@ 2010-01-19 12:17 ` Kirill A. Shutemov
2010-01-19 18:50 ` Blue Swirl
2010-01-19 19:43 ` Anthony Liguori
0 siblings, 2 replies; 7+ messages in thread
From: Kirill A. Shutemov @ 2010-01-19 12:17 UTC (permalink / raw)
To: Juan Quintela; +Cc: qemu-devel
On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela <quintela@redhat.com> wrote:
> "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
>> A variant of write(2) which handles partial write.
>>
>> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
>
> Hi
>
> Have you updated this series? Is there any reason that you know when
> they haven't been picked?
I don't know any reason, but I'm going to review it once again.
I also have plan to get rid of -fno-strict-aliasing where it's possible.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
2010-01-19 12:17 ` Kirill A. Shutemov
@ 2010-01-19 18:50 ` Blue Swirl
2010-01-19 19:43 ` Anthony Liguori
1 sibling, 0 replies; 7+ messages in thread
From: Blue Swirl @ 2010-01-19 18:50 UTC (permalink / raw)
To: Kirill A. Shutemov; +Cc: qemu-devel, Juan Quintela
On Tue, Jan 19, 2010 at 12:17 PM, Kirill A. Shutemov
<kirill@shutemov.name> wrote:
> On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela <quintela@redhat.com> wrote:
>> "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
>>> A variant of write(2) which handles partial write.
>>>
>>> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
>>
>> Hi
>>
>> Have you updated this series? Is there any reason that you know when
>> they haven't been picked?
>
> I don't know any reason, but I'm going to review it once again.
I don't know about others, but I didn't feel competent enough about
all possible corner cases of write().
> I also have plan to get rid of -fno-strict-aliasing where it's possible.
That should be interesting too, if it does not make code more unreadable.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
2010-01-19 12:17 ` Kirill A. Shutemov
2010-01-19 18:50 ` Blue Swirl
@ 2010-01-19 19:43 ` Anthony Liguori
2010-01-20 0:04 ` Juan Quintela
1 sibling, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2010-01-19 19:43 UTC (permalink / raw)
To: Kirill A. Shutemov; +Cc: qemu-devel, Juan Quintela
On 01/19/2010 06:17 AM, Kirill A. Shutemov wrote:
> On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela<quintela@redhat.com> wrote:
>
>> "Kirill A. Shutemov"<kirill@shutemov.name> wrote:
>>
>>> A variant of write(2) which handles partial write.
>>>
>>> Signed-off-by: Kirill A. Shutemov<kirill@shutemov.name>
>>>
>> Hi
>>
>> Have you updated this series? Is there any reason that you know when
>> they haven't been picked?
>>
> I don't know any reason, but I'm going to review it once again.
>
> I also have plan to get rid of -fno-strict-aliasing where it's possible.
>
I haven't reviewed the series in detail, but generally speaking I don't
feel that good about these sort of series.
You're essentially adding dummy error handling to quiet the compiler.
That's worse than just disabling -Werror because at least you aren't
losing the information in the code.
If you're going to update error handling, it should be part of an effort
to make code paths resilient to error. IOW, actually audit the full
error path of the function and make it deal with errors gracefully.
Regards,
Anthony Liguori
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
2010-01-19 19:43 ` Anthony Liguori
@ 2010-01-20 0:04 ` Juan Quintela
2010-01-20 1:04 ` Anthony Liguori
0 siblings, 1 reply; 7+ messages in thread
From: Juan Quintela @ 2010-01-20 0:04 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Kirill A. Shutemov, qemu-devel
Anthony Liguori <anthony@codemonkey.ws> wrote:
> On 01/19/2010 06:17 AM, Kirill A. Shutemov wrote:
>> On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela<quintela@redhat.com> wrote:
>>
>>> "Kirill A. Shutemov"<kirill@shutemov.name> wrote:
>>>
>>>> A variant of write(2) which handles partial write.
>>>>
>>>> Signed-off-by: Kirill A. Shutemov<kirill@shutemov.name>
>>>>
>>> Hi
>>>
>>> Have you updated this series? Is there any reason that you know when
>>> they haven't been picked?
>>>
>> I don't know any reason, but I'm going to review it once again.
>>
>> I also have plan to get rid of -fno-strict-aliasing where it's possible.
>>
>
> I haven't reviewed the series in detail, but generally speaking I
> don't feel that good about these sort of series.
>
> You're essentially adding dummy error handling to quiet the compiler.
> That's worse than just disabling -Werror because at least you aren't
> losing the information in the code.
>
> If you're going to update error handling, it should be part of an
> effort to make code paths resilient to error. IOW, actually audit the
> full error path of the function and make it deal with errors
> gracefully.
I reviewed his series, and I reviewed callers. Please take a look at my
improved series. Appart for the comments added there, I don't know what
to do here:
@@ -501,8 +501,11 @@ static void aio_signal_handler(int signum)
{
if (posix_aio_state) {
char byte = 0;
+ ssize_t ret;
- write(posix_aio_state->wfd, &byte, sizeof(byte));
+ ret = write(posix_aio_state->wfd, &byte, sizeof(byte));
+ if (ret < 0 && errno != EAGAIN)
+ die("write()");
}
if write() fails in a pipe in the signal handler, I am at a lost about
what to do here.
For the rest, I think that I did the proper error path handling.
Thanks, Juan.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
2010-01-20 0:04 ` Juan Quintela
@ 2010-01-20 1:04 ` Anthony Liguori
2010-01-20 1:30 ` Jamie Lokier
0 siblings, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2010-01-20 1:04 UTC (permalink / raw)
To: Juan Quintela; +Cc: Kirill A. Shutemov, qemu-devel
On 01/19/2010 06:04 PM, Juan Quintela wrote:
> Anthony Liguori<anthony@codemonkey.ws> wrote:
>
>> On 01/19/2010 06:17 AM, Kirill A. Shutemov wrote:
>>
>>> On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela<quintela@redhat.com> wrote:
>>>
>>>
>>>> "Kirill A. Shutemov"<kirill@shutemov.name> wrote:
>>>>
>>>>
>>>>> A variant of write(2) which handles partial write.
>>>>>
>>>>> Signed-off-by: Kirill A. Shutemov<kirill@shutemov.name>
>>>>>
>>>>>
>>>> Hi
>>>>
>>>> Have you updated this series? Is there any reason that you know when
>>>> they haven't been picked?
>>>>
>>>>
>>> I don't know any reason, but I'm going to review it once again.
>>>
>>> I also have plan to get rid of -fno-strict-aliasing where it's possible.
>>>
>>>
>> I haven't reviewed the series in detail, but generally speaking I
>> don't feel that good about these sort of series.
>>
>> You're essentially adding dummy error handling to quiet the compiler.
>> That's worse than just disabling -Werror because at least you aren't
>> losing the information in the code.
>>
>> If you're going to update error handling, it should be part of an
>> effort to make code paths resilient to error. IOW, actually audit the
>> full error path of the function and make it deal with errors
>> gracefully.
>>
> I reviewed his series, and I reviewed callers. Please take a look at my
> improved series. Appart for the comments added there, I don't know what
> to do here:
>
> @@ -501,8 +501,11 @@ static void aio_signal_handler(int signum)
> {
> if (posix_aio_state) {
> char byte = 0;
> + ssize_t ret;
>
> - write(posix_aio_state->wfd,&byte, sizeof(byte));
> + ret = write(posix_aio_state->wfd,&byte, sizeof(byte));
> + if (ret< 0&& errno != EAGAIN)
> + die("write()");
> }
>
> if write() fails in a pipe in the signal handler, I am at a lost about
> what to do here.
>
That's nothing we can do. I guess exiting is reasonable.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
2010-01-20 1:04 ` Anthony Liguori
@ 2010-01-20 1:30 ` Jamie Lokier
0 siblings, 0 replies; 7+ messages in thread
From: Jamie Lokier @ 2010-01-20 1:30 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Kirill A. Shutemov, qemu-devel, Juan Quintela
Anthony Liguori wrote:
> >- write(posix_aio_state->wfd,&byte, sizeof(byte));
> >+ ret = write(posix_aio_state->wfd,&byte, sizeof(byte));
> >+ if (ret< 0&& errno != EAGAIN)
> >+ die("write()");
> > }
> >
> >if write() fails in a pipe in the signal handler, I am at a lost about
> >what to do here.
>
> That's nothing we can do. I guess exiting is reasonable.
At least retry if it returns EINTR. That can happen in a signal
handler, if the handler does not block all other signals.
-- Jamie
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-01-20 1:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1262223199-19062-1-git-send-email-kirill@shutemov.name>
2010-01-19 12:11 ` [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full() Juan Quintela
2010-01-19 12:17 ` Kirill A. Shutemov
2010-01-19 18:50 ` Blue Swirl
2010-01-19 19:43 ` Anthony Liguori
2010-01-20 0:04 ` Juan Quintela
2010-01-20 1:04 ` Anthony Liguori
2010-01-20 1:30 ` Jamie Lokier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).