Bug 395939 - Ark keeps destination path open after extraction, preventing removable storage unmount
Summary: Ark keeps destination path open after extraction, preventing removable storag...
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (other bugs)
Version First Reported In: 17.12.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-27 22:15 UTC by James Hemsing
Modified: 2018-07-01 22:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 18.07.80
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Hemsing 2018-06-27 22:15:57 UTC
After using ark to extract files to a removable piece of media using the Extract button in the toolbar, ark keeps the path to that removable media open (visible in lsof). This prevents unmounting from either Dolphin or command line. Dolphin does not report who is still using the removable storage, so it is confusing.

Closing ark remedies the problem, but there have been occasions where I am copying files from an archive to various removable devices, and it is frustrating to have to close and reopen a large archive file just to do this. It seems like the destination directory should be closed when the extraction is complete.
Comment 1 Elvis Angelaccio 2018-07-01 22:19:49 UTC
Git commit dbe7eba74931af83c7fef47e75422dc00d5ab567 by Elvis Angelaccio.
Committed on 01/07/2018 at 21:49.
Pushed by elvisangelaccio into branch 'master'.

Add checks for expected working dir in the extraction tests

After an extraction ends, the current working directory should be the
same we started from. Otherwise Ark might prevent unmounting of
removable devices.

M  +11   -0    autotests/app/batchextracttest.cpp
M  +11   -0    autotests/kerfuffle/extracttest.cpp

https://commits.kde.org/ark/dbe7eba74931af83c7fef47e75422dc00d5ab567
Comment 2 Elvis Angelaccio 2018-07-01 22:19:49 UTC
Git commit 478d2d71f861f51ca561282727bd876cfc622370 by Elvis Angelaccio.
Committed on 01/07/2018 at 21:50.
Pushed by elvisangelaccio into branch 'master'.

libarchive: restore old working directory after extraction

Otherwise Ark might prevent unmounting of removable devices.

To simplify the logic in `extractFiles()`, we move the
`QDir::setCurrent()` call as far as possible (which is before the huge
while loop).

M  +21   -4    plugins/libarchive/libarchiveplugin.cpp
M  +4    -0    plugins/libarchive/libarchiveplugin.h

https://commits.kde.org/ark/478d2d71f861f51ca561282727bd876cfc622370
Comment 3 Elvis Angelaccio 2018-07-01 22:19:49 UTC
Git commit 36d6287503ad9d0879f97709cffee60fdc24a651 by Elvis Angelaccio.
Committed on 01/07/2018 at 22:14.
Pushed by elvisangelaccio into branch 'master'.

cliinterface: restore old working directory after extraction

Otherwise Ark might prevent unmounting of removable devices.

To fix this issue we only need to save the current working dir before
the very first `QDir::setCurrent()` call in `extractFiles()`, and also
to restore it at the end of every extraction.

However, since `m_oldWorkingDir` is used also by copy and move jobs, we
can't touch it from extract jobs, otherwise we'll break `movetest`.

As workaround, we can use a new variable that will be used only by
extract jobs.
FIXED-IN: 18.07.80

M  +17   -4    kerfuffle/cliinterface.cpp
M  +3    -1    kerfuffle/cliinterface.h

https://commits.kde.org/ark/36d6287503ad9d0879f97709cffee60fdc24a651