diff mbox

cifs: demote DFS referral lookup errors to cFYI

Message ID 1308776756-16030-1-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton June 22, 2011, 9:05 p.m. UTC
Now that we call into this routine on every mount, anyone who doesn't
have the upcall configured will get multiple printks about failed lookups.

Reported-and-Tested-by: Martijn Uffing <mp3project@sarijopen.student.utwente.nl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/cifs_dfs_ref.c |    5 +++--
 fs/cifs/dns_resolve.c  |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

Comments

Steve French July 31, 2011, 10:24 p.m. UTC | #1
Since we can not distinguish between error 126 (ENOKEY) meaning
"not found since the hostname doesn't exist" and "your configuration
is broken (you don't have a dns upcall module setup)"
we do need a way to warn the user on the latter - but that requires
changes to dns_query or the keyctl it invokes.

I opened kernel buzilla 40392 to track this - although I don't know
the easiest/best way to fix this.

In any case - cifs shouldn't be logging this (as Jeff noted) - we need
the warning (once)
below cifs in dns_query (e.g.) so I have merged Jeff's patch to demote
the cERROR
to cFYI for this common case.

On Wed, Jun 22, 2011 at 4:05 PM, Jeff Layton <jlayton@redhat.com> wrote:
> Now that we call into this routine on every mount, anyone who doesn't
> have the upcall configured will get multiple printks about failed lookups.
>
> Reported-and-Tested-by: Martijn Uffing <mp3project@sarijopen.student.utwente.nl>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/cifs/cifs_dfs_ref.c |    5 +++--
>  fs/cifs/dns_resolve.c  |    4 ++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
> index 8d8f28c..6873bb6 100644
> --- a/fs/cifs/cifs_dfs_ref.c
> +++ b/fs/cifs/cifs_dfs_ref.c
> @@ -141,10 +141,11 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
>
>        rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
>        if (rc < 0) {
> -               cERROR(1, "%s: Failed to resolve server part of %s to IP: %d",
> -                         __func__, *devname, rc);
> +               cFYI(1, "%s: Failed to resolve server part of %s to IP: %d",
> +                       __func__, *devname, rc);
>                goto compose_mount_options_err;
>        }
> +
>        /* md_len = strlen(...) + 12 for 'sep+prefixpath='
>         * assuming that we have 'unc=' and 'ip=' in
>         * the original sb_mountdata
> diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
> index 548f062..1d2d91d 100644
> --- a/fs/cifs/dns_resolve.c
> +++ b/fs/cifs/dns_resolve.c
> @@ -79,8 +79,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
>        /* Perform the upcall */
>        rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL);
>        if (rc < 0)
> -               cERROR(1, "%s: unable to resolve: %*.*s",
> -                      __func__, len, len, hostname);
> +               cFYI(1, "%s: unable to resolve: %*.*s",
> +                       __func__, len, len, hostname);
>        else
>                cFYI(1, "%s: resolved: %*.*s to %s",
>                     __func__, len, len, hostname, *ip_addr);
> --
> 1.7.5.4
>
>
diff mbox

Patch

diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 8d8f28c..6873bb6 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -141,10 +141,11 @@  char *cifs_compose_mount_options(const char *sb_mountdata,
 
 	rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
 	if (rc < 0) {
-		cERROR(1, "%s: Failed to resolve server part of %s to IP: %d",
-			  __func__, *devname, rc);
+		cFYI(1, "%s: Failed to resolve server part of %s to IP: %d",
+			__func__, *devname, rc);
 		goto compose_mount_options_err;
 	}
+
 	/* md_len = strlen(...) + 12 for 'sep+prefixpath='
 	 * assuming that we have 'unc=' and 'ip=' in
 	 * the original sb_mountdata
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
index 548f062..1d2d91d 100644
--- a/fs/cifs/dns_resolve.c
+++ b/fs/cifs/dns_resolve.c
@@ -79,8 +79,8 @@  dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
 	/* Perform the upcall */
 	rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL);
 	if (rc < 0)
-		cERROR(1, "%s: unable to resolve: %*.*s",
-		       __func__, len, len, hostname);
+		cFYI(1, "%s: unable to resolve: %*.*s",
+			__func__, len, len, hostname);
 	else
 		cFYI(1, "%s: resolved: %*.*s to %s",
 		     __func__, len, len, hostname, *ip_addr);