Skip to contentSkip to conversation

usb-mtp: change default to success for usb_mtp_update_object

PATCH In review Bandan Das 2 participants 3 messages Apr 15, 2019 – Apr 17, 2019

lore
Share & tools
lore

Bandan Das

author
#0 lore raw

PATCH 1/1 usb-mtp: change default to success for usb_mtp_update_object

Commit c5ead51f90cf (usb-mtp: return incomplete transfer on a lstat failure) checks if lstat succeeded when updating attributes of a file. However, it also changed behavior to return an error by default. This is incorrect because for smaller file sizes, Qemu will attempt to write the file in one go and there won't be an object for it.

Fixes c5ead51f90cf
---
 hw/usb/dev-mtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/dev-mtp.c +1 -1
index ebf210fbf8..5de22738ce 100644
@@ -1587,7 +1587,7 @@ done:
 
 static int usb_mtp_update_object(MTPObject *parent, char *name)
 {
-    int ret = -1;
+    int ret = 0;
 
     MTPObject *o =
         usb_mtp_object_lookup_name(parent, name, strlen(name));
Signature · 1 line
2.19.2
author
#1 lore raw

Forgot to cc people ...

Quoted 26 lines · Bandan Das

Commit c5ead51f90cf (usb-mtp: return incomplete transfer on a lstat failure) checks if lstat succeeded when updating attributes of a file. However, it also changed behavior to return an error by default. This is incorrect because for smaller file sizes, Qemu will attempt to write the file in one go and there won't be an object for it.

Fixes c5ead51f90cf
---
 hw/usb/dev-mtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/dev-mtp.c +1 -1
index ebf210fbf8..5de22738ce 100644
@@ -1587,7 +1587,7 @@ done:
 
 static int usb_mtp_update_object(MTPObject *parent, char *name)
 {
-    int ret = -1;
+    int ret = 0;
 
     MTPObject *o =
         usb_mtp_object_lookup_name(parent, name, strlen(name));
#2 lore raw
Quoted 10 lines · Bandan Das

Forgot to cc people ...

Quoted 6 lines · Bandan Das

Commit c5ead51f90cf (usb-mtp: return incomplete transfer on a lstat failure) checks if lstat succeeded when updating attributes of a file. However, it also changed behavior to return an error by default. This is incorrect because for smaller file sizes, Qemu will attempt to write the file in one go and there won't be an object for it.

Patch added to usb queue.

Current queue is https://git.kraxel.org/cgit/qemu/log/?h=queue/usb

If anything is missing there please resend.

thanks,
Gerd