[linux-cifs-client,2/2] cifs: add cFYI messages with some of the saved strings from ssetup/tcon
diff mbox

Message ID 1239895313-11841-2-git-send-email-jlayton@redhat.com
State New, archived
Headers show

Commit Message

Jeff Layton April 16, 2009, 3:21 p.m. UTC
...to make it easier to find problems in this area in the future.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/connect.c |    5 ++++-
 fs/cifs/sess.c    |    9 +++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

Comments

Steve French April 16, 2009, 5:42 p.m. UTC | #1
I merged this  (after correcting various "checkpatch" warnings), and
also merged the previous patch from Jeff (Patch 1/2)

On Thu, Apr 16, 2009 at 10:21 AM, Jeff Layton <jlayton@redhat.com> wrote:
> ...to make it easier to find problems in this area in the future.
>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/cifs/connect.c |    5 ++++-
>  fs/cifs/sess.c    |    9 +++++++--
>  2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 1a93604..4a04ecd 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -3757,11 +3757,14 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
>                                kfree(tcon->nativeFileSystem);
>                                tcon->nativeFileSystem =
>                                    kzalloc((4 * length) + 2, GFP_KERNEL);
> -                               if (tcon->nativeFileSystem)
> +                               if (tcon->nativeFileSystem) {
>                                        cifs_strfromUCS_le(
>                                                tcon->nativeFileSystem,
>                                                (__le16 *) bcc_ptr,
>                                                length, nls_codepage);
> +                                       cFYI(1, ("nativeFileSystem=%s",
> +                                               tcon->nativeFileSystem));
> +                               }
>                                bcc_ptr += (2 * length) + 2;
>                        }
>                        /* else do not bother copying these information fields*/
> diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
> index 70d04d0..56d206c 100644
> --- a/fs/cifs/sess.c
> +++ b/fs/cifs/sess.c
> @@ -311,8 +311,10 @@ static int decode_unicode_ssetup(char **pbcc_area, int bleft,
>        kfree(ses->serverOS);
>        /* UTF-8 string will not grow more than four times as big as UCS-16 */
>        ses->serverOS = kzalloc((4 * len) + 2 /* trailing null */, GFP_KERNEL);
> -       if (ses->serverOS != NULL)
> +       if (ses->serverOS != NULL) {
>                cifs_strfromUCS_le(ses->serverOS, (__le16 *)data, len, nls_cp);
> +               cFYI(1,("serverOS=%s", ses->serverOS));
> +       }
>        data += 2 * (len + 1);
>        words_left -= len + 1;
>
> @@ -327,6 +329,7 @@ static int decode_unicode_ssetup(char **pbcc_area, int bleft,
>        if (ses->serverNOS != NULL) {
>                cifs_strfromUCS_le(ses->serverNOS, (__le16 *)data, len,
>                                   nls_cp);
> +               cFYI(1,("serverNOS=%s", ses->serverNOS));
>                if (strncmp(ses->serverNOS, "NT LAN Manager 4", 16) == 0) {
>                        cFYI(1, ("NT4 server"));
>                        ses->flags |= CIFS_SES_NT4;
> @@ -343,9 +346,11 @@ static int decode_unicode_ssetup(char **pbcc_area, int bleft,
>
>        kfree(ses->serverDomain);
>        ses->serverDomain = kzalloc((4 * len) + 2, GFP_KERNEL);
> -       if (ses->serverDomain != NULL)
> +       if (ses->serverDomain != NULL) {
>                cifs_strfromUCS_le(ses->serverDomain, (__le16 *)data, len,
>                                   nls_cp);
> +               cFYI(1,("serverDomain=%s", ses->serverDomain));
> +       }
>        data += 2 * (len + 1);
>        words_left -= len + 1;
>
> --
> 1.5.5.6
>
>

Patch
diff mbox

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 1a93604..4a04ecd 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3757,11 +3757,14 @@  CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
 				kfree(tcon->nativeFileSystem);
 				tcon->nativeFileSystem =
 				    kzalloc((4 * length) + 2, GFP_KERNEL);
-				if (tcon->nativeFileSystem)
+				if (tcon->nativeFileSystem) {
 					cifs_strfromUCS_le(
 						tcon->nativeFileSystem,
 						(__le16 *) bcc_ptr,
 						length, nls_codepage);
+					cFYI(1, ("nativeFileSystem=%s",
+						tcon->nativeFileSystem));
+				}
 				bcc_ptr += (2 * length) + 2;
 			}
 			/* else do not bother copying these information fields*/
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 70d04d0..56d206c 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -311,8 +311,10 @@  static int decode_unicode_ssetup(char **pbcc_area, int bleft,
 	kfree(ses->serverOS);
 	/* UTF-8 string will not grow more than four times as big as UCS-16 */
 	ses->serverOS = kzalloc((4 * len) + 2 /* trailing null */, GFP_KERNEL);
-	if (ses->serverOS != NULL)
+	if (ses->serverOS != NULL) {
 		cifs_strfromUCS_le(ses->serverOS, (__le16 *)data, len, nls_cp);
+		cFYI(1,("serverOS=%s", ses->serverOS));
+	}
 	data += 2 * (len + 1);
 	words_left -= len + 1;
 
@@ -327,6 +329,7 @@  static int decode_unicode_ssetup(char **pbcc_area, int bleft,
 	if (ses->serverNOS != NULL) {
 		cifs_strfromUCS_le(ses->serverNOS, (__le16 *)data, len,
 				   nls_cp);
+		cFYI(1,("serverNOS=%s", ses->serverNOS));
 		if (strncmp(ses->serverNOS, "NT LAN Manager 4", 16) == 0) {
 			cFYI(1, ("NT4 server"));
 			ses->flags |= CIFS_SES_NT4;
@@ -343,9 +346,11 @@  static int decode_unicode_ssetup(char **pbcc_area, int bleft,
 
 	kfree(ses->serverDomain);
 	ses->serverDomain = kzalloc((4 * len) + 2, GFP_KERNEL);
-	if (ses->serverDomain != NULL)
+	if (ses->serverDomain != NULL) {
 		cifs_strfromUCS_le(ses->serverDomain, (__le16 *)data, len,
 				   nls_cp);
+		cFYI(1,("serverDomain=%s", ses->serverDomain));
+	}
 	data += 2 * (len + 1);
 	words_left -= len + 1;