Commit 3adefa76 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] kNFSd: Make the calculation in the first READ_BUF easier to understand.

From: NeilBrown <neilb@cse.unsw.edu.au>

Don't rely on the assumption that
    sizeof(stateid_t) == sizeof(stateid_opaque_t) + 4.
parent 217ef21d
...@@ -949,7 +949,7 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write) ...@@ -949,7 +949,7 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
int len; int len;
DECODE_HEAD; DECODE_HEAD;
READ_BUF(sizeof(stateid_t) + 16); READ_BUF(sizeof(stateid_opaque_t) + 20);
READ32(write->wr_stateid.si_generation); READ32(write->wr_stateid.si_generation);
COPYMEM(&write->wr_stateid.si_opaque, sizeof(stateid_opaque_t)); COPYMEM(&write->wr_stateid.si_opaque, sizeof(stateid_opaque_t));
READ64(write->wr_offset); READ64(write->wr_offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment