qemu/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-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-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
codir.c
cofile.c
cofs.c
coth.c
coth.h
coxattr.c
Kconfig
meson.build
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