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
nexedi
linux
Commits
00f6a975
Commit
00f6a975
authored
Apr 22, 2004
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix timeout on close operation when pending signal
parent
afba7f60
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
10 deletions
+25
-10
fs/cifs/CHANGES
fs/cifs/CHANGES
+2
-1
fs/cifs/cifsfs.c
fs/cifs/cifsfs.c
+1
-0
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+4
-1
fs/cifs/connect.c
fs/cifs/connect.c
+2
-0
fs/cifs/transport.c
fs/cifs/transport.c
+16
-8
No files found.
fs/cifs/CHANGES
View file @
00f6a975
...
...
@@ -2,7 +2,8 @@ Version 1.10
------------
Fix reconnection (and certain failed mounts) to properly wake up the
blocked users thread so it does not seem hung (in some cases was blocked
until the cifs receive timeout expired).
until the cifs receive timeout expired). Fix spurious error logging
to kernel log when application with open network files killed.
Version 1.09
------------
...
...
fs/cifs/cifsfs.c
View file @
00f6a975
...
...
@@ -653,6 +653,7 @@ static int cifs_oplock_thread(void * dummyarg)
spin_lock
(
&
GlobalMid_Lock
);
if
(
list_empty
(
&
GlobalOplock_Q
))
{
spin_unlock
(
&
GlobalMid_Lock
);
set_current_state
(
TASK_INTERRUPTIBLE
);
schedule_timeout
(
39
*
HZ
);
}
else
{
oplock_item
=
list_entry
(
GlobalOplock_Q
.
next
,
...
...
fs/cifs/cifssmb.c
View file @
00f6a975
...
...
@@ -822,7 +822,10 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id)
rc
=
SendReceive
(
xid
,
tcon
->
ses
,
(
struct
smb_hdr
*
)
pSMB
,
(
struct
smb_hdr
*
)
pSMBr
,
&
bytes_returned
,
0
);
if
(
rc
)
{
cERROR
(
1
,
(
"Send error in Close = %d"
,
rc
));
if
(
rc
!=-
EINTR
)
{
/* EINTR is expected when user ctl-c to kill app */
cERROR
(
1
,
(
"Send error in Close = %d"
,
rc
));
}
}
if
(
pSMB
)
cifs_buf_release
(
pSMB
);
...
...
fs/cifs/connect.c
View file @
00f6a975
...
...
@@ -223,6 +223,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
csocket
=
server
->
ssocket
;
continue
;
}
else
if
((
length
==
-
ERESTARTSYS
)
||
(
length
==
-
EAGAIN
))
{
set_current_state
(
TASK_INTERRUPTIBLE
);
schedule_timeout
(
1
);
/* minimum sleep to prevent looping
allowing socket to clear and app threads to set
tcpStatus CifsNeedReconnect if server hung */
...
...
@@ -277,6 +278,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
}
else
{
/* give server a second to
clean up before reconnect attempt */
set_current_state
(
TASK_INTERRUPTIBLE
);
schedule_timeout
(
HZ
);
/* always try 445 first on reconnect
since we get NACK on some if we ever
...
...
fs/cifs/transport.c
View file @
00f6a975
...
...
@@ -151,6 +151,7 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
set_fs
(
get_ds
());
rc
=
sock_sendmsg
(
ssocket
,
&
smb_msg
,
smb_buf_length
+
4
);
while
((
rc
==
-
ENOSPC
)
||
(
rc
==
-
EAGAIN
))
{
set_current_state
(
TASK_INTERRUPTIBLE
);
schedule_timeout
(
HZ
/
2
);
rc
=
sock_sendmsg
(
ssocket
,
&
smb_msg
,
smb_buf_length
+
4
);
}
...
...
@@ -233,16 +234,23 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
timeout
=
15
*
HZ
;
/* wait for 15 seconds or until woken up due to response arriving or
due to last connection to this server being unmounted */
timeout
=
wait_event_interruptible_timeout
(
ses
->
server
->
response_q
,
(
midQ
->
midState
&
MID_RESPONSE_RECEIVED
)
||
((
ses
->
server
->
tcpStatus
!=
CifsGood
)
&&
(
ses
->
server
->
tcpStatus
!=
CifsNew
)),
timeout
);
if
(
signal_pending
(
current
))
{
cFYI
(
1
,
(
"CIFS: caught signal"
));
/* if signal pending do not hold up user for full smb timeout
but we still give response a change to complete */
if
(
midQ
->
midState
&
MID_REQUEST_SUBMITTED
)
{
set_current_state
(
TASK_UNINTERRUPTIBLE
);
timeout
=
schedule_timeout
(
HZ
);
}
}
else
{
/* use normal timeout */
timeout
=
wait_event_interruptible_timeout
(
ses
->
server
->
response_q
,
(
midQ
->
midState
&
MID_RESPONSE_RECEIVED
)
||
((
ses
->
server
->
tcpStatus
!=
CifsGood
)
&&
(
ses
->
server
->
tcpStatus
!=
CifsNew
)),
timeout
);
}
if
(
signal_pending
(
current
))
{
DeleteMidQEntry
(
midQ
);
return
-
EINTR
;
return
-
EINTR
;
/* BB are we supposed to return -ERESTARTSYS ? */
}
else
{
/* BB spinlock protect this against races with demux thread */
spin_lock
(
&
GlobalMid_Lock
);
if
(
midQ
->
resp_buf
)
{
...
...
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