We should use full path instead of fd. WSTAT can operate on unopen fid. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx> --- tools/kvm/virtio/9p.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index 7e90024..a2fe5ca 100644 --- a/tools/kvm/virtio/9p.c +++ b/tools/kvm/virtio/9p.c @@ -506,7 +506,7 @@ static void virtio_p9_wstat(struct p9_dev *p9dev, fid = &p9dev->fids[fid_val]; if (wstat.length != -1UL) { - res = ftruncate(fid->fd, wstat.length); + res = truncate(fid->abs_path, wstat.length); if (res < 0) goto err_out; } -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html