Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;