Message ID | 20181126095710.380206-2-groug@kaod.org |
---|---|
State | New |
Headers | show |
Series | [PULL,1/1] 9p: fix QEMU crash when renaming files | expand |
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 267a25533b77..bdf7919abfc5 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -2855,6 +2855,7 @@ static void coroutine_fn v9fs_wstat(void *opaque) struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; + V9fsState *s = pdu->s; v9fs_stat_init(&v9stat); err = pdu_unmarshal(pdu, offset, "dwS", &fid, &unused, &v9stat); @@ -2920,7 +2921,9 @@ static void coroutine_fn v9fs_wstat(void *opaque) } } if (v9stat.name.size != 0) { + v9fs_path_write_lock(s); err = v9fs_complete_rename(pdu, fidp, -1, &v9stat.name); + v9fs_path_unlock(s); if (err < 0) { goto out; }