ksmbd: add netdev-up/down event debug print
[ Upstream commit 5f3f274e2ce68999b49901de4794c4b04125b154 ] Add netdev-up/down event debug print to find what netdev is connected or disconnected. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Stable-dep-of: 21a4e47578d4 ("ksmbd: fix use-after-free in __smb2_lease_break_noti()") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0772765ac8
commit
8d2c1acc88
@@ -521,6 +521,8 @@ static int ksmbd_netdev_event(struct notifier_block *nb, unsigned long event,
|
|||||||
found = 1;
|
found = 1;
|
||||||
if (iface->state != IFACE_STATE_DOWN)
|
if (iface->state != IFACE_STATE_DOWN)
|
||||||
break;
|
break;
|
||||||
|
ksmbd_debug(CONN, "netdev-up event: netdev(%s) is going up\n",
|
||||||
|
iface->name);
|
||||||
ret = create_socket(iface);
|
ret = create_socket(iface);
|
||||||
if (ret)
|
if (ret)
|
||||||
return NOTIFY_OK;
|
return NOTIFY_OK;
|
||||||
@@ -531,6 +533,8 @@ static int ksmbd_netdev_event(struct notifier_block *nb, unsigned long event,
|
|||||||
iface = alloc_iface(kstrdup(netdev->name, KSMBD_DEFAULT_GFP));
|
iface = alloc_iface(kstrdup(netdev->name, KSMBD_DEFAULT_GFP));
|
||||||
if (!iface)
|
if (!iface)
|
||||||
return NOTIFY_OK;
|
return NOTIFY_OK;
|
||||||
|
ksmbd_debug(CONN, "netdev-up event: netdev(%s) is going up\n",
|
||||||
|
iface->name);
|
||||||
ret = create_socket(iface);
|
ret = create_socket(iface);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
@@ -540,6 +544,8 @@ static int ksmbd_netdev_event(struct notifier_block *nb, unsigned long event,
|
|||||||
list_for_each_entry(iface, &iface_list, entry) {
|
list_for_each_entry(iface, &iface_list, entry) {
|
||||||
if (!strcmp(iface->name, netdev->name) &&
|
if (!strcmp(iface->name, netdev->name) &&
|
||||||
iface->state == IFACE_STATE_CONFIGURED) {
|
iface->state == IFACE_STATE_CONFIGURED) {
|
||||||
|
ksmbd_debug(CONN, "netdev-down event: netdev(%s) is going down\n",
|
||||||
|
iface->name);
|
||||||
tcp_stop_kthread(iface->ksmbd_kthread);
|
tcp_stop_kthread(iface->ksmbd_kthread);
|
||||||
iface->ksmbd_kthread = NULL;
|
iface->ksmbd_kthread = NULL;
|
||||||
mutex_lock(&iface->sock_release_lock);
|
mutex_lock(&iface->sock_release_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user