Fix possible infinite recursion in psio_error when the scratch disk is completely full #2773
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.
Description
While testing PR #2756, I have discovered a regression introduced by an earlier PR (#2700) of mine.
Before
throw
ing,psio_error()
tries to write some data to the scratch files. But ifpsio_error()
is called due to a write error, and the scratch disk is completely full, then this write will also fail, leading topsio_error()
getting called again, and an infinite recursion ensues. The source of the regression is thatpsio_tocwrite()
ends up callingwt_toclen()
, which has been enhanced in #2700 to usepsio_error()
if it fails.This PR resolves the issue by not trying to write anything to scratch if
psio_error()
is called due to a write failure.User API & Changelog headlines
Dev notes & details
psio_tocwrite()
inpsio_error()
iferrval == PSIO_ERROR_WRITE
Status