https://bugs.kde.org/show_bug.cgi?id=412257

Tomasz Bojanowski <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #31 from Tomasz Bojanowski <[email protected]> ---
Hi,

I can still reproduce this on current master (e0761c7), without Plasma, using
only `kioclient ls mtp:/` and a Garmin watch (MTP):

- After the first access to mtp:/, kiod6 keeps the device claimed until kiod6
exits.
- After unplugging and replugging the cable, kmtpd claims the device again
about 30 ms after it appears, without any KIO access.
- Only `kquitapp6 kiod6` releases it.

So the device is held by kmtpd itself, not by Plasma's device discovery (see
bug 499635). While kmtpd holds it, every other libmtp user fails: mtp-detect
reports "device is busy" and gvfs-mtp cannot open the device. This also breaks
third-party tools that talk to MTP devices directly. Bug 411489 looks like it
has the same root cause.

To answer the question from comment #8: I don't expect KIO and another app to
use the device at the same time. I expect the device to be free whenever it is
not actively being used through KIO.

I'd like to implement what was suggested earlier in this report: claim the
device lazily and release it eagerly.

1. kmtpd opens a device only on the first real KIO operation, not when it is
plugged in.
2. kmtpd releases a device after a period of inactivity, configurable in
kmtpdrc (DeviceIdleTimeout). I'd default to 120 s, because Dolphin polls free
space every 60 s while the device view is open. A running copy or listing would
block the release.

No D-Bus API changes, everything stays in mtp/kiod_module. I'd split this into
small MRs, starting with a separate fix for duplicate D-Bus object paths when
devices are replugged.

Would this approach be acceptable? Any concerns about the setting or its
default value?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to