From: Anna Schumaker <Anna.Schumaker@netapp.com>
To: Henrique Martins <linux@martins.cc>, Steve Dickson <SteveD@redhat.com>
Cc: <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] nfsd/exportfs: changes handling of unresolvable entries
Date: Tue, 4 Nov 2014 14:27:35 -0500 [thread overview]
Message-ID: <545928A7.60103@Netapp.com> (raw)
In-Reply-To: <8957.1415128789@monster.martins.cc>
Hey Henrique,
On 11/04/2014 02:19 PM, Henrique Martins wrote:
> In-reply-to: <54591385.2080007@RedHat.com>
> References: <14393.1409936528@monster.martins.cc>
> <15531.1414780435@monster.martins.cc> <54591385.2080007@RedHat.com>
> Comments: In-reply-to Steve Dickson <SteveD@redhat.com>
> message dated "Tue, 04 Nov 2014 12:57:25 -0500."
> X-Mailer: MH-E 8.5; nmh 1.6; XEmacs 21.5 (beta34)
> MIME-Version: 1.0
> Content-Type: multipart/mixed; boundary="=-=-="
> --------
> --=-=-=
> Content-Type: text/plain; charset=utf-8
>
>
> Attaching patch to nfs/exportfs to allow nfsd to start when
> there are some, but not all, unresolvable entries in
> /etc/exports.
>
> Nfs currently fails to start in my laptop which has work
> machines listed in exports that aren't resolvable when I'm
> not in the office, and home machines in exports that aren't
> resolvable when I'm not home.
>
> Files changed:
> - in client.c/client_lookup:
> changes the (x)log level for unresolvable entries in
> /etc/exports from L_ERROR to L_WARNING,
> - in hostname.c/host_addrinfo:
> changes the (x)log level for unresolvable entries in
> /etc/exports from D_GENERAL to D_PARSE,
> - in export.c/export_read:
> counts the number of exported volume entries and
> generates a (x)log L_ERROR if no volumes are exported.
>
> Built and tested on a Fedora 20 (fully updated) system.
>
> Signed-off-by: Henrique Martins <linux@martins.cc>
> ---
>
> --=-=-=
> Content-Type: text/x-diff; charset=utf-8
> Content-Disposition: inline; filename=nfs-utils-1.3.0-exportfs.patch
>
> --- nfs-utils-1.3.0/support/export/client.c.orig 2014-09-05 08:21:37.568364360 -0700
> +++ nfs-utils-1.3.0/support/export/client.c 2014-09-05 08:21:41.709451778 -0700
> @@ -277,7 +277,7 @@
> if (htype == MCL_FQDN && !canonical) {
> ai = host_addrinfo(hname);
> if (!ai) {
> - xlog(L_ERROR, "Failed to resolve %s", hname);
> + xlog(L_WARNING, "Failed to resolve %s", hname);
> goto out;
> }
> hname = ai->ai_canonname;
> --- nfs-utils-1.3.0/support/export/hostname.c.orig 2014-09-05 08:09:07.387551291 -0700
> +++ nfs-utils-1.3.0/support/export/hostname.c 2014-09-05 08:09:13.799573723 -0700
> @@ -175,11 +175,11 @@
> case 0:
> return ai;
> case EAI_SYSTEM:
> - xlog(D_GENERAL, "%s: failed to resolve %s: (%d) %m",
> + xlog(D_PARSE, "%s: failed to resolve %s: (%d) %m",
> __func__, hostname, errno);
> break;
> default:
> - xlog(D_GENERAL, "%s: failed to resolve %s: %s",
> + xlog(D_PARSE, "%s: failed to resolve %s: %s",
> __func__, hostname, gai_strerror(error));
> break;
> }
> --- nfs-utils-1.3.0/support/export/export.c.orig 2014-03-25 08:12:07.000000000 -0700
> +++ nfs-utils-1.3.0/support/export/export.c 2014-09-05 09:23:37.424105125 -0700
> @@ -76,15 +76,22 @@
> struct exportent *eep;
> nfs_export *exp;
>
> + int volumes = 0;
> +
> setexportent(fname, "r");
> while ((eep = getexportent(0,1)) != NULL) {
> exp = export_lookup(eep->e_hostname, eep->e_path, 0);
> - if (!exp)
> - export_create(eep, 0);
> + if (!exp) {
> + exp = export_create(eep, 0);
> + if (exp)
> + volumes++;
> + }
I think you should be indenting your code with tabs instead of spaces to be consistent with the rest of this file.
Thanks,
Anna
> else
> warn_duplicated_exports(exp, eep);
> }
> endexportent();
> + if (volumes == 0)
> + xlog(L_ERROR, "no or all unresolvable export entries");
> }
>
> /**
>
> --=-=-=--
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-04 19:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 19:19 [PATCH 1/1] nfsd/exportfs: changes handling of unresolvable entries Henrique Martins
2014-11-04 19:27 ` Anna Schumaker [this message]
2014-11-04 19:31 ` Steve Dickson
2014-11-04 19:43 ` Henrique Martins
2014-11-04 20:15 ` Steve Dickson
2014-11-04 20:30 ` Henrique Martins
2014-11-04 20:14 ` Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=545928A7.60103@Netapp.com \
--to=anna.schumaker@netapp.com \
--cc=SteveD@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=linux@martins.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox