Skip to content

Commit

Permalink
NFS: Fabricate fscache server index key correctly
Browse files Browse the repository at this point in the history
When fabricating a server index key for fscache, we should clear the index key
buffer before starting to fill it in, not in the middle.

Reported-by: James Pearson <james-p@moving-picture.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
David Howells authored and Trond Myklebust committed Sep 26, 2014
1 parent 2aca5b8 commit f3f7603
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/nfs/fscache-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ static uint16_t nfs_server_get_key(const void *cookie_netfs_data,
struct nfs_server_key *key = buffer;
uint16_t len = sizeof(struct nfs_server_key);

memset(key, 0, len);
key->nfsversion = clp->rpc_ops->version;
key->family = clp->cl_addr.ss_family;

memset(key, 0, len);

switch (clp->cl_addr.ss_family) {
case AF_INET:
key->port = sin->sin_port;
Expand Down

0 comments on commit f3f7603

Please sign in to comment.