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

add a disk_free_space check before writing config #36691

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

szaimen
Copy link
Contributor

@szaimen szaimen commented Feb 13, 2023

Fix #25175

Idea: the config file should simply not get written if disk space is low. Instead the current process should be exited. This should hopefully fix such issues in the future.

I am using the same logic in AIO and it works great over there.
https://github.com/nextcloud/all-in-one/blob/feffba739ae5ef2911782514fa5de367d52cf811/php/src/Data/ConfigurationManager.php#L455-L458

@szaimen szaimen added bug 3. to review Waiting for reviews labels Feb 13, 2023
@szaimen szaimen added this to the Nextcloud 26 milestone Feb 13, 2023
@szaimen szaimen requested review from a team, ArtificialOwl, icewind1991, blizzz and come-nc and removed request for a team February 13, 2023 13:59
lib/private/Config.php Outdated Show resolved Hide resolved
@szaimen szaimen force-pushed the fix/25175/fix-config-truncating branch from f9d8ecc to c03d3ae Compare February 13, 2023 14:28
@szaimen szaimen requested a review from st3iny February 13, 2023 14:28
lib/private/Config.php Outdated Show resolved Hide resolved
@szaimen szaimen force-pushed the fix/25175/fix-config-truncating branch from c03d3ae to 9b6e5c6 Compare February 13, 2023 15:26
Signed-off-by: Simon L <[email protected]>
@szaimen
Copy link
Contributor Author

szaimen commented Feb 15, 2023

CI failure unrelated

@szaimen szaimen merged commit 228911c into master Feb 15, 2023
@szaimen szaimen deleted the fix/25175/fix-config-truncating branch February 15, 2023 17:25
@szaimen
Copy link
Contributor Author

szaimen commented Feb 15, 2023

/backport to stable25

@szaimen
Copy link
Contributor Author

szaimen commented Feb 15, 2023

/backport to stable24

@MichaIng
Copy link
Member

MichaIng commented Feb 17, 2023

At least on my 32-bit instance this breaks the update. I just removed (int) and now it works. Is there a way to allow it being an int as well as a float (for 32-bit systems with >2 GiB free space) without removing the hint completely?

EDIT: Ah, already addressed here: #36759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config file truncated when low on disk space
6 participants