Skip to content

Commit 78e727e

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: update iface_last_update on each query-and-update
iface_last_update was an unused field when it was introduced. Later, when we had periodic update of server interface list, this field was used regularly to decide when to update next. However, with the new logic of updating the interfaces, it becomes crucial that this field be updated whenever parse_server_interfaces runs successfully. This change updates this field when either the server does not support query of interfaces; so that we do not query the interfaces repeatedly. It also updates the field when the function reaches the end. Fixes: aa45dad ("cifs: change iface_list from array to sorted linked list") Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent f591062 commit 78e727e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/smb/client/smb2ops.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
615615
"Empty network interface list returned by server %s\n",
616616
ses->server->hostname);
617617
rc = -EOPNOTSUPP;
618+
ses->iface_last_update = jiffies;
618619
goto out;
619620
}
620621

@@ -712,7 +713,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
712713

713714
ses->iface_count++;
714715
spin_unlock(&ses->iface_lock);
715-
ses->iface_last_update = jiffies;
716716
next_iface:
717717
nb_iface++;
718718
next = le32_to_cpu(p->Next);
@@ -734,6 +734,8 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
734734
if ((bytes_left > 8) || p->Next)
735735
cifs_dbg(VFS, "%s: incomplete interface info\n", __func__);
736736

737+
ses->iface_last_update = jiffies;
738+
737739
out:
738740
/*
739741
* Go through the list again and put the inactive entries

0 commit comments

Comments
 (0)