mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
cifs: protect updating server->dstaddr with a spinlock
We use a spinlock while we are reading and accessing the destination address for a server. We need to also use this spinlock to protect when we are modifying this address from reconn_set_ipaddr(). Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
ae83d0b416
commit
fada37f6f6
@ -375,8 +375,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spin_lock(&cifs_tcp_ses_lock);
|
||||||
rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr,
|
rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr,
|
||||||
strlen(ipaddr));
|
strlen(ipaddr));
|
||||||
|
spin_unlock(&cifs_tcp_ses_lock);
|
||||||
kfree(ipaddr);
|
kfree(ipaddr);
|
||||||
|
|
||||||
return !rc ? -1 : 0;
|
return !rc ? -1 : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user