qemu/tools/virtiofsd
Vivek Goyal 1e08f164e9 virtiofsd: Save error code early at the failure callsite
Change error code handling slightly in lo_setattr(). Right now we seem
to jump to out_err and assume that "errno" is valid and use that to
send reply.

But if caller has to do some other operations before jumping to out_err,
then it does the dance of first saving errno to saverr and the restore
errno before jumping to out_err. This makes it more confusing.

I am about to make more changes where caller will have to do some
work after error before jumping to out_err. I found it easier to
change the convention a bit. That is caller saves error in "saverr"
before jumping to out_err. And out_err uses "saverr" to send error
back and does not rely on "errno" having actual error.

v3: Resolved conflicts in lo_setattr() due to lo_inode_open() changes.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210208224024.43555-2-vgoyal@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2021-02-16 17:03:09 +00:00
..
50-qemu-virtiofsd.json.in virtiofsd: add vhost-user.json file 2020-01-23 16:41:36 +00:00
buffer.c Clean up includes 2020-12-10 17:16:44 +01:00
fuse_common.h virtiofsd: replace _Static_assert with QEMU_BUILD_BUG_ON 2020-12-15 12:52:10 -05:00
fuse_i.h tools/virtiofsd: add support for --socket-group 2020-10-12 12:39:38 +01:00
fuse_log.c Clean up includes 2020-12-10 17:16:44 +01:00
fuse_log.h Clean up includes 2020-12-10 17:16:44 +01:00
fuse_lowlevel.c virtiofsd: Remove useless code about send_notify_iov 2020-12-18 10:08:24 +00:00
fuse_lowlevel.h Clean up includes 2020-12-10 17:16:44 +01:00
fuse_misc.h Clean up includes 2020-12-10 17:16:44 +01:00
fuse_opt.c Clean up includes 2020-12-10 17:16:44 +01:00
fuse_opt.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
fuse_signals.c Clean up includes 2020-12-10 17:16:44 +01:00
fuse_virtio.c virtiofsd: vu_dispatch locking should never fail 2021-02-16 17:03:09 +00:00
fuse_virtio.h virtiofsd: cleanup allocated resource in se 2020-01-23 16:41:37 +00:00
helper.c Clean up includes 2020-12-10 17:16:44 +01:00
meson.build libvhost-user: make it a meson subproject 2020-12-08 13:48:58 -05:00
passthrough_helpers.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
passthrough_ll.c virtiofsd: Save error code early at the failure callsite 2021-02-16 17:03:09 +00:00
passthrough_seccomp.c tools/virtiofsd: Replace the word 'whitelist' 2021-02-16 17:03:09 +00:00
passthrough_seccomp.h Clean up includes 2020-12-10 17:16:44 +01:00