From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNeei-00013Z-Fa for qemu-devel@nongnu.org; Tue, 08 Nov 2011 00:55:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNeeh-0008LS-0J for qemu-devel@nongnu.org; Tue, 08 Nov 2011 00:55:32 -0500 Received: from ozlabs.org ([203.10.76.45]:42683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNeeg-0008LN-Kf for qemu-devel@nongnu.org; Tue, 08 Nov 2011 00:55:30 -0500 From: David Gibson Date: Tue, 8 Nov 2011 16:55:17 +1100 Message-Id: <1320731717-903-1-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] 9pfs: Stat response from server offset by 2 bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: jvrao@linux.vnet.ibm.com Cc: trule@linux.vnet.ibm.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, thuth@de.ibm.com From: Timothy Rule The 9P spec states that for the stat message the "stat[n]" structure shal= l be encoded at offset 7 in the 9P message (see =C2=A713.9 message Rstat). The existing code is encoding a 2 byte value (hard coded 0 value) at offset 7 of the 9P message, and then follows with the "stat[n]" structure at offset 9 of the 9P message. This patch removes the encoding of the 2 byte value which has the effect of moving the "stat[n]" structure from offset 9 to offset 7 in the 9P message Rstat. Signed-off-by: Timothy Rule Signed-off-by: David Gibson --- hw/9pfs/virtio-9p.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 01cf337..35d8851 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -1279,7 +1279,7 @@ static void v9fs_stat(void *opaque) if (err < 0) { goto out; } - offset +=3D pdu_marshal(pdu, offset, "wS", 0, &v9stat); + offset +=3D pdu_marshal(pdu, offset, "S", &v9stat); err =3D offset; trace_v9fs_stat_return(pdu->tag, pdu->id, v9stat.mode, v9stat.atime, v9stat.mtime, v9stat.length); --=20 1.7.7.1