Skip to contentSkip to conversation

Introduce qemu_write_full()

PATCH Juan Quintela 5 participants 7 messages Jan 19, 2010 – Jan 20, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Kirill A. Shutemov

A variant of write(2) which handles partial write.

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.

#2 lore raw
Quoted 9 lines · Juan Quintela
Quoted 3 lines · Kirill A. Shutemov

A variant of write(2) which handles partial write.

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.

#3 lore raw
Quoted 4 lines · Kirill A. Shutemov
Quoted 3 lines · Juan Quintela
Quoted 2 lines · Kirill A. Shutemov

A variant of write(2) which handles partial write.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

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().

Quoted 1 line

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.

#4 lore raw
In reply to Kirill A. Shutemov
Quoted 8 lines · Kirill A. Shutemov
Quoted 6 lines · Juan Quintela
Quoted 4 lines · Kirill A. Shutemov

A variant of write(2) which handles partial write.

Quoted 9 lines
Quoted 5 lines

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

Quoted 2 lines
#5 lore raw
Quoted 22 lines · Anthony Liguori
Quoted 8 lines · Kirill A. Shutemov
Quoted 6 lines · Juan Quintela
Quoted 4 lines · Kirill A. Shutemov

A variant of write(2) which handles partial write.

Quoted 9 lines
Quoted 5 lines

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.

Quoted 8 lines

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.

#6 lore raw
Quoted 54 lines · Juan Quintela
Quoted 27 lines · Anthony Liguori
Quoted 13 lines · Kirill A. Shutemov
Quoted 10 lines · Juan Quintela
Quoted 5 lines · Kirill A. Shutemov

A variant of write(2) which handles partial write.

Hi

Quoted 9 lines
Quoted 4 lines

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.

Quoted 9 lines

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:

(quoted diff) +4 -1
@@ -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()");
      }
 
Quoted 3 lines

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

#7 lore raw
Quoted 10 lines · Anthony Liguori
Quoted 8 lines
(quoted diff) +3 -1
-        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