-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix file size computation on 32bit platforms #23257
Fix file size computation on 32bit platforms #23257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
@kesselb i am aware of the issue you are referencing to, but it's unrelated to this. |
I am desperately waiting for a fix of this problem, because my Nextcloud on a 32bit system (ODROID-HC2) is not really working anymore due to this problem. Furthermore I use a snap installation and therefore I can't change the few lines of code by myself but have to wait until the fix is first officially implemented in the Nextcloud and secondly in the snap... Thanks to everyone who contributes to the solution here! |
@rullzer @ChristophWurst any chance of merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My files are now shown with the right size on my 32bit system
I'm in the same boat, or one boat over - I'm running Nextcloudpi on an Odroid-HC2, and I have many large files I cannot add until it's fixed. I don't think I have the expertise to edit that file, so I'm stuck waiting for the patch to be merged, and then for the folks at Nextcloudpi to test and approve the patched version. I echo your thanks to all who are working on this! |
Unfortunately some tests broke:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
i use NextCloudPi 19.0.4 |
@MorrisJobke @rullzer @ChristophWurst hello, i finally got time to find out why tests failed and fix the issue. Thanks for your work. |
Appreciate the work. There are many of us desperately waiting for this patch to finally upgrade from v18. I hope the developers (@MorrisJobke @rullzer @ChristophWurst ) will take a look and merge this if all is good. |
Signed-off-by: aler9 <46489434+aler9@users.noreply.github.com>
I waited for the Drone server to be fixed, then i force-pulled a couple of times, and finally all tests passed. |
They are related to other stuff - we are already looking into this. But thanks for this. And also thanks for the contribution :) |
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
/backport to stable20 |
/backport to stable19 |
This fixes #5031 (or at least, the comments referring to versions >= 19.0.0RC1)
Steps to reproduce
Run
./occ files:scan --all
on a server running on a 32bit platform (in my case, a Raspberry Pi 4 with 32bit Raspberry Pi OS)Expected behavior
The size of files bigger than 4GB, displayed in the UI and saved in the DB, should correspond to the actual file size.
Actual behaviour
the size of files bigger than 4GB gets replaced with an apparently random value, making impossible to download the file correctly.
Reason
This is caused by a recent optimization, included in all releases starting from v19.0.0RC1, that reintroduced the native PHP function
stat()
for computing file metadatas. Thefilesize
component of the array returned bystat()
is broken on 32bit platforms, like the Raspberry Pi, and contains a wrong value. This behavior is well known and was already addressed in the past, with the introduction of a dedicated method that fixes the output ofstat()
.Fix
This patch replace
stat()
with the already-developedstat()
workaround, restoring the correct behavior.