Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e70aaeb1
Commit
e70aaeb1
authored
Jun 13, 2004
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lock session when reconnecting so we do not oops in retrying sendmsg
Signed-off-by: Steve French (sfrench@us.ibm.com)
parent
6774af67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
fs/cifs/connect.c
fs/cifs/connect.c
+3
-2
fs/cifs/transport.c
fs/cifs/transport.c
+20
-1
No files found.
fs/cifs/connect.c
View file @
e70aaeb1
...
...
@@ -128,7 +128,8 @@ cifs_reconnect(struct TCP_Server_Info *server)
}
}
read_unlock
(
&
GlobalSMBSeslock
);
/* do not want to be sending data on a socket we are freeing */
down
(
&
server
->
tcpSem
);
if
(
server
->
ssocket
)
{
cFYI
(
1
,(
"State: 0x%x Flags: 0x%lx"
,
server
->
ssocket
->
state
,
server
->
ssocket
->
flags
));
...
...
@@ -154,7 +155,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
}
}
spin_unlock
(
&
GlobalMid_Lock
);
up
(
&
ses
->
server
->
tcpSem
);
while
((
server
->
tcpStatus
!=
CifsExiting
)
&&
(
server
->
tcpStatus
!=
CifsGood
))
{
...
...
fs/cifs/transport.c
View file @
e70aaeb1
...
...
@@ -120,6 +120,7 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
unsigned
int
smb_buf_length
,
struct
sockaddr
*
sin
)
{
int
rc
=
0
;
int
i
=
0
;
struct
msghdr
smb_msg
;
struct
iovec
iov
;
mm_segment_t
temp_fs
;
...
...
@@ -151,6 +152,14 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
while
(
iov
.
iov_len
>
0
)
{
rc
=
sock_sendmsg
(
ssocket
,
&
smb_msg
,
smb_buf_length
+
4
);
if
((
rc
==
-
ENOSPC
)
||
(
rc
==
-
EAGAIN
))
{
i
++
;
if
(
i
>
60
)
{
cERROR
(
1
,
(
"sends on sock %p stuck for 30 seconds"
,
ssocket
));
rc
=
-
EAGAIN
;
break
;
}
set_current_state
(
TASK_INTERRUPTIBLE
);
schedule_timeout
(
HZ
/
2
);
continue
;
...
...
@@ -259,7 +268,17 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
midQ
->
midState
=
MID_REQUEST_SUBMITTED
;
rc
=
smb_send
(
ses
->
server
->
ssocket
,
in_buf
,
in_buf
->
smb_buf_length
,
(
struct
sockaddr
*
)
&
(
ses
->
server
->
addr
.
sockAddr
));
up
(
&
ses
->
server
->
tcpSem
);
if
(
rc
<
0
)
{
DeleteMidQEntry
(
midQ
);
up
(
&
ses
->
server
->
tcpSem
);
/* If not lock req, update # of requests on wire to server */
if
(
long_op
<
3
)
{
atomic_dec
(
&
ses
->
server
->
inFlight
);
wake_up
(
&
ses
->
server
->
request_q
);
}
return
rc
;
}
else
up
(
&
ses
->
server
->
tcpSem
);
if
(
long_op
==
-
1
)
goto
cifs_no_response_exit
;
else
if
(
long_op
==
2
)
/* writes past end of file can take looooong time */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment