login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
May
»
7
Re: [patch 2/2] cifs - cifs_find_tcp_session cleanup
view
thread
Score:
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Cyrill Gorcunov <gorcunov@...>
To: Steve French <smfrench@...>
Cc: Steve French <sfrench@...>, <linux-kernel@...>, Andrew Morton <akpm@...>
Subject:
Re: [patch 2/2] cifs - cifs_find_tcp_session cleanup
Date: Wednesday, May 7, 2008 - 12:17 am
On Wed, May 7, 2008 at 2:07 AM, Steve French <smfrench@gmail.com> wrote:
quoted text
> This looks like it would fail in the ipv6 case - because > target_ip_addr (the ipv4 address) would be null and it would exit > before checking. > > > > > > On Thu, May 1, 2008 at 10:48 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote: > > This patch is to remove too indented code in cifs_find_tcp_session. > > Also memcmp was used wrongly - we would have found the session > > which IP6 addresses didn't match. > > > > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> > > --- > > > > Index: linux-2.6.git/fs/cifs/connect.c > > =================================================================== > > --- linux-2.6.git.orig/fs/cifs/connect.c 2008-05-01 19:02:51.000000000 +0400 > > +++ linux-2.6.git/fs/cifs/connect.c 2008-05-01 19:36:54.000000000 +0400 > > @@ -1318,42 +1318,44 @@ cifs_parse_mount_options(char *options, > > > > static struct cifsSesInfo * > > cifs_find_tcp_session(struct in_addr *target_ip_addr, > > - struct in6_addr *target_ip6_addr, > > - char *userName, struct TCP_Server_Info **psrvTcp) > > + struct in6_addr *target_ip6_addr, > > + char *userName, struct TCP_Server_Info **psrvTcp) > > { > > struct list_head *tmp; > > struct cifsSesInfo *ses; > > + > > *psrvTcp = NULL; > > - read_lock(&GlobalSMBSeslock); > > > > + if (!target_ip_addr) > > + return NULL; > > + > > + read_lock(&GlobalSMBSeslock); > > list_for_each(tmp, &GlobalSMBSessionList) { > > ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); > > - if (ses->server) { > > - if ((target_ip_addr && > > - (ses->server->addr.sockAddr.sin_addr.s_addr > > - == target_ip_addr->s_addr)) || (target_ip6_addr > > - && memcmp(&ses->server->addr.sockAddr6.sin6_addr, > > - target_ip6_addr, sizeof(*target_ip6_addr)))) { > > - /* BB lock server and tcp session and increment > > - use count here?? */ > > - > > - /* found a match on the TCP session */ > > - *psrvTcp = ses->server; > > - > > - /* BB check if reconnection needed */ > > - if (strncmp > > - (ses->userName, userName, > > - MAX_USERNAME_SIZE) == 0){ > > - read_unlock(&GlobalSMBSeslock); > > - /* Found exact match on both TCP and > > - SMB sessions */ > > - return ses; > > - } > > - } > > - } > > - /* else tcp and smb sessions need reconnection */ > > + if (!ses->server) > > + continue; > > + > > + if (ses->server->addr.sockAddr.sin_addr.s_addr != target_ip_addr->s_addr || > > + memcmp(&ses->server->addr.sockAddr6.sin6_addr, > > + target_ip6_addr, sizeof(*target_ip6_addr))) > > + continue; > > + > > + /* BB lock server and tcp session and increment > > + use count here?? */ > > + > > + /* found a match on the TCP session */ > > + *psrvTcp = ses->server; > > + > > + /* BB check if reconnection needed */ > > + if (strncmp(ses->userName, userName, MAX_USERNAME_SIZE)) > > + continue; > > + > > + /* Found exact match on both TCP and SMB sessions */ > > + read_unlock(&GlobalSMBSeslock); > > + return ses; > > } > > read_unlock(&GlobalSMBSeslock); > > + > > return NULL; > > } > > > > > > -- > > > > > > -- > Thanks, > > Steve >
Ah, indeed! Thanks, Steve, I'm really sorry for this. Will remake it. Andrew, could you drop it from -mm please? --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[patch 2/2] cifs - cifs_find_tcp_session cleanup
, Cyrill Gorcunov
, (Thu May 1, 11:48 am)
Re: [patch 2/2] cifs - cifs_find_tcp_session cleanup
, Steve French
, (Tue May 6, 6:07 pm)
Re: [patch 2/2] cifs - cifs_find_tcp_session cleanup
, Cyrill Gorcunov
, (Wed May 7, 1:48 am)
Re: [patch 2/2] cifs - cifs_find_tcp_session cleanup
, Steve French
, (Fri May 9, 2:55 pm)
Re: [patch 2/2] cifs - cifs_find_tcp_session cleanup
, Cyrill Gorcunov
, (Wed May 7, 12:17 am)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-btrfs
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-ia64
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-kvm
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
open-graphics
open-graphics-announce-kt
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
reiserfs-devel
tux3
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Pardo
Re: pthread_create() slow for many threads; also time to revisit 64b context switc...
Paul Jackson
Inquiry: Should we remove "isolcpus= kernel boot option? (may have realtime uses)
Srivatsa Vaddagiri
Re: [PATCH, RFC] reimplement flush_workqueue()
Peter Zijlstra
Re: Btrfs v0.16 released
git
:
Giuseppe Bilotta
Re: gitweb and remote branches
Miklos Vajna
[rfc] git submodules howto
JD Guzman
C# Git Implementation
Junio C Hamano
Re: [PATCH] fix parallel make problem
openbsd-misc
:
Richard Stallman
Real men don't attack straw men
Steve B
SSH brute force attacks no longer being caught by PF rule
GVG GVG
ssh_exchange_identification: Connection closed by remote host
Marius ROMAN
1440x900 resolution problem
linux-netdev
:
Tomasz Grobelny
[PATCH 0/5] [DCCP]: Queuing policies
Dushan Tcholich
Re: ksoftirqd high cpu load on kernels 2.6.24 to 2.6.27-rc1-mm1
John Heffner
Re: A Linux TCP SACK Question
Denys Fedoryshchenko
Re: Could you make vconfig less stupid?
Latest forum posts
Serial Driver Implementation Help
7 hours ago
Linux kernel
aacraid bad
8 hours ago
Linux general
Tools: GCC 3.4.6, Final GCC 3 Release
1 day ago
Applications and Utilities
GNU/Hurd is so awful
2 days ago
GNU/Hurd
read /dev/mem not working in 2.6
3 days ago
Linux general
Issues with NETLINK sockets
4 days ago
Linux kernel
Anyone experiancing compiling issues with 2.6.26.6 patching with rt patch 2.6.26.6-rt11?
5 days ago
Linux kernel
Change network interface from eth0 to ppp0
5 days ago
Linux general
kernel module to intercept socket creation
5 days ago
Linux kernel
command to set Subnet Mask
5 days ago
Linux general
Show all forums...
Recent Tags
more tags
Colocation donated by:
Who's online
There are currently
3 users
and
1205 guests
online.
Online users
zeekec
puntmuts
Jeremy
Syndicate
speck-geostationary