From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXOzV-0000Rq-Lb for qemu-devel@nongnu.org; Tue, 19 Jan 2010 20:04:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXOzQ-0000Qa-6y for qemu-devel@nongnu.org; Tue, 19 Jan 2010 20:04:12 -0500 Received: from [199.232.76.173] (port=49287 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXOzP-0000QQ-Ms for qemu-devel@nongnu.org; Tue, 19 Jan 2010 20:04:07 -0500 Received: from mail-yx0-f188.google.com ([209.85.210.188]:33097) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXOzP-00033I-6i for qemu-devel@nongnu.org; Tue, 19 Jan 2010 20:04:07 -0500 Received: by yxe26 with SMTP id 26so3835281yxe.4 for ; Tue, 19 Jan 2010 17:04:06 -0800 (PST) Message-ID: <4B565684.2080809@codemonkey.ws> Date: Tue, 19 Jan 2010 19:04:04 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1262223199-19062-1-git-send-email-kirill@shutemov.name> <4B560B6A.4090303@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: "Kirill A. Shutemov" , qemu-devel@nongnu.org On 01/19/2010 06:04 PM, Juan Quintela wrote: > Anthony Liguori wrote: > >> On 01/19/2010 06:17 AM, Kirill A. Shutemov wrote: >> >>> On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela wrote: >>> >>> >>>> "Kirill A. Shutemov" wrote: >>>> >>>> >>>>> A variant of write(2) which handles partial write. >>>>> >>>>> Signed-off-by: Kirill A. Shutemov >>>>> >>>>> >>>> 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