All of lore.kernel.org
 help / color / mirror / Atom feed
From: Federico Sauter <fsauter-LVkJPw3T+odGBRGhe+f61g@public.gmane.org>
To: Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Issue with upgrade to kernel 3.4.10 -> invalid argument error
Date: Wed, 17 Oct 2012 15:47:50 +0200	[thread overview]
Message-ID: <507EB706.8040406@innominate.com> (raw)
In-Reply-To: <507E808C.1020401-IBi9RG/b67k@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

Dear Suresh,


I took a look at the patch that you mention, but *no*, it does not 
address the issue that I mention. The new code still does not convert 
all slashes to backslashes in the UNC field (i.e. the UNC given 
explicitly as in the unc= option.) Thus, it is still possible to get an 
"invalid parameter" error if you provide the UNC with slashes in it:

mount.cifs //myserver/share /mnt/point -o unc=//myserver/share

This will result in an error, since the unc option contains slashes and 
is converted as follows:

\\myserver/share

Thus causing an error within the extract_hostname function in connect.c.

Please take a look at the attached patch, which corrects this issue and 
let me know what you think. :-)


Thanks and regards

Fred


On 10/17/2012 11:55 AM, Suresh Jayaraman wrote:
> On 10/16/2012 10:33 PM, Federico Sauter wrote:
>> Greetings,
>>
>>
>> I am having an issue mounting CIFS shares since we upgraded our Linux
>> kernel from 2.6.27 to 3.4.10. Each time I try to mount a share drive I
>> get an "Invalid argument" error message even though I am using the same
>> command line that had previously worked, e.g.:
>>
>
> A quick look suggests that the symptom is similar to the one fixed by
> the below commit
>
> commit e73f843a3235a19de38359c91586e9eadef12238
> Author: Suresh Jayaraman<sjayaraman-IBi9RG/b67k@public.gmane.org>
> Date:   Tue Jun 12 07:15:50 2012 +0530
>
>      cifs: fix parsing of password mount option
>
>
> It might be worth trying to see whether the commit fixes the problem you
> are seeing.
>
>
> Thanks
> Suresh
>
>
>

[-- Attachment #2: connect.patch --]
[-- Type: text/x-patch, Size: 834 bytes --]

--- fs/cifs/connect.c.stable	2012-10-16 16:44:50.000000000 +0200
+++ fs/cifs/connect.c.fixed	2012-10-16 18:56:37.000000000 +0200
@@ -1204,6 +1204,7 @@
 	char *string = NULL;
 	char *tmp_end, *value;
 	char delim;
+	char *p, *q;
 
 	separator[0] = ',';
 	separator[1] = 0;
@@ -1662,12 +1663,12 @@
 				printk(KERN_WARNING "CIFS: no memory for UNC\n");
 				goto cifs_parse_mount_err;
 			}
-			strcpy(vol->UNC, string);
 
-			if (strncmp(string, "//", 2) == 0) {
-				vol->UNC[0] = '\\';
-				vol->UNC[1] = '\\';
-			} else if (strncmp(string, "\\\\", 2) != 0) {
+			for (p = string, q = vol->UNC; *p; ++p, ++q) {
+				*q = *p == '/'? '\\' : *p;
+			}
+			*q = '\0';
+			if (strncmp(vol->UNC, "\\\\", 2) != 0) {
 				printk(KERN_WARNING "CIFS: UNC Path does not "
 						    "begin with // or \\\\\n");
 				goto cifs_parse_mount_err;

  parent reply	other threads:[~2012-10-17 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 17:03 Issue with upgrade to kernel 3.4.10 -> invalid argument error Federico Sauter
     [not found] ` <507D934E.9010304-LVkJPw3T+odGBRGhe+f61g@public.gmane.org>
2012-10-17  9:55   ` Suresh Jayaraman
     [not found]     ` <507E808C.1020401-IBi9RG/b67k@public.gmane.org>
2012-10-17 13:47       ` Federico Sauter [this message]
     [not found] ` <CAH2r5mvFzSy5+SxpiBvuLydrsQcuJZn=5s6VCKgWO+K0iergMQ@mail.gmail.com>
     [not found]   ` <CAH2r5mvFzSy5+SxpiBvuLydrsQcuJZn=5s6VCKgWO+K0iergMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-16 19:04     ` Fwd: " Steve French
2012-10-17 13:42     ` Federico Sauter

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=507EB706.8040406@innominate.com \
    --to=fsauter-lvkjpw3t+odgbrghe+f61g@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sjayaraman-IBi9RG/b67k@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.