]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools, 9p: WSTAT don't use open fid
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sun, 10 Jul 2011 18:23:21 +0000 (23:53 +0530)
committerPekka Enberg <penberg@kernel.org>
Sun, 10 Jul 2011 18:41:44 +0000 (21:41 +0300)
We should use full path instead of fd. WSTAT can operate on
unopen fid.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/virtio/9p.c

index e7e108bd508941e5105dcdaf2f75a2d1365a27b3..c6f49da605d797a2ae5a7baa329d493ec1cdc29e 100644 (file)
@@ -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;
        }