cifs: use the expiry output of dns_query to schedule next resolution
authorShyam Prasad N <sprasad@microsoft.com>
Tue, 18 May 2021 15:05:50 +0000 (15:05 +0000)
committerSteve French <stfrench@microsoft.com>
Wed, 14 Jul 2021 15:06:03 +0000 (10:06 -0500)
commit506c1da44fee32ba1d3a70413289ad58c772bba6
tree519eb1c02f57990884daec5513bdb6e62032585f
parente73f0f0ee7541171d89f2e2491130c7771ba58d3
cifs: use the expiry output of dns_query to schedule next resolution

We recently fixed DNS resolution of the server hostname during reconnect.
However, server IP address may change, even when the old one continues
to server (although sub-optimally).

We should schedule the next DNS resolution based on the TTL of
the DNS record used for the last resolution. This way, we resolve the
server hostname again when a DNS record expires.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Cc: <stable@vger.kernel.org> # v5.11+
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifs_dfs_ref.c
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/dns_resolve.c
fs/cifs/dns_resolve.h
fs/cifs/misc.c