Commit f3f76031 authored by David Howells's avatar David Howells Committed by Trond Myklebust

NFS: Fabricate fscache server index key correctly

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: default avatarJames Pearson <james-p@moving-picture.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarSteve Dickson <steved@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 2aca5b86
...@@ -74,11 +74,10 @@ static uint16_t nfs_server_get_key(const void *cookie_netfs_data, ...@@ -74,11 +74,10 @@ static uint16_t nfs_server_get_key(const void *cookie_netfs_data,
struct nfs_server_key *key = buffer; struct nfs_server_key *key = buffer;
uint16_t len = sizeof(struct nfs_server_key); uint16_t len = sizeof(struct nfs_server_key);
memset(key, 0, len);
key->nfsversion = clp->rpc_ops->version; key->nfsversion = clp->rpc_ops->version;
key->family = clp->cl_addr.ss_family; key->family = clp->cl_addr.ss_family;
memset(key, 0, len);
switch (clp->cl_addr.ss_family) { switch (clp->cl_addr.ss_family) {
case AF_INET: case AF_INET:
key->port = sin->sin_port; key->port = sin->sin_port;
......
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