fix(backup): skip loading the backingFile when doing backup or when user requests exporting the volume without backingFile (backport #1187) #1188
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.
@ChanYiLin has awesome analysis that sometime we are still loading backing file layer on sle-micro ARM64 when doing backup link. This is not correct because we should skip loading backing file when doing backup
The current implementation relies on the assumption that file descriptor of backingFile is always 0 and uses it to skip loading the backingFile layer: link . However, this assumption is not always correct. For example, with RAW backing image,
fd
is not 0. See more details at link . For qcow backing image, that assumption is correct because qcow image has hard coded to have FD 0 here https://github.com/longhorn/longhorn-engine/blob/04c645097a4a93e46f0f0391222895ea06b25456/pkg/qcow/libqcow.go#L84-L87This PR propose a this fix which always skip loading backingFile and doesn't rely on the assumption that backing file has
fd
as0
longhorn/longhorn#9209
This is an automatic backport of pull request #1187 done by [Mergify](https://mergify.com).