Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

smb: smbdirect: let smbdirect_connection_deregister_mr_io unlock while waiting

We should not hold a mutex locked during wait_for_completion()
holding a reference is enough.

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Henrique Carvalho <henrique.carvalho@suse.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Stefan Metzmacher and committed by
Steve French
d09a040c 25c2e349

+8
+8
fs/smb/common/smbdirect/smbdirect_mr.c
··· 410 410 struct smbdirect_socket *sc = mr->socket; 411 411 int ret = 0; 412 412 413 + lock_again: 413 414 mutex_lock(&mr->mutex); 414 415 if (mr->state == SMBDIRECT_MR_DISABLED) 415 416 goto put_kref; ··· 441 440 smbdirect_socket_schedule_cleanup(sc, ret); 442 441 goto done; 443 442 } 443 + 444 + /* 445 + * We still hold the reference to mr 446 + * so we can unlock while waiting. 447 + */ 448 + mutex_unlock(&mr->mutex); 444 449 wait_for_completion(&mr->invalidate_done); 445 450 mr->need_invalidate = false; 451 + goto lock_again; 446 452 } else 447 453 /* 448 454 * For remote invalidation, just set it to SMBDIRECT_MR_INVALIDATED