Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da2d0bb4 authored by Akilesh Kailash's avatar Akilesh Kailash Committed by Automerger Merge Worker
Browse files

Merge "If there an error, cqe field is not allocated by io_uring_wait_cqe();...

Merge "If there an error, cqe field is not allocated by io_uring_wait_cqe(); return the error immediately." am: ca0c5c5b am: 1c32ca78 am: 9e280cd6

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2012250

Change-Id: I33c7fe5ed36434ce183e4b0047a7dc47dfbd2ea6
parents 09d439fc 9e280cd6
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -288,9 +288,6 @@ bool Worker::MergeOrderedOpsAsync() {
                while (pending_ios_to_complete) {
                    struct io_uring_cqe* cqe;

                    // We need to make sure to reap all the I/O's submitted
                    // even if there are any errors observed.
                    //
                    // io_uring_wait_cqe can potentially return -EAGAIN or -EINTR;
                    // these error codes are not truly I/O errors; we can retry them
                    // by re-populating the SQE entries and submitting the I/O
@@ -300,11 +297,13 @@ bool Worker::MergeOrderedOpsAsync() {
                    if (ret) {
                        SNAP_LOG(ERROR) << "Merge: io_uring_wait_cqe failed: " << ret;
                        status = false;
                        break;
                    }

                    if (cqe->res < 0) {
                        SNAP_LOG(ERROR) << "Merge: io_uring_wait_cqe failed with res: " << cqe->res;
                        status = false;
                        break;
                    }

                    io_uring_cqe_seen(ring_.get(), cqe);
+2 −3
Original line number Diff line number Diff line
@@ -395,9 +395,6 @@ bool ReadAhead::ReapIoCompletions(int pending_ios_to_complete) {
    while (pending_ios_to_complete) {
        struct io_uring_cqe* cqe;

        // We need to make sure to reap all the I/O's submitted
        // even if there are any errors observed.
        //
        // io_uring_wait_cqe can potentially return -EAGAIN or -EINTR;
        // these error codes are not truly I/O errors; we can retry them
        // by re-populating the SQE entries and submitting the I/O
@@ -407,11 +404,13 @@ bool ReadAhead::ReapIoCompletions(int pending_ios_to_complete) {
        if (ret) {
            SNAP_LOG(ERROR) << "Read-ahead - io_uring_wait_cqe failed: " << ret;
            status = false;
            break;
        }

        if (cqe->res < 0) {
            SNAP_LOG(ERROR) << "Read-ahead - io_uring_Wait_cqe failed with res: " << cqe->res;
            status = false;
            break;
        }

        io_uring_cqe_seen(ring_.get(), cqe);