Discussion:
Mount cifs using SMB2 - Invalid argument
Karin Hedlund
2014-06-09 09:50:54 UTC
Permalink
From an embedded device, I'm trying to mount a samba share using SMB2, with the 'vers=2.1' mount option, but I don't seem to get it to work, so I was hoping somebody could maybe shed some light.
mount -t cifs //192.168.0.1/networkshare /tmp/nas -o username=,password=,vers=2.1,nounix,noserverino,uid=123,gid=123,nobrl,file_mode=0770,dir_mode=0770,iocharset=utf8
mount: mounting //192.168.0.1/networkshare on /tmp/nas failed: Invalid argument

Client: Embedded device with Linux 3.14 kernel, BusyBox version v1.20.2p3
I have enabled and built the embedded device's kernel with CONFIG_CIFS_SMB2.
/proc/fs/cifs/DebugData:
CIFS Version 2.02
Features:
Active VFS Requests: 0
Servers:

dmesg:
<7>[ 3937.470000] fs/cifs/cifsfs.c: Devname: //192.168.0.1/networkshare flags: 32768
<7>[ 3937.470000] fs/cifs/connect.c: iocharset set to utf8
<7>[ 3937.470000] fs/cifs/connect.c: Anonymous login
<7>[ 3937.470000] fs/cifs/connect.c: file mode: 0x1f8 dir mode: 0x1f8
<7>[ 3937.470000] fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 2 with uid: 0
<7>[ 3937.470000] fs/cifs/connect.c: UNC: \\192.168.0.1\networkshare
<7>[ 3937.470000] fs/cifs/connect.c: Socket created
<7>[ 3937.470000] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x2bc
<7>[ 3937.470000] fs/cifs/connect.c: CIFS VFS: in cifs_get_smb_ses as Xid: 3 with uid: 0
<7>[ 3937.470000] fs/cifs/connect.c: Existing smb sess not found
<7>[ 3937.470000] fs/cifs/smb2pdu.c: Negotiate protocol
<7>[ 3937.470000] fs/cifs/transport.c: Sending smb: smb_len=102
<7>[ 3937.470000] fs/cifs/connect.c: Demultiplex PID: 3359
<7>[ 3937.480000] fs/cifs/connect.c: RFC1002 header 0x49
<7>[ 3937.480000] fs/cifs/smb2misc.c: smb2_check_message length: 0x4d, smb_buf_length: 0x49
<7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 data length 0 offset 0
<7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 len 77
<7>[ 3937.480000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4
<7>[ 3937.480000] fs/cifs/smb2maperror.c: Mapping SMB2 status code -1073741811 to POSIX err -22
<7>[ 3937.480000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
<7>[ 3937.480000] fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 3) rc = -22
<7>[ 3937.480000] fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 2) rc = -22

Server: Samba 3.6.6 on Debian Wheezy
I do have the max protocol = SMB2 under my [global] section in my samba.conf, and have restarted samba.

I've also tried to look at the communication over wireshark, and I do see several SMB Negotiate Protocol requests and responses, but in all of the requests there's just "Requested Dialects: Dialect: NT LM 0.12, and in all the responses same thing, Dialect Index:0 NT LM 0.12 - which, as far as I know corresponds to SMB version 1 (?), not the 2.1 version I was hoping for...

I'm lost here. I thought this was all one needed to do. So, any thoughts, insights or ideas would make me very happy. Thanks you guys!

Kind regards,
Karin
Shirish Pargaonkar
2014-06-09 12:18:05 UTC
Permalink
Is it possible to attach wireshark trace here?

Regards,

