Skip to content

Commit

Permalink
nfs41: decode minorversion 1 cb_compound header
Browse files Browse the repository at this point in the history
decode cb_compound header conforming to
http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26

Get rid of cb_compound_hdr_arg.callback_ident

callback_ident is not used anywhere so we shouldn't waste any memory to
store it.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: no need to break read_buf in decode_compound_hdr_arg]
See http://linux-nfs.org/pipermail/pnfs/2009-June/007844.html
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
  • Loading branch information
Benny Halevy committed Jun 17, 2009
1 parent b8f2ef8 commit 48a9e2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion fs/nfs/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct cb_compound_hdr_arg {
unsigned int taglen;
const char *tag;
unsigned int minorversion;
unsigned int callback_ident;
unsigned nops;
};

Expand Down
7 changes: 4 additions & 3 deletions fs/nfs/callback_xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,15 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
if (unlikely(p == NULL))
return htonl(NFS4ERR_RESOURCE);
hdr->minorversion = ntohl(*p++);
/* Check minor version is zero. */
if (hdr->minorversion != 0) {
/* Check minor version is zero or one. */
if (hdr->minorversion <= 1) {
p++; /* skip callback_ident */
} else {
printk(KERN_WARNING "%s: NFSv4 server callback with "
"illegal minor version %u!\n",
__func__, hdr->minorversion);
return htonl(NFS4ERR_MINOR_VERS_MISMATCH);
}
hdr->callback_ident = ntohl(*p++);
hdr->nops = ntohl(*p);
dprintk("%s: minorversion %d nops %d\n", __func__,
hdr->minorversion, hdr->nops);
Expand Down

0 comments on commit 48a9e2d

Please sign in to comment.