summaryrefslogtreecommitdiffstats
path: root/tools/virtiofsd/passthrough_ll.c
diff options
context:
space:
mode:
authorPeter Maydell2020-11-12 21:13:01 +0100
committerPeter Maydell2020-11-12 21:13:01 +0100
commit4cfac0152e798f9c60472706c0441501da13183c (patch)
treeaa52af2f3606e4a6f310f660cc11e899eafd79ce /tools/virtiofsd/passthrough_ll.c
parentMerge remote-tracking branch 'remotes/mcayland/tags/qemu-macppc-20201112' int... (diff)
parentvirtiofsd: check whether strdup lo.source return NULL in main func (diff)
downloadqemu-4cfac0152e798f9c60472706c0441501da13183c.tar.gz
qemu-4cfac0152e798f9c60472706c0441501da13183c.tar.xz
qemu-4cfac0152e798f9c60472706c0441501da13183c.zip
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20201112a' into staging
Migration & virtiofs fixes for 5.2 A bunch of small fixes. # gpg: Signature made Thu 12 Nov 2020 18:34:41 GMT # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20201112a: virtiofsd: check whether strdup lo.source return NULL in main func virtiofsd: check whether lo_map_reserve returns NULL in, main func tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func virtiofsd: Announce submounts even without statx() migration: handle CANCELLING state in migration_completion() multifd/tls: fix memoryleak of the QIOChannelSocket object when cancelling migration migration/dirtyrate: simplify includes in dirtyrate.c migration: fix uninitialized variable warning in migrate_send_rp_req_pages() migration/multifd: fix hangup with TLS-Multifd due to blocking handshake ACPI: Avoid infinite recursion when dump-vmstate migration/ram: Fix hexadecimal format string specifier Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tools/virtiofsd/passthrough_ll.c')
-rw-r--r--tools/virtiofsd/passthrough_ll.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index ec1008bceb..97485b22b4 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -610,14 +610,6 @@ static void lo_init(void *userdata, struct fuse_conn_info *conn)
"does not support it\n");
lo->announce_submounts = false;
}
-
-#ifndef CONFIG_STATX
- if (lo->announce_submounts) {
- fuse_log(FUSE_LOG_WARNING, "lo_init: Cannot announce submounts, there "
- "is no statx()\n");
- lo->announce_submounts = false;
- }
-#endif
}
static void lo_getattr(fuse_req_t req, fuse_ino_t ino,
@@ -3433,6 +3425,7 @@ int main(int argc, char *argv[])
.proc_self_fd = -1,
};
struct lo_map_elem *root_elem;
+ struct lo_map_elem *reserve_elem;
int ret = -1;
/* Don't mask creation mode, kernel already did that */
@@ -3452,8 +3445,17 @@ int main(int argc, char *argv[])
* [1] Root inode
*/
lo_map_init(&lo.ino_map);
- lo_map_reserve(&lo.ino_map, 0)->in_use = false;
+ reserve_elem = lo_map_reserve(&lo.ino_map, 0);
+ if (!reserve_elem) {
+ fuse_log(FUSE_LOG_ERR, "failed to alloc reserve_elem.\n");
+ goto err_out1;
+ }
+ reserve_elem->in_use = false;
root_elem = lo_map_reserve(&lo.ino_map, lo.root.fuse_ino);
+ if (!root_elem) {
+ fuse_log(FUSE_LOG_ERR, "failed to alloc root_elem.\n");
+ goto err_out1;
+ }
root_elem->inode = &lo.root;
lo_map_init(&lo.dirp_map);
@@ -3515,6 +3517,10 @@ int main(int argc, char *argv[])
}
} else {
lo.source = strdup("/");
+ if (!lo.source) {
+ fuse_log(FUSE_LOG_ERR, "failed to strdup source\n");
+ goto err_out1;
+ }
}
if (lo.xattrmap) {