Commit 1527977f authored by Ramon Nou's avatar Ramon Nou
Browse files

fix: remove redundant zero-read checks in client read functions

Remove the explicit check that converts a zero read count to an error in gkfs_preadv, and delete the corresponding assertion in gkfs_readv. Zero-length reads are valid and should be allowed to propagate instead of being treated as failures.
parent f70d54e5
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -703,9 +703,6 @@ gkfs_preadv(int fd, const struct iovec* iov, int iovcnt, off_t offset) {
        }
    }

    if(read == 0) {
        return -1;
    }
    return read;
}

@@ -727,7 +724,6 @@ gkfs_readv(int fd, const struct iovec* iov, int iovcnt) {
    }
    auto pos = gkfs_fd->pos(); // retrieve the current offset
    auto ret = gkfs_preadv(fd, iov, iovcnt, pos);
    assert(ret != 0);
    if(ret < 0) {
        return -1;
    }