Page MenuHomeFreeBSD

Add a new retrydns NFS mount option
AbandonedPublic

Authored by rmacklem on Feb 22 2025, 2:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 8, 9:32 AM
Unknown Object (File)
Mon, Oct 6, 4:51 AM
Unknown Object (File)
Sep 10 2025, 7:34 PM
Unknown Object (File)
Aug 18 2025, 7:38 AM
Unknown Object (File)
Aug 11 2025, 10:37 AM
Unknown Object (File)
Aug 6 2025, 6:28 PM
Unknown Object (File)
Aug 4 2025, 4:02 AM
Unknown Object (File)
Aug 3 2025, 7:20 PM
Subscribers

Details

Reviewers
glebius
Summary

Without this patch, an NFS mount attempt will
fail if the NFS server name cannot be resolved via
getaddrinfo(). This failure may be caused for a
mount specified in fstab(5) if the DNS service is
slow to startup.

This patch adds a new mount option called "retrydns=<N>"
which allows for retries of the getaddrinfo() call.
The first retry is done after 1sec and the delay is backed
off to 16sec.

A setting of "retrycnt=0" retries until success.

A mount_nfs.8 man page patch will be done in a separate review.

Test Plan

Tested for trivial cases, such as a mistyped server name.
I am hoping glebius@ can test it for his failure case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I tested the patch and the patch works as expected. With retrydns=10 I see in console.log:

Feb 25 22:48:33 shop kernel: Mounting NFS filesystems:mount_nfs: myhost.org:2049: Name does not resolve
Feb 25 22:48:33 shop kernel: mount_nfs: myhost.org:2049: Name does not resolve
Feb 25 22:48:33 shop syslogd: last message repeated 2 times
Feb 25 22:48:33 shop kernel: .

However, I don't agree on need for new option and solution that doesn't involve the backgrounding loop. I will reply in the email thread. Looking at the most recent replies from Cy and Chris, it seems that I was not clear that I want modify behavior only of background mounts, not affecting blocking mounts at all. I'll followup.