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

lio_read should return the number of bytes actually read #126

Open
PerilousApricot opened this issue Sep 28, 2016 · 6 comments
Open

lio_read should return the number of bytes actually read #126

PerilousApricot opened this issue Sep 28, 2016 · 6 comments

Comments

@PerilousApricot
Copy link
Member

Currently, lio_read just kicks back the same size that the user passed in, even if that read would go beyond the end of the file:

https://github.com/accre/lstore/blob/master/src/lio/lio_core_io.c#L963

That means there's no way to know "where" the EOF was hit, just that the next time you read you'll get zero bytes

@tacketar
Copy link
Contributor

Good catch. It's looks to be a pretty easy fix. I'll take care of it
next week when I write the example GOP and open/write/read/close
examples. It can be one of the examples. It's complicated by the read
ahead cache buffering but it looks like _gop_lio_read() calculates the
actual number of bytes dumped in the buffer excluding any read ahead.
That just needs to get passed back and returned as the actual number of
bytes instead of what the user passes in.

@PerilousApricot
Copy link
Member Author

Prolly worth checking the write variant. Gridftp plugin is blocking on
this, FWIW

It's dark in this basement.

@tacketar
Copy link
Contributor

Write looks fine.

@PerilousApricot
Copy link
Member Author

PerilousApricot commented Sep 28, 2016 via email

@tacketar
Copy link
Contributor

Sure. I'll knock it out this afternoon.

@PerilousApricot
Copy link
Member Author

PerilousApricot commented Sep 28, 2016 via email

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

No branches or pull requests

2 participants