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: fix the logic in smbdirect_socket_destroy_sync() without an error

If smbdirect_socket_destroy_sync() and sc->first_error was not set
we should set -ESHUTDOWN, that's a better condition
doing it only implicitly with the
sc->status < SMBDIRECT_SOCKET_DISCONNECTING check.

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
25c2e349 3892007f

+21 -7
+21 -7
fs/smb/common/smbdirect/smbdirect_socket.c
··· 600 600 */ 601 601 WARN_ON_ONCE(in_interrupt()); 602 602 603 - smbdirect_log_rdma_event(sc, SMBDIRECT_LOG_INFO, 604 - "cancelling and disable disconnect_work\n"); 605 - disable_work_sync(&sc->disconnect_work); 603 + /* 604 + * First we try to disable the work 605 + * without disable_work_sync() in a 606 + * non blocking way, if it's already 607 + * running it will be handles by 608 + * disable_work_sync() below. 609 + * 610 + * Here we just want to make sure queue_work() in 611 + * smbdirect_socket_schedule_cleanup_lvl() 612 + * is a no-op. 613 + */ 614 + disable_work(&sc->disconnect_work); 606 615 607 - smbdirect_log_rdma_event(sc, SMBDIRECT_LOG_INFO, 608 - "destroying rdma session\n"); 609 - if (sc->status < SMBDIRECT_SOCKET_DISCONNECTING) { 616 + if (!sc->first_error) 610 617 /* 611 618 * SMBDIRECT_LOG_INFO is enough here 612 619 * as this is the typical case where ··· 622 615 smbdirect_socket_schedule_cleanup_lvl(sc, 623 616 SMBDIRECT_LOG_INFO, 624 617 -ESHUTDOWN); 618 + 619 + smbdirect_log_rdma_event(sc, SMBDIRECT_LOG_INFO, 620 + "cancelling and disable disconnect_work\n"); 621 + disable_work_sync(&sc->disconnect_work); 622 + 623 + smbdirect_log_rdma_event(sc, SMBDIRECT_LOG_INFO, 624 + "destroying rdma session\n"); 625 + if (sc->status < SMBDIRECT_SOCKET_DISCONNECTING) 625 626 smbdirect_socket_cleanup_work(&sc->disconnect_work); 626 - } 627 627 if (sc->status < SMBDIRECT_SOCKET_DISCONNECTED) { 628 628 smbdirect_log_rdma_event(sc, SMBDIRECT_LOG_INFO, 629 629 "wait for transport being disconnected\n");