diff options
| author | David Howells <dhowells@redhat.com> | 2014-09-25 09:34:41 -0400 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-09-25 21:25:18 -0400 |
| commit | f3f760314afcb8522d2349b970b065589c5c8e48 (patch) | |
| tree | f99b4d42abdd17d1761b77d108b3621bd0603f52 | |
| parent | 2aca5b869ace67a63aab895659e5dc14c33a4d6e (diff) | |
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: 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>
| -rw-r--r-- | fs/nfs/fscache-index.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfs/fscache-index.c b/fs/nfs/fscache-index.c index 7cf2c4699b08..777b055063f6 100644 --- a/fs/nfs/fscache-index.c +++ b/fs/nfs/fscache-index.c | |||
| @@ -74,11 +74,10 @@ static uint16_t nfs_server_get_key(const void *cookie_netfs_data, | |||
| 74 | struct nfs_server_key *key = buffer; | 74 | struct nfs_server_key *key = buffer; |
| 75 | uint16_t len = sizeof(struct nfs_server_key); | 75 | uint16_t len = sizeof(struct nfs_server_key); |
| 76 | 76 | ||
| 77 | memset(key, 0, len); | ||
| 77 | key->nfsversion = clp->rpc_ops->version; | 78 | key->nfsversion = clp->rpc_ops->version; |
| 78 | key->family = clp->cl_addr.ss_family; | 79 | key->family = clp->cl_addr.ss_family; |
| 79 | 80 | ||
| 80 | memset(key, 0, len); | ||
| 81 | |||
| 82 | switch (clp->cl_addr.ss_family) { | 81 | switch (clp->cl_addr.ss_family) { |
| 83 | case AF_INET: | 82 | case AF_INET: |
| 84 | key->port = sin->sin_port; | 83 | key->port = sin->sin_port; |
