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)
Sat, Apr 19, 12:54 AM
Unknown Object (File)
Sun, Apr 6, 12:55 PM
Unknown Object (File)
Mar 8 2025, 1:26 AM
Unknown Object (File)
Feb 27 2025, 11:59 AM
Unknown Object (File)
Feb 27 2025, 4:41 AM
Unknown Object (File)
Feb 26 2025, 6:38 AM
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.