]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
cifs: use the expiry output of dns_query to schedule next resolution
authorShyam Prasad N <sprasad@microsoft.com>
Wed, 15 Dec 2021 14:35:25 +0000 (07:35 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 13 Jan 2022 17:43:11 +0000 (18:43 +0100)
commit872eaf853d5f0c2dd54e5df1902d0c4c7631974a
treed334c5cbb8406ccb694107c2dc256963cc962d53
parent6e7525de3a19ea67ae3040a817b45923a4404c09
cifs: use the expiry output of dns_query to schedule next resolution

BugLink: https://bugs.launchpad.net/bugs/1954926
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>
(backported from commit 506c1da44fee32ba1d3a70413289ad58c772bba6)
[rtg - dropped changes to fs/cifs/misc.c]
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.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