Shirish
From an embedded device, I'm trying to mount a samba share using SMB2, with the 'vers=2.1' mount option, but I don't seem to get it to work, so I was hoping somebody could maybe shed some light.
mount -t cifs //192.168.0.1/networkshare /tmp/nas -o username=,password=,vers=2.1,nounix,noserverino,uid=123,gid=123,nobrl,file_mode=0770,dir_mode=0770,iocharset=utf8
mount: mounting //192.168.0.1/networkshare on /tmp/nas failed: Invalid argument
Client: Embedded device with Linux 3.14 kernel, BusyBox version v1.20.2p3
I have enabled and built the embedded device's kernel with CONFIG_CIFS_SMB2.
CIFS Version 2.02
Active VFS Requests: 0
<7>[ 3937.470000] fs/cifs/cifsfs.c: Devname: //192.168.0.1/networkshare flags: 32768
<7>[ 3937.470000] fs/cifs/connect.c: iocharset set to utf8
<7>[ 3937.470000] fs/cifs/connect.c: Anonymous login
<7>[ 3937.470000] fs/cifs/connect.c: file mode: 0x1f8 dir mode: 0x1f8
<7>[ 3937.470000] fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 2 with uid: 0
<7>[ 3937.470000] fs/cifs/connect.c: UNC: \\192.168.0.1\networkshare
<7>[ 3937.470000] fs/cifs/connect.c: Socket created
<7>[ 3937.470000] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x2bc
<7>[ 3937.470000] fs/cifs/connect.c: CIFS VFS: in cifs_get_smb_ses as Xid: 3 with uid: 0
<7>[ 3937.470000] fs/cifs/connect.c: Existing smb sess not found
<7>[ 3937.470000] fs/cifs/smb2pdu.c: Negotiate protocol
<7>[ 3937.470000] fs/cifs/transport.c: Sending smb: smb_len=102
<7>[ 3937.470000] fs/cifs/connect.c: Demultiplex PID: 3359
<7>[ 3937.480000] fs/cifs/connect.c: RFC1002 header 0x49
<7>[ 3937.480000] fs/cifs/smb2misc.c: smb2_check_message length: 0x4d, smb_buf_length: 0x49
<7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 data length 0 offset 0
<7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 len 77
<7>[ 3937.480000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4
<7>[ 3937.480000] fs/cifs/smb2maperror.c: Mapping SMB2 status code -1073741811 to POSIX err -22
<7>[ 3937.480000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
<7>[ 3937.480000] fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 3) rc = -22
<7>[ 3937.480000] fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 2) rc = -22
Server: Samba 3.6.6 on Debian Wheezy
I do have the max protocol = SMB2 under my [global] section in my samba.conf, and have restarted samba.
I've also tried to look at the communication over wireshark, and I do see several SMB Negotiate Protocol requests and responses, but in all of the requests there's just "Requested Dialects: Dialect: NT LM 0.12, and in all the responses same thing, Dialect Index:0 NT LM 0.12 - which, as far as I know corresponds to SMB version 1 (?), not the 2.1 version I was hoping for...
I'm lost here. I thought this was all one needed to do. So, any thoughts, insights or ideas would make me very happy. Thanks you guys!
Kind regards,
Karin
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
Shirish Pargaonkar
2014-06-09 14:41:35 UTC
Permalink
vers=2.0 does not work?
What I said about wireshark was all wrong! So sorry, my bad!
(I had another device connected also, and it was that device's SMB protocol negotiation I saw now that I look at it again).
For this specific problem and device I get only one request and one response, and yes, it's indeed SMB protocol version 2 they're trying to negotiate. But I get
NegotiateProcotol Response, Error: STATUS_INVALID_PARAMETER.
Post by Shirish Pargaonkar
Is it possible to attach wireshark trace here?
Regards,
Shirish
No, unfortunately I can't post the wireshark trace. Sorry about that. I've attached wireshark screenshots for the SMB request and response packets though, hopefully it's better than nothing.
Post by Shirish Pargaonkar
From an embedded device, I'm trying to mount a samba share using SMB2, with the 'vers=2.1' mount option, but I don't seem to get it to work, so I was hoping somebody could maybe shed some light.
mount -t cifs //192.168.0.1/networkshare /tmp/nas -o
username=,password=,vers=2.1,nounix,noserverino,uid=123,gid=123,nobrl,
file_mode=0770,dir_mode=0770,iocharset=utf8
mount: mounting //192.168.0.1/networkshare on /tmp/nas failed: Invalid argument
Client: Embedded device with Linux 3.14 kernel, BusyBox version
v1.20.2p3 I have enabled and built the embedded device's kernel with CONFIG_CIFS_SMB2.
CIFS Version 2.02
Active VFS Requests: 0
//192.168.0.1/networkshare flags: 32768 <7>[ 3937.470000]
fs/cifs/connect.c: iocharset set to utf8 <7>[ 3937.470000]
fs/cifs/connect.c: Anonymous login <7>[ 3937.470000]
fs/cifs/connect.c: file mode: 0x1f8 dir mode: 0x1f8 <7>[ 3937.470000]
fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 2 with uid: 0 <7>[
3937.470000] fs/cifs/connect.c: UNC: \\192.168.0.1\networkshare <7>[
3937.470000] fs/cifs/connect.c: Socket created <7>[ 3937.470000]
fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x2bc <7>[
3 with uid: 0 <7>[ 3937.470000] fs/cifs/connect.c: Existing smb sess
not found <7>[ 3937.470000] fs/cifs/smb2pdu.c: Negotiate protocol <7>[
3937.470000] fs/cifs/transport.c: Sending smb: smb_len=102 <7>[
3937.470000] fs/cifs/connect.c: Demultiplex PID: 3359 <7>[
3937.480000] fs/cifs/connect.c: RFC1002 header 0x49 <7>[ 3937.480000]
0x49 <7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 data length 0 offset 0
<7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 len 77 <7>[ 3937.480000]
fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4 <7>[
3937.480000] fs/cifs/smb2maperror.c: Mapping SMB2 status code
-1073741811 to POSIX err -22 <7>[ 3937.480000] fs/cifs/misc.c: Null
buffer passed to cifs_small_buf_release <7>[ 3937.480000]
fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 3) rc =
-22 <7>[ 3937.480000] fs/cifs/connect.c: CIFS VFS: leaving cifs_mount
(xid = 2) rc = -22
Server: Samba 3.6.6 on Debian Wheezy
I do have the max protocol = SMB2 under my [global] section in my samba.conf, and have restarted samba.
I've also tried to look at the communication over wireshark, and I do see several SMB Negotiate Protocol requests and responses, but in all of the requests there's just "Requested Dialects: Dialect: NT LM 0.12, and in all the responses same thing, Dialect Index:0 NT LM 0.12 - which, as far as I know corresponds to SMB version 1 (?), not the 2.1 version I was hoping for...
I'm lost here. I thought this was all one needed to do. So, any thoughts, insights or ideas would make me very happy. Thanks you guys!
Kind regards,
Karin
Karin Hedlund
2014-06-10 08:17:53 UTC
Permalink
Post by Shirish Pargaonkar
vers=2.0 does not work?
Well, actually vers=2.0 does work fine! Thanks for the suggestion! :) I did try it earlier, but probably did not have all the other things in place by then, because I know it didn't work then, but it does now.
I wonder why nothing above vers=2.0 works though, any ideas?
Post by Shirish Pargaonkar
What I said about wireshark was all wrong! So sorry, my bad!
(I had another device connected also, and it was that device's SMB protocol negotiation I saw now that I look at it again).
For this specific problem and device I get only one request and one
response, and yes, it's indeed SMB protocol version 2 they're trying to negotiate. But I get NegotiateProcotol Response, Error: STATUS_INVALID_PARAMETER.
Post by Shirish Pargaonkar
Is it possible to attach wireshark trace here?
Regards,
Shirish
No, unfortunately I can't post the wireshark trace. Sorry about that. I've attached wireshark screenshots for the SMB request and response packets though, hopefully it's better than nothing.
Post by Shirish Pargaonkar
From an embedded device, I'm trying to mount a samba share using SMB2, with the 'vers=2.1' mount option, but I don't seem to get it to work, so I was hoping somebody could maybe shed some light.
mount -t cifs //192.168.0.1/networkshare /tmp/nas -o
username=,password=,vers=2.1,nounix,noserverino,uid=123,gid=123,nobr
l,
file_mode=0770,dir_mode=0770,iocharset=utf8
mount: mounting //192.168.0.1/networkshare on /tmp/nas failed: Invalid argument
Client: Embedded device with Linux 3.14 kernel, BusyBox version
v1.20.2p3 I have enabled and built the embedded device's kernel with CONFIG_CIFS_SMB2.
CIFS Version 2.02
Active VFS Requests: 0
//192.168.0.1/networkshare flags: 32768 <7>[ 3937.470000]
fs/cifs/connect.c: iocharset set to utf8 <7>[ 3937.470000]
fs/cifs/connect.c: Anonymous login <7>[ 3937.470000]
fs/cifs/connect.c: file mode: 0x1f8 dir mode: 0x1f8 <7>[
3937.470000]
fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 2 with uid: 0
<7>[ 3937.470000] fs/cifs/connect.c: UNC: \\192.168.0.1\networkshare
<7>[ 3937.470000] fs/cifs/connect.c: Socket created <7>[
3937.470000]
fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x2bc <7>[
3 with uid: 0 <7>[ 3937.470000] fs/cifs/connect.c: Existing smb sess
not found <7>[ 3937.470000] fs/cifs/smb2pdu.c: Negotiate protocol
<7>[ 3937.470000] fs/cifs/transport.c: Sending smb: smb_len=102 <7>[
3937.470000] fs/cifs/connect.c: Demultiplex PID: 3359 <7>[
3937.480000] fs/cifs/connect.c: RFC1002 header 0x49 <7>[
3937.480000]
0x49 <7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 data length 0 offset
0 <7>[ 3937.480000] fs/cifs/smb2misc.c: SMB2 len 77 <7>[
3937.480000]
fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4 <7>[
3937.480000] fs/cifs/smb2maperror.c: Mapping SMB2 status code
-1073741811 to POSIX err -22 <7>[ 3937.480000] fs/cifs/misc.c: Null
buffer passed to cifs_small_buf_release <7>[ 3937.480000]
fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 3) rc =
-22 <7>[ 3937.480000] fs/cifs/connect.c: CIFS VFS: leaving
cifs_mount (xid = 2) rc = -22
Server: Samba 3.6.6 on Debian Wheezy I do have the max protocol =
SMB2 under my [global] section in my samba.conf, and have restarted samba.
I've also tried to look at the communication over wireshark, and I do see several SMB Negotiate Protocol requests and responses, but in all of the requests there's just "Requested Dialects: Dialect: NT LM 0.12, and in all the responses same thing, Dialect Index:0 NT LM 0.12 - which, as far as I know corresponds to SMB version 1 (?), not the 2.1 version I was hoping for...
I'm lost here. I thought this was all one needed to do. So, any thoughts, insights or ideas would make me very happy. Thanks you
Karin Hedlund
2014-06-10 12:12:11 UTC
Permalink
Post by Karin Hedlund
Post by Shirish Pargaonkar
vers=2.0 does not work?
Well, actually vers=2.0 does work fine! Thanks for the suggestion! :) I did try it earlier, but probably did not have all the other things in place by then, because I know it didn't work then, but it does now.
I wonder why nothing above vers=2.0 works though, any ideas?
The obvious reason would be samba 3.6 on the server instead of samba 4 or later
Ah, ok, I see. I thought the client and server would sort of 'autonegotiate' and agree on the highest version they both support, but I guess that's not the case when using the 'vers' mount.cifs option then? In that case what I'm seeing is very much expected, so I'm very happy now. Thanks for all the support!

