Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process_ibfile doesn't handle partial reads #10

Open
GoogleCodeExporter opened this issue Mar 29, 2016 · 0 comments
Open

process_ibfile doesn't handle partial reads #10

GoogleCodeExporter opened this issue Mar 29, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

process_ibfile assumes that partial reads (returns less than the requested
amount of data) indicates an error. That is not an error and more likely
when reading from NFS.

------

The code from process_ibfile is:
        // Read pages to the end of file
        while ((read_bytes = read(fn, page, UNIV_PAGE_SIZE)) ==
UNIV_PAGE_SIZE) {

------

The reads should be retried until -1 is returned. From the man page:
       On success, the number of bytes read is returned (zero indicates end
of file), and the file position is advanced by this number.  It is not an
error if this number is smaller than
       the number of bytes requested; this may happen for example because
fewer bytes are actually available right now (maybe because we were close
to  end-of-file,  or  because  we  are
       reading from a pipe, or from a terminal), or because read() was
interrupted by a signal.  On error, -1 is returned, and errno is set
appropriately. In this case it is left unspec-
       ified whether the file position (if any) changes.


Original issue reported on code.google.com by [email protected] on 8 Oct 2009 at 4:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant