static int nfs3_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
 {
        struct inode *inode = hdr->inode;
+       struct nfs_server *server = NFS_SERVER(inode);
 
        if (hdr->pgio_done_cb != NULL)
                return hdr->pgio_done_cb(task, hdr);
        if (nfs3_async_handle_jukebox(task, inode))
                return -EAGAIN;
 
+       if (task->tk_status >= 0 && !server->read_hdrsize)
+               cmpxchg(&server->read_hdrsize, 0, hdr->res.replen);
+
        nfs_invalidate_atime(inode);
        nfs_refresh_inode(inode, &hdr->fattr);
        return 0;
                                 struct rpc_message *msg)
 {
        msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ];
+       hdr->args.replen = NFS_SERVER(hdr->inode)->read_hdrsize;
 }
 
 static int nfs3_proc_pgio_rpc_prepare(struct rpc_task *task,
 
                                   const void *data)
 {
        const struct nfs_pgio_args *args = data;
+       unsigned int replen = args->replen ? args->replen : NFS3_readres_sz;
 
        encode_read3args(xdr, args);
        prepare_reply_buffer(req, args->pages, args->pgbase,
-                                       args->count, NFS3_readres_sz);
+                                       args->count, replen);
        req->rq_rcv_buf.flags |= XDRBUF_READ;
 }
 
                                 void *data)
 {
        struct nfs_pgio_res *result = data;
+       unsigned int pos;
        enum nfs_stat status;
        int error;
 
+       pos = xdr_stream_pos(xdr);
        error = decode_nfsstat3(xdr, &status);
        if (unlikely(error))
                goto out;
        result->op_status = status;
        if (status != NFS3_OK)
                goto out_status;
+       result->replen = 3 + ((xdr_stream_pos(xdr) - pos) >> 2);
        error = decode_read3resok(xdr, result);
 out:
        return error;
 
        unsigned short          mountd_port;
        unsigned short          mountd_protocol;
        struct rpc_wait_queue   uoc_rpcwaitq;
+
+       /* XDR related information */
+       unsigned int            read_hdrsize;
 };
 
 /* Server capabilities */
 
        __u32                   count;
        unsigned int            pgbase;
        struct page **          pages;
+       unsigned int            replen;         /* used by read */
        const u32 *             bitmask;        /* used by write */
        enum nfs3_stable_how    stable;         /* used by write */
 };
        __u32                   count;
        __u32                   op_status;
        int                     eof;            /* used by read */
+       unsigned int            replen;         /* used by read */
        struct nfs_writeverf *  verf;           /* used by write */
        const struct nfs_server *server;        /* used by write */
-
 };
 
 /*