Bug 1387921

Summary: gvfsd-mtp POSIX file creation operation not supported
Product: [Fedora] Fedora Reporter: Ross Tyler <rossetyler>
Component: libmtpAssignee: Linus Walleij <triad>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 24CC: alexl, oholy, rossetyler, triad
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 18:58:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
mtp-detect output none

Description Ross Tyler 2016-10-23 16:59:04 UTC
Description of problem:
Unable to create a FILE in a gvfs mtp filesystem using POSIX based tools.
For example,

>FILE
bash: FILE: Operation not supported

Version-Release number of selected component (if applicable):
gvfs-mtp-1.28.3-1.fc24.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Plugin MTP capable phone (e.g. Samsung Galaxy s6 through USB OTG)
2. ALLOW access and confirm using Nautilus
3. Attempt to create a file with bash (as above) under mount point

Actual results:
bash: FILE: Operation not supported
# no file created

Expected results:
<silence>
# file created

Additional info:
strace on above (bash error) shows:

open("FILE", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EOPNOTSUPP (Operation not supported)

My actual use case is to synchronize my music to my phone using rsync.
rsync complains similarly and strace shows:

open("FILE", O_WRONLY|O_CREAT, 0600) = -1 EOPNOTSUPP (Operation not supported)

GIO file creation (e.g. from Nautilus) works.

Comment 1 Ondrej Holy 2016-10-24 07:33:16 UTC
Thanks for your bug report. It sounds like that Samsung Galaxy S6 doesn't support android extensions. Can you please provide mtp-detect.out obtained following way?
pkill -f gvfs; mtp-detect &> mtp-detect.out

Comment 2 Ross Tyler 2016-10-24 13:39:33 UTC
> It sounds like that Samsung Galaxy S6 doesn't support android extensions

I was thinking the same thing after looking at the code (gvfsbackendmtp.c:do_create). If I am interpreting it right, EOPNOTSUPP is returned upon file creation if "android.com" is not listed among the MTP device's extensions. I didn't know how to list these. mtp-detect seems to do the job (thanks!).

> Can you please provide mtp-detect output ...

See attached and snippets here:

Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
LIBMTP ERROR: couldnt parse extension samsung.com/devicestatus:1
Error 1: Get Storage information failed.
libmtp version: 1.1.11
...
Device info:
   Manufacturer: Samsung Electronics Co., Ltd.
   Model: SAMSUNG-SM-G920A
   Device version: G920AUCS5DPI11&03157df35ac4131d
   Serial number: R38G401JAEH
   Vendor extension ID: 0x00000006
   Vendor extension description: microsoft.com: 1.0; microsoft.com/WMPPD: 11.0; microsoft.com/WMPPD: 10.0;samsung.com/kies:3.0;samsung.com/devicestatus:1;samsung.com/sidesync3.1;
   Detected object size: 64 bits
   Extensions:
        microsoft.com: 1.0
        microsoft.com/WMPPD: 11.0
        microsoft.com/WMPPD: 10.0
        samsung.com/kies: 3.0
...

Note the error at the beginning.
Perhaps this is related to a libmtp problem:
https://sourceforge.net/p/libmtp/bugs/1593/
^ Note my additions to this.
I wonder if the phone is supporting the "android.com" extensions but not reporting them to libmtp's satisfaction.

As stated above, my normal use case is simple-mtpfs/rsync.
That broke after an AT&T update.
https://www.att.com/esupport/article.html#!/wireless/KB426709
I submitted an issue agains simple-mtpfs
https://github.com/phatina/simple-mtpfs/issues/48

After simple-mtpfs broke for me, I revisited gvfsd-mtp and was thwarted there as well.

Comment 3 Ross Tyler 2016-10-24 13:53:28 UTC
Created attachment 1213487 [details]
mtp-detect output

pkill -f gvfs
mtp-detect >/tmp/mtp-detect.txt 2>&1

Comment 4 Ondrej Holy 2016-10-25 13:01:22 UTC
We can't do much without the android extensions. It is possible that the extension was disabled by the AT&T update, or some libmtp update. Best place to deal with it is libmtp upstream...

Comment 5 Fedora End Of Life 2017-07-25 23:34:55 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2017-08-08 18:58:45 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.