]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/nfs/nfs4xdr.c
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[karo-tx-linux.git] / fs / nfs / nfs4xdr.c
index 661e753fe1c93d0c6be59fd26c0339316d50ee12..7bd3a5c09d3185856e85bbe8c5484fccfee3651f 100644 (file)
@@ -1985,9 +1985,14 @@ encode_layoutcommit(struct xdr_stream *xdr,
        p = xdr_encode_hyper(p, args->lastbytewritten + 1);     /* length */
        *p = cpu_to_be32(0); /* reclaim */
        encode_nfs4_stateid(xdr, &args->stateid);
-       p = reserve_space(xdr, 20);
-       *p++ = cpu_to_be32(1); /* newoffset = TRUE */
-       p = xdr_encode_hyper(p, args->lastbytewritten);
+       if (args->lastbytewritten != U64_MAX) {
+               p = reserve_space(xdr, 20);
+               *p++ = cpu_to_be32(1); /* newoffset = TRUE */
+               p = xdr_encode_hyper(p, args->lastbytewritten);
+       } else {
+               p = reserve_space(xdr, 12);
+               *p++ = cpu_to_be32(0); /* newoffset = FALSE */
+       }
        *p++ = cpu_to_be32(0); /* Never send time_modify_changed */
        *p++ = cpu_to_be32(NFS_SERVER(args->inode)->pnfs_curr_ld->id);/* type */