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

[Xrd] Fix a short writev recovery case #1825

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Conversation

smithdh
Copy link
Contributor

@smithdh smithdh commented Nov 10, 2022

While looking into another problem I noticed an apparently not-handled case in XrdLinkXeq::SendIOV when it resumes a write after an incomplete writev: For instance in the case of iocnt=2, if the writev returns a short number of bytes from the first iov, iov[0], then remainder of iov[0] is sent by write(), and then iov[1] is sent by writev() [all as intended]; but then an attempt would be made to write() the contents of iov[2]. This should either give an error like ("bad address") for the link, or possibly send some trailing nonsense data to the client.

In fact I don't think this was related to the problem I had been looking at, and I didn't find any indication this is happening. e.g. even if I look at a busy server I don't notice any "bad address" link errors. So maybe this is rather rare or even not possible for some reason I've not understood. (e.g. iov[0] is typically very short, e.g. 8 bytes, and iov[1] or iov[2] is much longer, so a short writev is more likely to happen in the last iov[]).

@abh3 abh3 merged commit 3ff8feb into xrootd:master Nov 16, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants