After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786586 - Shouldn't copy whole file before trying to thumbnail it
Shouldn't copy whole file before trying to thumbnail it
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: Thumbnail
3.25.x
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-21 23:05 UTC by Bastien Nocera
Modified: 2017-08-22 11:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
thumbnail: Don't copy files to /tmp before using them (2.02 KB, patch)
2017-08-22 11:07 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2017-08-21 23:05:54 UTC
I misunderstood what --file did, and expected accesses to the fd passed through "--file" to be proxying accesses for the real file, not the whole file to be copied into the sandbox.

While this isn't such a problem for formats like images where the data is nearly 100% what's on screen, videos, and documents not so much.

This could be a pretty bad regression in terms of performance for 3.26, so really needs fixing.

Alex, any ideas?
Comment 1 Bastien Nocera 2017-08-22 11:07:40 UTC
Created attachment 358131 [details] [review]
thumbnail: Don't copy files to /tmp before using them

Instead of copying whole files to the sandbox, bind mount the _file_.
This is especially important when dealing with huge files when only a
tiny portion of the file will actually be read.
Comment 2 Bastien Nocera 2017-08-22 11:09:50 UTC
Attachment 358131 [details] pushed as 25fff6a - thumbnail: Don't copy files to /tmp before using them