incusd/storage/truenas: Fix SetVolumeQuota issue when growing FS volumes #2783
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.
Fixes #2776
When growing an FS volume, the remote volume was resized, but the change was not visible until the remote volume was re-activated.
Thus the filesystem was only expanded to the visible size, but since the visible size was still the old size, this would cause a quiet failure.
The first thing to do was to actually check the device size after the resize to determine if the resize had succeeded before attempting a FS resize, which should then succeed
The second part of the fix is to simply activate the volume after resizing it rather than before, which means it can succeed.
Unfortunately, this means we could no longer grow an inUse filesystem, as we must de-activate in order to re-activate.
To rectify this,
iscsi refreshsupport was added to the TrueNAS tool, and when using version >=0.7.5, the driver can refresh the iscsi bus to pickup a size change without having to de-activate an inUse volume.When the
iscsi refreshcommand is not available, and the volume is not in use, the driver will atttempt to de-activate the volume before changing the size.