Fix RR CE chaining - #178
Merged
Merged
Conversation
If an RR CE entry wouldn't fit, add_entry() would detect it and return an error. Unfortunately, that was documented as None but it actually returned -1. Fix this, and add tests to prove it. While we are in here, also fix a related bug where failing to add an RR CE entry after we have already failed to fit would silently corrupt data. We now throw an exception. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Chained CE areas are supported by the standard and the linux isofs driver, so make sure we can also parse them. Right now we cannot right them, so the tests make one out of whole cloth rather than using our write(). Signed-off-by: Chris Lalancette <clalancette@gmail.com>
This is the last bit of full RR CE handling; the ability to write out e.g. symlinks that are too long for one CE area. Implement this along with tests. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #177 pointed out that trying to write out an ISO with more than one RR CE records failed because the RockRidge.add_entry() method didn't live up to its documented contract of returning None when it couldn't find room in the RR CE entry. Fix this by changing that method to return None as appropriate.
While we were looking at this, we also noticed that RR CE "chaining" didn't really work for reading or writing either. That is, RR CE blocks can be arbitrarily chained, one to the next, to handle very long entries. But we didn't support reading or writing those entries, so they would also fail. Fix this so we are more robust to this type of thing. In reality, this amount of chaining is rare, and is practically limited by the length of filesystem entries (typically PATH_MAX). Nonetheless, we should support them as well as we can.
Fixes #177