diff mbox

tools/kvm/9p: WSTAT don't use open fid

Message ID 1310322201-7831-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Aneesh Kumar K.V July 10, 2011, 6:23 p.m. UTC
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>
---
 tools/kvm/virtio/9p.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

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;
 	}