qemu-e2k/hw/9pfs
Christian Schoenebeck a93d2e89e5 9pfs: fix 'Twalk' to only send error if no component walked
Current implementation of 'Twalk' request handling always sends an 'Rerror'
response if any error occured. The 9p2000 protocol spec says though:

  "
  If the first element cannot be walked for any reason, Rerror is returned.
  Otherwise, the walk will return an Rwalk message containing nwqid qids
  corresponding, in order, to the files that are visited by the nwqid
  successful elementwise walks; nwqid is therefore either nwname or the index
  of the first elementwise walk that failed.
  "

  http://ericvh.github.io/9p-rfc/rfc9p2000.html#anchor33

For that reason we are no longer leaving from an error path in function
v9fs_walk(), unless really no path component could be walked successfully or
if the request has been interrupted.

Local variable 'nwalked' counts and reflects the number of path components
successfully processed by background I/O thread, whereas local variable
'name_idx' subsequently counts and reflects the number of path components
eventually accepted successfully by 9p server controller portion.

New local variable 'any_err' is an aggregate variable reflecting whether any
error occurred at all, while already existing variable 'err' only reflects
the last error.

Despite QIDs being delivered to client in a more relaxed way now, it is
important to note though that fid still must remain unaffected if any error
occurred.

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <bc73e24258a75dc29458024c7936c8a036c3eac5.1647339025.git.qemu_oss@crudebyte.com>
2022-06-16 12:44:52 +02:00
..
9p-local.c 9p: darwin: Implement compatibility for mknodat 2022-03-07 11:49:31 +01:00
9p-local.h
9p-posix-acl.c 9pfs: fix removing non-existent POSIX ACL xattr on macOS host 2022-05-01 14:07:03 +02:00
9p-proxy.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
9p-proxy.h
9p-synth.c 9pfs: fix inode sequencing in 'synth' driver 2022-04-30 13:11:47 +02:00
9p-synth.h
9p-util-darwin.c 9pfs: fix qemu_mknodat() to always return -1 on error on macOS host 2022-05-01 14:07:03 +02:00
9p-util-linux.c 9p: darwin: Implement compatibility for mknodat 2022-03-07 11:49:31 +01:00
9p-util.h 9pfs: fix wrong errno being sent to Linux client on macOS host 2022-05-01 14:07:03 +02:00
9p-xattr-user.c
9p-xattr.c
9p-xattr.h
9p.c 9pfs: fix 'Twalk' to only send error if no component walked 2022-06-16 12:44:52 +02:00
9p.h 9p: move P9_XATTR_SIZE_MAX from 9p.h to 9p.c 2022-04-01 13:06:07 +02:00
codir.c 9pfs: Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
cofile.c
cofs.c
coth.c
coth.h 9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker() 2022-03-07 11:49:31 +01:00
coxattr.c
Kconfig
meson.build 9p: darwin: *xattr_nofollow implementations 2022-03-07 11:49:31 +01:00
trace-events
trace.h
virtio-9p-device.c virtio: drop name parameter for virtio_init() 2022-05-16 04:38:40 -04:00
virtio-9p.h
xen-9p-backend.c
xen-9pfs.h