Any news on the upgrade of the default SMB version of the in-kernel cifs module, by the way?
I found the SDC2013 "SMB3.02 And Linux: A Status Update" presentation (http://www.snia.org/sites/default/files2/SDC2013/presentations/Revisions/StevenFrench_SMB3_Meets_Linux_ver3_revision.pdf), but since it's almost already old by now and I'm curious, I thought I'd
Steve French
2014-06-10 16:30:48 UTC
Permalink
Post by Karin Hedlund
Post by Karin Hedlund
Post by Shirish Pargaonkar
vers=2.0 does not work?
Well, actually vers=2.0 does work fine! Thanks for the suggestion! :) I did try it earlier, but probably did not have all the other things in place by then, because I know it didn't work then, but it does now.
I wonder why nothing above vers=2.0 works though, any ideas?
The obvious reason would be samba 3.6 on the server instead of samba 4 or later
Ah, ok, I see. I thought the client and server would sort of 'autonegotiate' and agree on the highest version they both support, but I guess that's not the case when using the 'vers' mount.cifs option then? In that case what I'm seeing is very much expected, so I'm very happy now. Thanks for all the support!
We don't autonegotiate smb2 vs. smb2.1 vs. smb3 vs. smb3.02 (yet) -
specify specific dialect on mount. Not clear if this should be
handled in user space or kernel either (if at all). On the other
hand, looks like the server does not support smb3 (thus my guess that
you are running an SMB3.6 based, rather than Samba 4.x based filer).
Post by Karin Hedlund
Any news on the upgrade of the default SMB version of the in-kernel cifs module, by the way?
1) MultiCredit support (faster large file copy) needs to be added
(Pavel is looking at this)

2) Unix extensions (I have a prototype small patch which requests such
support on open, but no server support yet)
Post by Karin Hedlund
I found the SDC2013 "SMB3.02 And Linux: A Status Update" presentation (http://www.snia.org/sites/default/files2/SDC2013/presentations/Revisions/StevenFrench_SMB3_Meets_Linux_ver3_revision.pdf), but since it's almost already old by now and I'm curious, I thought I'd ask. :)
--
Thanks,

Steve
Loading...