diff options
author | Suresh Jayaraman <sjayaraman@suse.de> | 2009-08-20 13:03:34 +0530 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-09-01 17:08:48 +0000 |
commit | bdb97adcdf0993adbd2eef44b4533620d43792de (patch) | |
tree | 5d2a120233c93d6a372d26d5ce3fc6cb6525fa6e /fs/cifs/cifsfs.h | |
parent | 1b3859bc9e20d764316346665fc93ecea2d2b176 (diff) | |
download | linux-stable-bdb97adcdf0993adbd2eef44b4533620d43792de.tar.gz linux-stable-bdb97adcdf0993adbd2eef44b4533620d43792de.tar.bz2 linux-stable-bdb97adcdf0993adbd2eef44b4533620d43792de.zip |
PATCH] cifs: fix broken mounts when a SSH tunnel is used (try #4)
One more try..
It seems there is a regression that got introduced while Jeff fixed
all the mount/umount races. While attempting to find whether a tcp
session is already existing, we were not checking whether the "port"
used are the same. When a second mount is attempted with a different
"port=" option, it is being ignored. Because of this the cifs mounts
that uses a SSH tunnel appears to be broken.
Steps to reproduce:
1. create 2 shares
# SSH Tunnel a SMB session
2. ssh -f -L 6111:127.0.0.1:445 root@localhost "sleep 86400"
3. ssh -f -L 6222:127.0.0.1:445 root@localhost "sleep 86400"
4. tcpdump -i lo 6111 &
5. mkdir -p /mnt/mnt1
6. mkdir -p /mnt/mnt2
7. mount.cifs //localhost/a /mnt/mnt1 -o username=guest,ip=127.0.0.1,port=6111
#(shows tcpdump activity on port 6111)
8. mount.cifs //localhost/b /mnt/mnt2 -o username=guest,ip=127.0.0.1,port=6222
#(shows tcpdump activity only on port 6111 and not on 6222
Fix by adding a check to compare the port _only_ if the user tries to
override the tcp port with "port=" option, before deciding that an
existing tcp session is found. Also, clean up a bit by replacing
if-else if by a switch statment while at it as suggested by Jeff.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.h')
0 files changed, 0 insertions, 0 deletions