All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb-mtp: change default to success for usb_mtp_update_object
@ 2019-04-15 16:47 Bandan Das
  2019-04-15 16:50 ` Bandan Das
  0 siblings, 1 reply; 4+ messages in thread
From: Bandan Das @ 2019-04-15 16:47 UTC (permalink / raw)
  To: qemu-devel


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
Signed-off-by: Bandan Das <bsd@redhat.com>
---
 hw/usb/dev-mtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index ebf210fbf8..5de22738ce 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -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.19.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] usb-mtp: change default to success for usb_mtp_update_object
  2019-04-15 16:47 [Qemu-devel] [PATCH] usb-mtp: change default to success for usb_mtp_update_object Bandan Das
@ 2019-04-15 16:50 ` Bandan Das
  2019-04-17  8:29     ` Gerd Hoffmann
  0 siblings, 1 reply; 4+ messages in thread
From: Bandan Das @ 2019-04-15 16:50 UTC (permalink / raw)
  To: Gerd Hoffmann, Daniel P. Berrange; +Cc: qemu-devel

Forgot to cc people ...

Bandan Das <bsd@redhat.com> writes:

> 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
> Signed-off-by: Bandan Das <bsd@redhat.com>
> ---
>  hw/usb/dev-mtp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
> index ebf210fbf8..5de22738ce 100644
> --- a/hw/usb/dev-mtp.c
> +++ b/hw/usb/dev-mtp.c
> @@ -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));

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] usb-mtp: change default to success for usb_mtp_update_object
@ 2019-04-17  8:29     ` Gerd Hoffmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2019-04-17  8:29 UTC (permalink / raw)
  To: Bandan Das; +Cc: Daniel P. Berrange, qemu-devel

On Mon, Apr 15, 2019 at 12:50:43PM -0400, Bandan Das wrote:
> Forgot to cc people ...
> 
> Bandan Das <bsd@redhat.com> writes:
> 
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] usb-mtp: change default to success for usb_mtp_update_object
@ 2019-04-17  8:29     ` Gerd Hoffmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2019-04-17  8:29 UTC (permalink / raw)
  To: Bandan Das; +Cc: qemu-devel

On Mon, Apr 15, 2019 at 12:50:43PM -0400, Bandan Das wrote:
> Forgot to cc people ...
> 
> Bandan Das <bsd@redhat.com> writes:
> 
> > 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-17  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-15 16:47 [Qemu-devel] [PATCH] usb-mtp: change default to success for usb_mtp_update_object Bandan Das
2019-04-15 16:50 ` Bandan Das
2019-04-17  8:29   ` Gerd Hoffmann
2019-04-17  8:29     ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.