nfsd: add __force to opaque verifier field casts
authorJeff Layton <jlayton@primarydata.com>
Tue, 17 Jun 2014 11:44:11 +0000 (07:44 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 23 Jun 2014 15:31:37 +0000 (11:31 -0400)
sparse complains that we're stuffing non-byte-swapped values into
__be32's here. Since they're supposed to be opaque, it doesn't matter
much. Just add __force to make sparse happy.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c

index f3f0487..a6be9d3 100644 (file)
@@ -581,8 +581,12 @@ static void gen_boot_verifier(nfs4_verifier *verifier, struct net *net)
        __be32 verf[2];
        struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 
-       verf[0] = (__be32)nn->nfssvc_boot.tv_sec;
-       verf[1] = (__be32)nn->nfssvc_boot.tv_usec;
+       /*
+        * This is opaque to client, so no need to byte-swap. Use
+        * __force to keep sparse happy
+        */
+       verf[0] = (__force __be32)nn->nfssvc_boot.tv_sec;
+       verf[1] = (__force __be32)nn->nfssvc_boot.tv_usec;
        memcpy(verifier->data, verf, sizeof(verifier->data));
 }
 
index 2204e1f..8242385 100644 (file)
@@ -1421,8 +1421,12 @@ static void gen_confirm(struct nfs4_client *clp)
        __be32 verf[2];
        static u32 i;
 
-       verf[0] = (__be32)get_seconds();
-       verf[1] = (__be32)i++;
+       /*
+        * This is opaque to client, so no need to byte-swap. Use
+        * __force to keep sparse happy
+        */
+       verf[0] = (__force __be32)get_seconds();
+       verf[1] = (__force __be32)i++;
        memcpy(clp->cl_confirm.data, verf, sizeof(clp->cl_confirm.data));
 }