提交 f3f76031 编写于 作者: D David Howells 提交者: 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: NJames Pearson <james-p@moving-picture.com>
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Acked-by: NSteve Dickson <steved@redhat.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册