[Qemu-devel] [PATCH] 9pfs: fix v9fs_mark_fids_unreclaim() return value

Greg Kurz posted 1 patch 8 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/150851985854.6309.16575977719112120440.stgit@bahia.lan
Test checkpatch passed
Test docker passed
Test s390x passed
hw/9pfs/9p.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] 9pfs: fix v9fs_mark_fids_unreclaim() return value
Posted by Greg Kurz 8 years ago
The return value of v9fs_mark_fids_unreclaim() is then propagated to
pdu_complete(). It should be a negative errno, not -1.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/9pfs/9p.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index f8bbac251dc9..52d46632fe15 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -512,7 +512,7 @@ static int coroutine_fn v9fs_mark_fids_unreclaim(V9fsPDU *pdu, V9fsPath *path)
             /* reopen the file/dir if already closed */
             err = v9fs_reopen_fid(pdu, fidp);
             if (err < 0) {
-                return -1;
+                return err;
             }
             /*
              * Go back to head of fid list because


Re: [Qemu-devel] [PATCH] 9pfs: fix v9fs_mark_fids_unreclaim() return value
Posted by Eric Blake 8 years ago
On 10/20/2017 12:17 PM, Greg Kurz wrote:
> The return value of v9fs_mark_fids_unreclaim() is then propagated to
> pdu_complete(). It should be a negative errno, not -1.

(which happens to be -EPERM on Linux. I like that GNU Hurd picked errno
values far away from 1, so that -1 is distinguishable from a negative
errno on that platform, but I haven't seen evidence of whether anyone
cares if qemu and/or 9pfs compiles on Hurd...)

> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  hw/9pfs/9p.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org