Linux CIFS filesystem development
 help / color / mirror / Atom feed
* Unexpected additional umh-based DNS lookup in 6.6.0
@ 2023-11-08 21:23 Eduard Bachmakov
  2023-11-09  3:43 ` Paulo Alcantara
  2023-11-09 15:01 ` [PATCH] smb: client: fix mount when dns_resolver key is not available Paulo Alcantara
  0 siblings, 2 replies; 9+ messages in thread
From: Eduard Bachmakov @ 2023-11-08 21:23 UTC (permalink / raw)
  To: linux-cifs

When attempting to mount (mount.cifs version 7.0) a share using

    $ mount -t cifs -o
vers=3.1.1,cred=/home/u/.secret.txt,uid=1000,gid=100
//smb.server.example.com/scans /home/u/mnt

it succeeds on 6.5.9:

    mount("//smb.server.example.com/scans", ".", "cifs", 0,
"ip=192.168.5.43,unc=\\\\smb.server.example.com\\scans,vers=3.1.1,uid=1000,gid=100,user=u,pass=mypassword")
= 0

but fails on 6.0.0:

    mount("//smb.server.example.com/scans", ".", "cifs", 0,
"ip=192.168.5.43,unc=\\\\smb.server.example.com\\scans,vers=3.1.1,uid=1000,gid=100,user=u,pass=mypassword")
= -1 ENOKEY (Required key not available)

(or ENOENT) though it still works with using the IP instead of the domain:

    mount("//192.168.5.43/scans", ".", "cifs", 0,
"ip=192.168.5.43,unc=\\\\192.168.5.43\\scans,vers=3.1.1,uid=1000,gid=100,user=u,pass=mypassword")
= 0

Based on my reading ever since 348a04a ("smb: client: get rid of dfs
code dep in namespace.c") dfs_mount_share() is now calling
dns_resolve_server_name_to_ip() early and unconditionally. This can be
verified on a running system by enabling dns_resolver logging (echo 1
| sudo tee /sys/module/dns_resolver/parameters/debug + watch dmesg).
An additional DNS lookup is attempted in 6.0.0 that previously wasn't.
My best guess is that ENOENT is "didn't work" and ENOKEY means "didn't
work but cached".

On my system the request-key mechanism is not set up so this fails.
I'm no expert on SMB so I don't know if things just happened to work
previously by me relying on a bug but this change broke my setup. Is
this expected?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-24 11:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 21:23 Unexpected additional umh-based DNS lookup in 6.6.0 Eduard Bachmakov
2023-11-09  3:43 ` Paulo Alcantara
2023-11-09  9:55   ` Eduard Bachmakov
2023-11-09 17:29     ` Paulo Alcantara
2023-11-14 21:59       ` Eduard Bachmakov
2023-11-14 22:06         ` Steve French
2023-11-24  1:56         ` Paulo Alcantara
2023-11-24 11:53           ` Greg KH
2023-11-09 15:01 ` [PATCH] smb: client: fix mount when dns_resolver key is not available Paulo Alcantara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox